Skip to content

Comments

[FIX] account_payment_pro: Matched amount based in payment_type#925

Open
feg-adhoc wants to merge 1 commit intoingadhoc:18.0from
adhoc-dev:18.0-h-109971-feg
Open

[FIX] account_payment_pro: Matched amount based in payment_type#925
feg-adhoc wants to merge 1 commit intoingadhoc:18.0from
adhoc-dev:18.0-h-109971-feg

Conversation

@feg-adhoc
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings February 23, 2026 20:47
@roboadhoc
Copy link
Contributor

Pull request status dashboard

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Este PR corrige un bug en el cálculo del signo del monto conciliado (matched_amount) en pagos. El problema estaba en que se utilizaba partner_type (customer/supplier) para determinar el signo, cuando debería usarse payment_type (inbound/outbound) que representa correctamente la dirección del pago.

Changes:

  • Cambio de partner_type == "supplier" a payment_type == "outbound" en el cálculo del signo dentro de _compute_matched_amounts

Comment on lines +472 to 475
sign = rec.payment_type == "outbound" and -1.0 or 1.0
rec.matched_amount = sign * sum(
rec.matched_move_line_ids.with_context(matched_payment_ids=rec.ids).mapped("payment_matched_amount")
)
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aunque el fix es correcto, sería recomendable agregar tests que validen el cálculo de matched_amount para diferentes combinaciones de payment_type y partner_type, especialmente casos edge como:

  • Pagos outbound a customers (devoluciones)
  • Pagos inbound de suppliers (notas de crédito)

Esto ayudaría a prevenir regresiones futuras de este bug que se está corrigiendo.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants