[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) <jcb@odoo.com>
This commit is contained in:
Loukas Wets (lowe)
2023-09-25 07:53:59 +00:00
parent 1995f21d42
commit 0c99b74ca1
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -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):
@@ -75,6 +75,7 @@
<page name="combos" string="Combo Choices" groups="point_of_sale.group_pos_user" invisible="not detailed_type == 'combo'">
<field name="combo_ids" widget="one2many" >
<tree string="combos">
<field name="sequence" widget="handle"/>
<field name="name" />
<field name="num_of_products"/>
</tree>