Skip to content

Commit

Permalink
[FIX] l10n_ar_ux: re-add checks payment_method_description
Browse files Browse the repository at this point in the history
Esto que teniamos en 13 lo perdimos al llevar a cheques a odoo https://github.com/ingadhoc/account-payment/blob/b1bc2a6c029798cb55401a8df81dd286bff599f2/account_check/models/account_payment.py#L129

Como todavía no tenemos un modulo fuera de l10n_ar_ux que extienda modulo de cheques, por ahora lo agregamos acá
eventualmente podremos tener un l10n_latam_check_ux

closes #714

Related: ingadhoc/account-payment#382
Signed-off-by: Juan José Scarafía <jjs@adhoc.com.ar>
  • Loading branch information
jjscarafia committed Jul 14, 2023
1 parent 9a292c9 commit 04a6038
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions l10n_ar_ux/models/account_payment.py
Expand Up @@ -25,3 +25,16 @@ def _prepare_move_line_default_vals(self, write_off_line_vals=None):
'date_maturity': date_maturity,
})
return res

@api.depends('payment_method_code', 'l10n_latam_check_id', 'check_number')
def _compute_payment_method_description(self):
check_payments = self.filtered(
lambda x: x.payment_method_code in ['check_printing', 'new_third_party_checks', 'out_third_party_checks', 'in_third_party_checks'])
for rec in check_payments:
if rec.l10n_latam_check_id:
checks_desc = rec.l10n_latam_check_id.check_number
else:
checks_desc = rec.check_number or ''
name = "%s: %s" % (rec.payment_method_line_id.display_name, checks_desc)
rec.payment_method_description = name
return super(AccountPayment, (self - check_payments))._compute_payment_method_description()

0 comments on commit 04a6038

Please sign in to comment.