Skip to content

Commit

Permalink
[FIX] account_invoice_fixed_discount: Check base_line type
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tsliepen-ws committed Nov 27, 2023
1 parent 830c0f0 commit aaace47
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion account_invoice_fixed_discount/models/account_tax.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit aaace47

Please sign in to comment.