[FIX] sale, sale_management: add tax on options (portal)

Steps to reproduce

Enable optional products in sale order
Make a sale order with optional products for a portal customer
with taxcloud fiscal position. Validate the order.
Tax will be calculated on the sol.

Access the sale order as the portal user.
Add the optional product, verify the order and pay.

The optional product will get the taxcloud data
AFTER the order has been verified and possibly paid. As this should not
occur this add the override to calculate taxcloud data right after
adding the optional product

opw-2310614

closes odoo/odoo#56110

X-original-commit: a7a91d5de55817b7580f3cd3d262a9dcce7496e7
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Co-authored-by: agr-odoo <agr@odoo.com>
This commit is contained in:
Goffin Simon
2020-08-24 16:11:12 +00:00
co-authored by agr-odoo
parent a7bbcd1360
commit 4f10dfa527
2 changed files with 6 additions and 0 deletions
+3
View File
@@ -1060,6 +1060,9 @@ Reason(s) of this behavior could be:
down_payments_section_line.update(optional_values)
return down_payments_section_line
def add_option_to_order_with_taxcloud(self):
self.ensure_one()
class SaleOrderLine(models.Model):
_name = 'sale.order.line'
@@ -250,6 +250,9 @@ class SaleOrderOption(models.Model):
order_line._compute_tax_id()
self.write({'line_id': order_line.id})
if sale_order:
sale_order.add_option_to_order_with_taxcloud()
def _get_values_to_add_to_order(self):
self.ensure_one()