[FIX] l10n_latam_check_ux: force debited state when outstanding account is not reconcilable#1031
[FIX] l10n_latam_check_ux: force debited state when outstanding account is not reconcilable#1031rov-adhoc wants to merge 1 commit intoingadhoc:18.0from
Conversation
There was a problem hiding this comment.
Pull request overview
Este PR corrige un caso en l10n_latam_check_ux donde el estado (issue_state) de cheques propios puede quedar mal calculado cuando la cuenta outstanding no es conciliable, ajustando el cómputo para contemplar el flag reconcile de la cuenta.
Changes:
- Se sobreescribe
_compute_issue_state()en el modelol10n_latam.check(módulo UX). - Se fuerza
issue_state = "debited"cuando la cuenta deoutstanding_line_idno es conciliable.
| ) | ||
| def _compute_issue_state(self): | ||
| super()._compute_issue_state() | ||
| for rec in self: | ||
| account = rec.outstanding_line_id.account_id | ||
| if account and not account.reconcile: |
There was a problem hiding this comment.
La lógica no coincide con la descripción del fix: aquí se fuerza issue_state = 'debited' para cualquier check con outstanding_line_id.account_id no conciliable, incluso si todavía no está saldado o si super() calculó otro estado (p.ej. handed). Para evitar falsos positivos, limitar el override al caso que se quiere corregir (p.ej. cuando el estado calculado por super() sea voided y la outstanding_line_id esté totalmente saldada con amount_residual == 0).
| ) | |
| def _compute_issue_state(self): | |
| super()._compute_issue_state() | |
| for rec in self: | |
| account = rec.outstanding_line_id.account_id | |
| if account and not account.reconcile: | |
| "outstanding_line_id.amount_residual", | |
| ) | |
| def _compute_issue_state(self): | |
| super()._compute_issue_state() | |
| for rec in self: | |
| account = rec.outstanding_line_id.account_id | |
| if ( | |
| rec.issue_state == "voided" | |
| and account | |
| and not account.reconcile | |
| and rec.outstanding_line_id.amount_residual == 0 | |
| ): |
| if payment_method_change or partner_id_change: | ||
| super()._compute_issuer_vat() | ||
|
|
||
| @api.depends( |
There was a problem hiding this comment.
Al redecorar _compute_issue_state() con @api.depends('outstanding_line_id.account_id.reconcile') se sobrescriben las dependencias del compute original del campo. Con dependencias tan acotadas, issue_state puede no invalidarse/recomputarse cuando cambie la reconciliación (p.ej. cambios en outstanding_line_id o en su amount_residual). Mantener las dependencias del método base y añadir explícitamente las nuevas que usa este fix (al menos outstanding_line_id y outstanding_line_id.amount_residual).
| @api.depends( | |
| @api.depends( | |
| "outstanding_line_id", | |
| "outstanding_line_id.amount_residual", |
| if payment_method_change or partner_id_change: | ||
| super()._compute_issuer_vat() | ||
|
|
||
| @api.depends( |
There was a problem hiding this comment.
No agregaría depends . en todo caso modificaria el write de la cuenta contable.
…nt 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.
8a9b666 to
1acc3d4
Compare
|
@roboadhoc r+ nobump |
…nt 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. closes #1031 Signed-off-by: Filoquin adhoc <maq@adhoc.com.ar>

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.