summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Frantzen (bfr) <bfr@odoo.com>2020-07-17 13:55:52 +0000
committerBenjamin Frantzen (bfr) <bfr@odoo.com>2020-07-22 06:37:26 +0000
commitf81c83153ec702cfd6ab0712f5b64fa20d8b8bff (patch)
tree8b32207256dd584037758dded1655beb510286df
parent6827951451cf10b08e95dc735403de44ec53af02 (diff)
[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 <bfr-o@users.noreply.github.com> Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
-rw-r--r--addons/account/data/mail_template_data.xml4
-rw-r--r--addons/l10n_se_ocr/models/account_move.py10
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:
<br /><br />
- Please use the following communication for your payment: <strong>${object.invoice_payment_ref}</strong>.
+ Please use the following communication for your payment: <strong>${object.payment_reference}</strong>.
% endif
% endif
<br /><br />
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()