匹配加工中心

This commit is contained in:
jinling.yang
2022-11-03 17:58:33 +08:00
parent 671901cb8d
commit 14d0d32ab6
7 changed files with 41 additions and 44 deletions

View File

@@ -31,10 +31,6 @@ class MrpProduction(models.Model):
# 重载根据工序生成工单的程序如果产品BOM中没有工序时
# 根据产品对应的模板类型中工序,去生成工单;
# 工单对应的工作中心,根据工序中的工作中心去匹配,
# 如果只配置了一个工作中心,则默认采用该工作中心;
# 如果有多个工作中心,
# 则根据该工作中心的工单个数进行分配(优先分配给工单个数最少的);
# CNC加工工序的选取规则
# 如果自动报价有带过来预分配的机床,
# 则根据设备找到工作中心;否则采用前面描述的工作中心分配机制;
@@ -68,10 +64,10 @@ class MrpProduction(models.Model):
'operation_id': operation.id,
'state': 'pending',
}]
# 根据加工面板的面数及对应的工序模板生成工
# 根据加工面板的面数及对应的工序模板生成工
for k in (production.product_id.processing_panel.split(',')):
for route in production.product_id.model_type_id.routing_tmpl_ids:
if route.route_workcenter_id:
if route:
workorders_values_str = [0, '', {
'product_uom_id': production.product_uom_id.id,
'qty_producing': 0,
@@ -79,6 +75,7 @@ class MrpProduction(models.Model):
'name': route.route_workcenter_id.name,
'processing_panel': k,
'workcenter_id': False,
# 'workcenter_ids': self.env['mrp.routing.workcenter'].get_workcenter(route.workcenter_ids),
'date_planned_start': False,
'date_planned_finished': False,
'duration_expected': 60,