mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[IMP] <mrp_operations_extension>: Modifications added to avoid errors in miss configurations.
This commit is contained in:
@@ -43,7 +43,7 @@ class MrpBom(models.Model):
|
||||
seq = work_order['sequence'] - level
|
||||
routing_lines = routing_line_obj.search([
|
||||
('routing_id', '=', routing_id), ('sequence', '=', seq)])
|
||||
routing_line_id = routing_lines.id
|
||||
routing_line_id = routing_lines and routing_lines[0].id or False
|
||||
for routing_line in routing_lines:
|
||||
if routing_line.name in work_order['name']:
|
||||
routing_line_id = routing_line.id
|
||||
|
||||
@@ -84,8 +84,9 @@ class MrpRoutingWorkcenter(models.Model):
|
||||
'op_number': self.operation.op_number,
|
||||
}
|
||||
op_wc_lst.append(data)
|
||||
op_wc_lst[0]['default'] = True
|
||||
self.op_wc_lines = op_wc_lst
|
||||
if op_wc_lst:
|
||||
op_wc_lst[0]['default'] = True
|
||||
self.op_wc_lines = op_wc_lst
|
||||
|
||||
@api.one
|
||||
@api.onchange('op_wc_lines')
|
||||
|
||||
Reference in New Issue
Block a user