Skip to content

Commit

Permalink
[16.0][FIX] account_avatax_oca, skip exception raise on lines with no…
Browse files Browse the repository at this point in the history
…t product in display_type
  • Loading branch information
ChrisOForgeFlow committed Dec 26, 2023
1 parent 6d9dd0e commit a1592a9
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
22 changes: 22 additions & 0 deletions account_avatax_oca/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,3 +503,25 @@ def onchange_reset_tax_amt(self):
for line in self:
line.avatax_amt_line = 0.0
line.move_id.avatax_amount = 0.0

# pylint: disable=W8110
@api.depends(
"tax_ids",
"currency_id",
"partner_id",
"analytic_distribution",
"balance",
"partner_id",
"move_id.partner_id",
"price_unit",
"quantity",
)
def _compute_all_tax(self):
for rec in self:
super(
AccountMoveLine,
self.with_context(
line_display_type=rec.display_type,
line_account_type=rec.account_type,
),
)._compute_all_tax()
15 changes: 15 additions & 0 deletions account_avatax_oca/models/account_tax.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,21 @@ def compute_all(
fixed_multiplicator,
)
avatax_invoice = self.env.context.get("avatax_invoice")
if (
(
"line_display_type" in self.env.context
and self.env.context.get("line_display_type") != "product"
)
and "line_account_type"
and self.env.context.get("line_display_type") != "asset_receivable"
):
# CHECK ME: Changes in 16 version, make compute taxes on all lines,
# included payment terms line, etc, but only
# product lines should pass
# by this validation or should be computed one by
# one with context we can know what line call
# this method
avatax_invoice = False
if avatax_invoice:
# Find the Avatax amount in the invoice Lines
# Looks up the line for the current product, price_unit, and quantity
Expand Down

0 comments on commit a1592a9

Please sign in to comment.