[ADD] website_sale_aplicoop: Add sequence field to group.order for custom ordering

- Add sequence field to group.order model with default value 10
- Update _order to sort by sequence first, then start_date desc
- Add sequence field to tree view with handle widget for drag-and-drop reordering
- Add sequence field to form view for manual editing
- Orders in website list will now be ordered by sequence field
This commit is contained in:
snt 2026-02-21 16:37:55 +01:00
parent 32f345bc44
commit cafa19ffea
2 changed files with 9 additions and 1 deletions

View file

@ -16,7 +16,7 @@ class GroupOrder(models.Model):
_name = "group.order"
_description = "Consumer Group Order"
_inherit = ["mail.thread", "mail.activity.mixin"]
_order = "start_date desc"
_order = "sequence, start_date desc"
def _get_order_type_selection(self):
"""Return order type selection options with translations."""
@ -65,6 +65,12 @@ class GroupOrder(models.Model):
help="Company that owns this consumer group order",
)
# === Secuencia ===
sequence = fields.Integer(
default=10,
help="Sequence for ordering group orders in the website list",
)
# === Campos básicos ===
name = fields.Char(
required=True,