Skip to content

Commit 8a9b666

Browse files
committed
[FIX] l10n_latam_check_ux: force debited state when outstanding account is not reconcilable
When an own check's outstanding account (payment_method_line_id.payment_account_id) is not marked as reconcilable, the base _compute_issue_state heuristic fails: it checks whether the matched debit lines belong to accounts of type liability_payable/asset_receivable to distinguish voided vs debited, but non-reconcilable accounts are never matched that way, causing the state to fall back to voided incorrectly. Fix: override _compute_issue_state in the UX module to inspect the outstanding_line_id.account_id.reconcile flag directly. If the account is non-reconcilable and the line is fully settled (amount_residual == 0), the check must be debited, not voided.
1 parent 952bf84 commit 8a9b666

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

l10n_latam_check_ux/models/l10n_latam_check.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,13 @@ def _compute_issuer_vat(self):
9191
partner_id_change = self._origin.payment_id.partner_id != self.payment_id.partner_id
9292
if payment_method_change or partner_id_change:
9393
super()._compute_issuer_vat()
94+
95+
@api.depends(
96+
"outstanding_line_id.account_id.reconcile",
97+
)
98+
def _compute_issue_state(self):
99+
super()._compute_issue_state()
100+
for rec in self:
101+
account = rec.outstanding_line_id.account_id
102+
if account and not account.reconcile:
103+
rec.issue_state = "debited"

0 commit comments

Comments
 (0)