From 0c99b74ca1597f21e99a8a2eccac6974220359b8 Mon Sep 17 00:00:00 2001 From: "Loukas Wets (lowe)" Date: Fri, 22 Sep 2023 17:13:44 +0200 Subject: [PATCH] [IMP] point_of_sale: custom combo choices order Prior to this commit the combo choices were displayed in their ID order. This commit add a sequence field that allows the user to choose the order of the combo choices. closes odoo/odoo#136331 Signed-off-by: Joseph Caburnay (jcb) --- addons/point_of_sale/models/pos_combo.py | 3 ++- addons/point_of_sale/views/product_view.xml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/models/pos_combo.py b/addons/point_of_sale/models/pos_combo.py index 2dc888e3c31..8d730290eb2 100644 --- a/addons/point_of_sale/models/pos_combo.py +++ b/addons/point_of_sale/models/pos_combo.py @@ -18,10 +18,11 @@ class PosCombo(models.Model): """ _name = "pos.combo" _description = "Product combo choices" - + _order = "sequence, id" name = fields.Char(string="Name", required=True) combo_line_ids = fields.One2many("pos.combo.line", "combo_id", string="Products in Combo") num_of_products = fields.Integer("No of Products", compute="_compute_num_of_products") + sequence = fields.Integer(copy=False) @api.depends("combo_line_ids") def _compute_num_of_products(self): diff --git a/addons/point_of_sale/views/product_view.xml b/addons/point_of_sale/views/product_view.xml index 96a662eb8b9..8c4e19b68c6 100644 --- a/addons/point_of_sale/views/product_view.xml +++ b/addons/point_of_sale/views/product_view.xml @@ -75,6 +75,7 @@ +