From 7ab7bd92ea16cddbf494024946f9c0cb7093e9eb Mon Sep 17 00:00:00 2001 From: Victor Feyens Date: Thu, 17 Jun 2021 12:07:07 +0000 Subject: [PATCH] [FIX] point_of_sale: onchange call order _onchange_qty should be called after the price_unit change to compute the amounts correctly. --- addons/point_of_sale/models/pos_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/models/pos_order.py b/addons/point_of_sale/models/pos_order.py index acffb09f984..46fa45a4545 100644 --- a/addons/point_of_sale/models/pos_order.py +++ b/addons/point_of_sale/models/pos_order.py @@ -834,10 +834,10 @@ class PosOrderLine(models.Model): 'Please set one before choosing a product.')) price = self.order_id.pricelist_id.get_product_price( self.product_id, self.qty or 1.0, self.order_id.partner_id) - self._onchange_qty() self.tax_ids = self.product_id.taxes_id.filtered(lambda r: not self.company_id or r.company_id == self.company_id) tax_ids_after_fiscal_position = self.order_id.fiscal_position_id.map_tax(self.tax_ids) self.price_unit = self.env['account.tax']._fix_tax_included_price_company(price, self.product_id.taxes_id, tax_ids_after_fiscal_position, self.company_id) + self._onchange_qty() @api.onchange('qty', 'discount', 'price_unit', 'tax_ids') def _onchange_qty(self):