From bae93828964d6d0f8df468aeae1602afc26f0d5d Mon Sep 17 00:00:00 2001 From: jbw-odoo Date: Tue, 8 Nov 2022 10:04:03 +0000 Subject: [PATCH] [IMP] sale: downpayment is always % of total When computing a downpayment amount with "percentage" method, always compute the % from the total amount. See https://github.com/odoo/odoo/pull/64706#pullrequestreview-571089596 Task: 2678531 Part-of: odoo/odoo#105177 --- addons/sale/wizard/sale_make_invoice_advance.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/addons/sale/wizard/sale_make_invoice_advance.py b/addons/sale/wizard/sale_make_invoice_advance.py index 500ade77b2b..0656143df1e 100644 --- a/addons/sale/wizard/sale_make_invoice_advance.py +++ b/addons/sale/wizard/sale_make_invoice_advance.py @@ -43,10 +43,10 @@ class SaleAdvancePaymentInv(models.TransientModel): store=True) amount = fields.Float( string="Down Payment Amount", - help="The percentage of amount to be invoiced in advance, taxes excluded.") + help="The percentage of amount to be invoiced in advance.") fixed_amount = fields.Monetary( string="Down Payment Amount (Fixed)", - help="The fixed amount to be invoiced in advance, taxes excluded.") + help="The fixed amount to be invoiced in advance.") currency_id = fields.Many2one( comodel_name='res.currency', compute='_compute_currency_id', @@ -244,10 +244,7 @@ class SaleAdvancePaymentInv(models.TransientModel): def _get_down_payment_amount(self, order): self.ensure_one() if self.advance_payment_method == 'percentage': - 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 + amount = order.amount_total * self.amount / 100 else: # Fixed amount amount = self.fixed_amount return amount