From 40e03c8f1289665c5ec8792ad97b4e501ce9fe72 Mon Sep 17 00:00:00 2001 From: "Djamel (otd)" Date: Fri, 9 Apr 2021 12:13:17 +0000 Subject: [PATCH] =?UTF-8?q?[FIX]=20l10n=5Fid=5Fefaktur:=20fix=20the=20?= =?UTF-8?q?=E2=80=9C=5Fonchange=5Fl10n=5Fid=5Ftax=5Fnumber=E2=80=9D=20meth?= =?UTF-8?q?od?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steps to follow to reproduce the bug: - Create an Indonesian company - Go to Invoicing settings / in “Fiscal Localization” / install Indonesian-Accounting “ l10n_id” - Go to Invoicing / Vendors / bills - Create a new bill / add a vendor / go to “other info” / add a valid Indonesian Tax Number, for example : “0112345678912345” - An error is triggered Problem: In the “_onchange_l10n_id_tax_number” method, we try to access “record.type”, but in v14 the field "type" was replaced by "move_type” in the "account.move" model. opw-2492530 closes odoo/odoo#69064 X-original-commit: 7cac0104625ea2bedf02a6c47801ccdb930ab939 Signed-off-by: Josse Colpaert Signed-off-by: Djamel Touati --- addons/l10n_id_efaktur/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/l10n_id_efaktur/models/account_move.py b/addons/l10n_id_efaktur/models/account_move.py index a066afc918a..5d843b9b372 100644 --- a/addons/l10n_id_efaktur/models/account_move.py +++ b/addons/l10n_id_efaktur/models/account_move.py @@ -45,7 +45,7 @@ class AccountMove(models.Model): @api.onchange('l10n_id_tax_number') def _onchange_l10n_id_tax_number(self): for record in self: - if record.l10n_id_tax_number and record.type not in self.get_purchase_types(): + if record.l10n_id_tax_number and record.move_type not in self.get_purchase_types(): raise UserError(_("You can only change the number manually for a Vendor Bills and Credit Notes")) @api.depends('l10n_id_attachment_id')