匹配加工中心

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

@@ -23,6 +23,22 @@ class ResMrpRoutingWorkcenter(models.Model):
company_id = fields.Many2one('res.company', compute="get_company_id", related=False)
# 工单对应的工作中心,根据工序中的工作中心去匹配,
# 如果只配置了一个工作中心,则默认采用该工作中心;
# 如果有多个工作中心,
# 则根据该工作中心的工单个数进行分配(优先分配给工单个数最少的);
# def get_workcenter(self, workcenter_ids):
# print(workcenter_ids[0].id)
# if workcenter_ids:
# if len(workcenter_ids) == 1:
# return workcenter_ids[0].id
# elif len(workcenter_ids) >= 2:
# workcenter_id = self.env['mrp.workorder'].search(
# [('workcenter_ids.id', 'in', True)],
# limit=1,
# group_by =
# )
class ModelTypeRoutingSort(models.Model):
_name = 'sf.model.type.routing.sort'