Save and update taxes to apply tax adjustment on new invoice

issue11719
review411791003
This commit is contained in:
Cédric Krier committed 2022-09-25 20:29:57 +02:00
1 parent dabe1377f8
commit 0948e91c75
1 file changed
+3
+3
View File
@@ -151,6 +151,8 @@ class Sale(IdentifierMixin, metaclass=PoolMeta):
Currency = pool.get('currency.currency')
invoice = super().create_invoice()
if invoice and self.shopify_tax_adjustment:
invoice.save()
invoice.update_taxes()
adjustment = Currency.compute(
self.currency, self.shopify_tax_adjustment, invoice.currency,
round=False)
@@ -175,6 +177,7 @@ class Sale(IdentifierMixin, metaclass=PoolMeta):
break
invoice.taxes = invoice.taxes
invoice.save()
invoice.update_taxes()
return invoice
@classmethod