diff --git a/mrp_component_operation/models/mrp_component_operation.py b/mrp_component_operation/models/mrp_component_operation.py index 5332e5229..1ffeb7a59 100644 --- a/mrp_component_operation/models/mrp_component_operation.py +++ b/mrp_component_operation/models/mrp_component_operation.py @@ -6,6 +6,7 @@ from odoo import fields, models class MrpComponentOperation(models.Model): _name = "mrp.component.operation" _description = "Component Operation" + _order = "sequence,id" name = fields.Char(help="Component Operation Reference", required=True) @@ -58,3 +59,14 @@ class MrpComponentOperation(models.Model): default="no", required=True, ) + + picking_type_id = fields.Many2one( + "stock.picking.type", + "Operation Type", + domain="[('code', '=', 'mrp_operation')]", + ) + + sequence = fields.Integer( + string="Sequence", + help="Gives the sequence order when displaying the list of component operations", + ) diff --git a/mrp_component_operation/models/mrp_production.py b/mrp_component_operation/models/mrp_production.py index ca4e09e43..c55e8833e 100644 --- a/mrp_component_operation/models/mrp_production.py +++ b/mrp_component_operation/models/mrp_production.py @@ -20,6 +20,7 @@ class MrpProduction(models.Model): "default_mo_id": self.id, "product_ids": self.move_raw_ids.move_line_ids.product_id.mapped("id"), "lot_ids": self.move_raw_ids.move_line_ids.lot_id.mapped("id"), + "default_picking_type_id": self.picking_type_id.id, }, "target": "new", } diff --git a/mrp_component_operation/views/mrp_component_operation_views.xml b/mrp_component_operation/views/mrp_component_operation_views.xml index cfac9a50c..91e553192 100644 --- a/mrp_component_operation/views/mrp_component_operation_views.xml +++ b/mrp_component_operation/views/mrp_component_operation_views.xml @@ -9,6 +9,9 @@