From 5ebd6acb0ab9e2c77dbb0f87be72b7996c1979e5 Mon Sep 17 00:00:00 2001 From: roen-odoo Date: Mon, 10 Jan 2022 16:40:20 +0000 Subject: [PATCH] [FIX] point_of_sale : Variant changing price Current behavior: When using variant in PoS the price was not always correct Steps to reproduce: 1. Set up items with modifiers (Modifier type must be of type variant creation mode : never, where adding a modifier leads to a different price than with the base item e.g. base item is 10 USD, modifier is 5 USD, total price is 15 USD; 2. Activate Product configurator and make sure it's a Bar/Restaurant in the PoS settings 3. Select the items with the modifier; 4. Leave the table and come back to the table 5. Change the quantity of this product 6. The price is back to the base price without the modifier opw-2696529 closes odoo/odoo#83444 X-original-commit: d959dfada11a72d6bc275b35f5eeb06b045a0dea Signed-off-by: Masereel Pierre --- addons/point_of_sale/models/pos_order.py | 2 ++ addons/pos_restaurant/models/pos_order.py | 1 + 2 files changed, 3 insertions(+) diff --git a/addons/point_of_sale/models/pos_order.py b/addons/point_of_sale/models/pos_order.py index 8baa89b01c4..24d0af8e65e 100644 --- a/addons/point_of_sale/models/pos_order.py +++ b/addons/point_of_sale/models/pos_order.py @@ -900,6 +900,7 @@ class PosOrderLine(models.Model): readonly=True, required=True) price_subtotal_incl = fields.Float(string='Subtotal', digits=0, readonly=True, required=True) + price_extra = fields.Float(string="Price extra") margin = fields.Monetary(string="Margin", compute='_compute_margin') margin_percent = fields.Float(string="Margin (%)", compute='_compute_margin', digits=(12, 4)) total_cost = fields.Float(string='Total cost', digits='Product Price', readonly=True) @@ -1029,6 +1030,7 @@ class PosOrderLine(models.Model): 'pack_lot_ids': [[0, 0, lot] for lot in orderline.pack_lot_ids.export_for_ui()], 'customer_note': orderline.customer_note, 'refunded_qty': orderline.refunded_qty, + 'price_extra': orderline.price_extra, } def export_for_ui(self): diff --git a/addons/pos_restaurant/models/pos_order.py b/addons/pos_restaurant/models/pos_order.py index 83584ef3f34..cbaf9265a79 100644 --- a/addons/pos_restaurant/models/pos_order.py +++ b/addons/pos_restaurant/models/pos_order.py @@ -61,6 +61,7 @@ class PosOrder(models.Model): 'mp_dirty', 'full_product_name', 'customer_note', + 'price_extra', ]) return fields