Skip to content

Commit

Permalink
[FIX] account_avatax_oca: only override exemption if provided in Odoo
Browse files Browse the repository at this point in the history
If no exemption info is provided in Odoo, the API call sends None.
This causes and override on exemption information that might exist in
the Avatax side.
  • Loading branch information
dreispt committed Dec 6, 2024
1 parent e6f6cc6 commit 8d7ebe6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions account_avatax_oca/models/avatax_rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,20 @@ def get_tax(
"referenceCode": reference_code,
"salespersonCode": salesman_code and salesman_code[:25] or None,
"reportingLocationCode": location_code,
"entityUseCode": customer_usage_type,
"exemptionNo": exemption_no,
"description": doc_code or "Draft",
"date": doc_date,
"code": doc_code,
"type": doc_type,
"commit": commit,
}
# Only override exemption if provided from Odoo
if customer_usage_type or exemption_no:
create_transaction.update(

Check warning on line 298 in account_avatax_oca/models/avatax_rest_api.py

View check run for this annotation

Codecov / codecov/patch

account_avatax_oca/models/avatax_rest_api.py#L298

Added line #L298 was not covered by tests
{
"entityUseCode": customer_usage_type,
"exemptionNo": exemption_no,
}
)
if is_override and invoice_date:
create_transaction.update(
{
Expand Down

0 comments on commit 8d7ebe6

Please sign in to comment.