Skip to content
Snippets Groups Projects
Commit 039b4103 authored by Andrea Grazioso (agr-odoo)'s avatar Andrea Grazioso (agr-odoo)
Browse files

[FIX] sale: allow 2+ taxes on downpayment product


Create a product with mor than one tax > Create a down payment with %
Traceback

opw-2464291

closes odoo/odoo#66770

Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
parent 03d2e457
No related branches found
No related tags found
No related merge requests found
......@@ -106,7 +106,7 @@ class SaleAdvancePaymentInv(models.TransientModel):
def _get_advance_details(self, order):
context = {'lang': order.partner_id.lang}
if self.advance_payment_method == 'percentage':
if self.product_id.taxes_id.price_include:
if all(self.product_id.taxes_id.mapped('price_include')):
amount = order.amount_total * self.amount / 100
else:
amount = order.amount_untaxed * self.amount / 100
......
......@@ -128,7 +128,7 @@ class TestSaleStock(TestSale):
})
act = adv_wiz.with_context(open_invoices=True).create_invoices()
inv = self.env['account.move'].browse(act['res_id'])
self.assertEqual(inv.amount_untaxed, self.so.amount_untaxed * 5.0 / 100.0, 'Sale Stock: deposit invoice is wrong')
self.assertEqual(inv.amount_total, self.so.amount_total * 5.0 / 100.0, 'Sale Stock: deposit invoice is wrong')
self.assertEqual(self.so.invoice_status, 'to invoice', 'Sale Stock: so should be to invoice after invoicing deposit')
# invoice on order: everything should be invoiced
self.so._create_invoices(final=True)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment