Skip to content

Commit

Permalink
[IMP] account_avatax_sale_oca: Add method to update tax details
Browse files Browse the repository at this point in the history
  • Loading branch information
JasminSForgeFlow committed Jul 26, 2024
1 parent 73f972d commit c16b2be
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions account_avatax_sale_oca/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ def _avatax_prepare_lines(self, order_lines, doc_type=None):
]
return [x for x in lines if x]

def update_tax_details(self, tax, line, tax_result_line):
"""Method to update details in tax"""
return tax, line

Check warning on line 172 in account_avatax_sale_oca/models/sale_order.py

View check run for this annotation

Codecov / codecov/patch

account_avatax_sale_oca/models/sale_order.py#L172

Added line #L172 was not covered by tests

def _avatax_compute_tax(self):
"""Contact REST API and recompute taxes for a Sale Order"""
# Override to handle lines with split taxes (e.g. TN)
Expand Down Expand Up @@ -210,6 +214,7 @@ def _avatax_compute_tax(self):
)
rate = round(tax_calculation * 100, 4)
tax = Tax.get_avalara_tax(rate, doc_type)
tax, line = self.update_tax_details(tax, line, tax_result_line)

Check warning on line 217 in account_avatax_sale_oca/models/sale_order.py

View check run for this annotation

Codecov / codecov/patch

account_avatax_sale_oca/models/sale_order.py#L217

Added line #L217 was not covered by tests
if tax not in line.tax_id:
line_taxes = (
tax
Expand Down

0 comments on commit c16b2be

Please sign in to comment.