Skip to content

Commit

Permalink
Merge pull request #48 from ursais/12-fix-noavatax-cancel
Browse files Browse the repository at this point in the history
[FIX] Skip Avatax computation if no line has Avatax tax code, for Inv…
  • Loading branch information
dreispt authored May 18, 2020
2 parents 169bb9f + 23f49ac commit 1c0dfa6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion avatax_connector/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Avalara Avatax Connector",
"version": "12.0.2.3.8",
"version": "12.0.2.3.9",
"author": "Fabrice Henrion, Sodexis"
", Open Source Integrators",
"summary": "Sales tax Calculation",
Expand Down
3 changes: 3 additions & 0 deletions avatax_connector/models/account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,10 @@ def action_cancel(self):
account_tax_obj = self.env['account.tax']
for invoice in self:
avatax_config = invoice.company_id.get_avatax_config_company()
has_avatax_tax = invoice.mapped(
'invoice_line_ids.invoice_line_tax_ids.is_avatax')
if (invoice.type in ['out_invoice', 'out_refund'] and
has_avatax_tax and
invoice.partner_id.country_id in avatax_config.country_ids and
invoice.state != 'draft'):
doc_type = invoice.type == 'out_invoice' and 'SalesInvoice' or 'ReturnInvoice'
Expand Down

0 comments on commit 1c0dfa6

Please sign in to comment.