From aaace4795f8af0e3cfa79844c5a7a028489b929b Mon Sep 17 00:00:00 2001 From: tsliepen-ws <146955817+tsliepen-ws@users.noreply.github.com> Date: Wed, 22 Nov 2023 15:59:07 +0100 Subject: [PATCH] [FIX] account_invoice_fixed_discount: Check base_line type hr_expense calls _convert_to_tax_base_line_dict with base_line set to None. Comparison of base_line._name in account_invoice_fixed_discount causes an attribute error. Add extra check to ensure there is an account.move.line to check against in base_line. --- account_invoice_fixed_discount/models/account_tax.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/account_invoice_fixed_discount/models/account_tax.py b/account_invoice_fixed_discount/models/account_tax.py index 0c20cec77a6..8dd3b9e17c8 100644 --- a/account_invoice_fixed_discount/models/account_tax.py +++ b/account_invoice_fixed_discount/models/account_tax.py @@ -44,6 +44,10 @@ def _convert_to_tax_base_line_dict( handle_price_include=handle_price_include, extra_context=extra_context, ) - if base_line._name == "account.move.line" and base_line.discount_fixed: + if ( + base_line + and base_line._name == "account.move.line" + and base_line.discount_fixed + ): res["discount"] = base_line._get_discount_from_fixed_discount() return res