diff options
| author | Andrea Grazioso (agr-odoo) <agr@odoo.com> | 2021-01-18 16:20:57 +0000 |
|---|---|---|
| committer | Andrea Grazioso (agr-odoo) <agr@odoo.com> | 2021-02-02 10:52:49 +0000 |
| commit | 0215bc8ca0ed7e9681f1c50bd70a9db5dfccc440 (patch) | |
| tree | e6192cd2b163467e83a932051295063625970810 | |
| parent | 291b656e702498fe46e63dbdad84442615298b51 (diff) | |
[FIX] sale: fix downpayment percentage computation (tax included)
Create a standard tax that is included in the product price.
Add that tax to a product and the down payment product.
Create a sales order (i.e. 1 line, 115$ total, 15% tax incl).
Create a percentage down payment invoice, i.e. 50%.
The downpayment amount will be 50% of the untaxed amount,
i.e. 100$ @ 50% = 50$ with tax already included, so actually
lower than 50%
opw-2426294
closes odoo/odoo#65275
X-original-commit: 7ee8f4213d61a1e910db0da98f919ea7f88c0d34
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
| -rw-r--r-- | addons/sale/wizard/sale_make_invoice_advance.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/sale/wizard/sale_make_invoice_advance.py b/addons/sale/wizard/sale_make_invoice_advance.py index 08d703256bf..ce9cd47faa8 100644 --- a/addons/sale/wizard/sale_make_invoice_advance.py +++ b/addons/sale/wizard/sale_make_invoice_advance.py @@ -106,7 +106,10 @@ class SaleAdvancePaymentInv(models.TransientModel): def _get_advance_details(self, order): context = {'lang': order.partner_id.lang} if self.advance_payment_method == 'percentage': - amount = order.amount_untaxed * self.amount / 100 + 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 name = _("Down payment of %s%%") % (self.amount) else: amount = self.fixed_amount |
