diff --git a/ssi_service/models/service_contract_fix_item.py b/ssi_service/models/service_contract_fix_item.py index 4370a93..c4306b3 100644 --- a/ssi_service/models/service_contract_fix_item.py +++ b/ssi_service/models/service_contract_fix_item.py @@ -28,6 +28,7 @@ def _select(self): a.price_unit AS price_unit, a.uom_id AS uom_id, SUM(a.quantity) AS quantity, + MAX(a.sequence) AS sequence, SUM(a.price_subtotal) AS amount_untaxed, SUM(a.price_tax) AS amount_tax, SUM(a.price_total) AS amount_total diff --git a/ssi_service/models/service_fix_item_mixin.py b/ssi_service/models/service_fix_item_mixin.py index bbb3517..d6a9a00 100644 --- a/ssi_service/models/service_fix_item_mixin.py +++ b/ssi_service/models/service_fix_item_mixin.py @@ -8,7 +8,7 @@ class ServiceFixItemMixin(models.AbstractModel): _name = "service.fix_item_mixin" _description = "Service Fix Item Mixin" - _order = "id" + _order = "service_id, sequence, id" _auto = False service_id = fields.Many2one( @@ -16,6 +16,9 @@ class ServiceFixItemMixin(models.AbstractModel): comodel_name="service.mixin", ondelete="cascade", ) + sequence = fields.Integer( + string="Sequence", + ) product_id = fields.Many2one( string="Product", comodel_name="product.product", diff --git a/ssi_service/views/service_contract_views.xml b/ssi_service/views/service_contract_views.xml index d4a0179..33168f1 100644 --- a/ssi_service/views/service_contract_views.xml +++ b/ssi_service/views/service_contract_views.xml @@ -270,6 +270,7 @@ colspan="1" col="2" > + +