diff --git a/addons/purchase/models/purchase.py b/addons/purchase/models/purchase.py index 60e8322d17e..3abe4839024 100644 --- a/addons/purchase/models/purchase.py +++ b/addons/purchase/models/purchase.py @@ -509,7 +509,7 @@ class PurchaseOrderLine(models.Model): for line in self: taxes = line.taxes_id.compute_all(line.price_unit, line.order_id.currency_id, line.product_qty, product=line.product_id, partner=line.order_id.partner_id) line.update({ - 'price_tax': taxes['total_included'] - taxes['total_excluded'], + 'price_tax': sum(t.get('amount', 0.0) for t in taxes.get('taxes', [])), 'price_total': taxes['total_included'], 'price_subtotal': taxes['total_excluded'], }) @@ -567,7 +567,7 @@ class PurchaseOrderLine(models.Model): price_subtotal = fields.Monetary(compute='_compute_amount', string='Subtotal', store=True) price_total = fields.Monetary(compute='_compute_amount', string='Total', store=True) - price_tax = fields.Monetary(compute='_compute_amount', string='Tax', store=True) + price_tax = fields.Float(compute='_compute_amount', string='Tax', store=True) order_id = fields.Many2one('purchase.order', string='Order Reference', index=True, required=True, ondelete='cascade') account_analytic_id = fields.Many2one('account.analytic.account', string='Analytic Account') diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index 81f2d7fbb30..103ea11fc7a 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -557,7 +557,7 @@ class SaleOrderLine(models.Model): price = line.price_unit * (1 - (line.discount or 0.0) / 100.0) taxes = line.tax_id.compute_all(price, line.order_id.currency_id, line.product_uom_qty, product=line.product_id, partner=line.order_id.partner_id) line.update({ - 'price_tax': taxes['total_included'] - taxes['total_excluded'], + 'price_tax': sum(t.get('amount', 0.0) for t in taxes.get('taxes', [])), 'price_total': taxes['total_included'], 'price_subtotal': taxes['total_excluded'], }) @@ -710,7 +710,7 @@ class SaleOrderLine(models.Model): price_unit = fields.Float('Unit Price', required=True, digits=dp.get_precision('Product Price'), default=0.0) price_subtotal = fields.Monetary(compute='_compute_amount', string='Subtotal', readonly=True, store=True) - price_tax = fields.Monetary(compute='_compute_amount', string='Taxes', readonly=True, store=True) + 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)