Skip to content
Snippets Groups Projects
Commit 21983f2c authored by Wolfgang Taferner's avatar Wolfgang Taferner
Browse files

[FIX] sale: the order should define if price_included or not


Fiscal Position might map a price_excluded to a price_included
tax therefore we map the advance payment product tax accordingly
before checking which amount we will use for the computation

closes odoo/odoo#123209

Signed-off-by: default avatarVictor Feyens (vfe) <vfe@odoo.com>
parent 4bcd11b8
Branches
Tags
No related merge requests found
......@@ -106,7 +106,8 @@ class SaleAdvancePaymentInv(models.TransientModel):
def _get_advance_details(self, order):
context = {'lang': order.partner_id.lang}
if self.advance_payment_method == 'percentage':
if all(self.product_id.taxes_id.mapped('price_include')):
advance_product_taxes = self.product_id.taxes_id.filtered(lambda tax: tax.company_id == order.company_id)
if all(order.fiscal_position_id.map_tax(advance_product_taxes).mapped('price_include')):
amount = order.amount_total * self.amount / 100
else:
amount = order.amount_untaxed * self.amount / 100
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment