From f81c83153ec702cfd6ab0712f5b64fa20d8b8bff Mon Sep 17 00:00:00 2001 From: "Benjamin Frantzen (bfr)" Date: Fri, 17 Jul 2020 13:55:52 +0000 Subject: [PATCH] [FIX] l10n_se_ocr, account : renamed old reference to invoice_payment_ref to payment_reference closes odoo/odoo#54735 X-original-commit: a44db615d1fa6443810e88cc55471aff110c1393 Signed-off-by: bfr-o Signed-off-by: Laurent Smet --- addons/account/data/mail_template_data.xml | 4 ++-- addons/l10n_se_ocr/models/account_move.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/account/data/mail_template_data.xml b/addons/account/data/mail_template_data.xml index 26854234738..88c7d2a7816 100644 --- a/addons/account/data/mail_template_data.xml +++ b/addons/account/data/mail_template_data.xml @@ -36,9 +36,9 @@ This invoice is already paid. % else: Please remit payment at your earliest convenience. - % if object.invoice_payment_ref: + % if object.payment_reference:

- Please use the following communication for your payment: ${object.invoice_payment_ref}. + Please use the following communication for your payment: ${object.payment_reference}. % endif % endif

diff --git a/addons/l10n_se_ocr/models/account_move.py b/addons/l10n_se_ocr/models/account_move.py index e73ace98866..569683f0f25 100644 --- a/addons/l10n_se_ocr/models/account_move.py +++ b/addons/l10n_se_ocr/models/account_move.py @@ -58,16 +58,16 @@ class AccountMove(models.Model): def _onchange_partner_id(self): """ If Vendor Bill and Vendor OCR is set, add it. """ if self.partner_id and self.move_type == 'in_invoice' and self.partner_id.l10n_se_default_vendor_payment_ref: - self.invoice_payment_ref = self.partner_id.l10n_se_default_vendor_payment_ref + self.payment_reference = self.partner_id.l10n_se_default_vendor_payment_ref return super(AccountMove, self)._onchange_partner_id() - @api.onchange('invoice_payment_ref') - def _onchange_invoice_payment_ref(self): + @api.onchange('payment_reference') + def _onchange_payment_reference(self): """ If Vendor Bill and Payment Reference is changed check validation. """ if self.partner_id and self.move_type == 'in_invoice' and self.partner_id.l10n_se_check_vendor_ocr: - reference = self.invoice_payment_ref + reference = self.payment_reference try: luhn.validate(reference) except: return {'warning': {'title': _('Warning'), 'message': _('Vendor require OCR Number as payment reference. Payment reference isn\'t a valid OCR Number.')}} - return super(AccountMove, self)._onchange_invoice_payment_ref() + return super(AccountMove, self)._onchange_payment_reference()