From c4ebea8cb1e9c1c9512ab8b9ec8d0f80b3abca5e Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Mon, 24 Jul 2017 10:47:37 +0200 Subject: [PATCH] [FIX] sale: taxes on report - Create a tax using the tax template 'GST + QST for sales' - Create a SO with the following lines: Product 1 100 Units @ 0.1 Product 2 2000 Units @ 10.334 Product 3 2000 Units @ 10.334 Product 4 5000 Units @ 0.1 Product 5 1500 Units @ 0.1 - The totals are: Amount without taxes: 41996.00 Taxes: 6288.90 When printed, the quotation gives: Amount without taxes: 41996.00 Taxes: 6286.52 This is due to the method `_get_tax_amount_by_group`, which is using `line.price_reduce` for tax computation. Since it is a Monetary field, it is automatically rounded to the currency precision, while it should be rounded with the same precision as `price_unit`. Introduced in 99743cc4aa4d5b52b77a3a38650ef2d7a54ab984 opw-752487 --- addons/sale/models/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index 4abf92ebcc8..e2502dc9d59 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -792,7 +792,7 @@ class SaleOrderLine(models.Model): price_tax = fields.Float(compute='_compute_amount', string='Taxes', readonly=True, store=True) price_total = fields.Monetary(compute='_compute_amount', string='Total', readonly=True, store=True) - price_reduce = fields.Monetary(compute='_get_price_reduce', string='Price Reduce', readonly=True, store=True) + price_reduce = fields.Float(compute='_get_price_reduce', string='Price Reduce', digits=dp.get_precision('Product Price'), readonly=True, store=True) tax_id = fields.Many2many('account.tax', string='Taxes', domain=['|', ('active', '=', False), ('active', '=', True)]) price_reduce_taxinc = fields.Monetary(compute='_get_price_reduce_tax', string='Price Reduce Tax inc', readonly=True, store=True) price_reduce_taxexcl = fields.Monetary(compute='_get_price_reduce_notax', string='Price Reduce Tax excl', readonly=True, store=True)