1.sf的工作中心新增表面工艺字段,工序类型新增表面工艺类型,且当工序类型为表面工艺时,则显示表面工艺,其他则不显示

2.sf的工作中心新增工艺外协字段,该字段若被勾选则为表面工艺的外协加工中心
3.sf的销售订单上点击生成制造订单时在已有的成品工序后累加表面工艺工序,表面工艺的工序生成规则需根据表面工艺所对应的类别的排序来依次生成,并且工序里的工作中心的匹配规则需根据表面工艺的可选参数里的获取方式字段的值来匹配
This commit is contained in:
jinling.yang
2023-03-30 17:52:05 +08:00
parent 20d9e469f5
commit a008dbb76a
8 changed files with 79 additions and 30 deletions

View File

@@ -7,13 +7,18 @@ from odoo.addons.resource.models.resource import Intervals
class ResWorkcenter(models.Model):
_inherit = "mrp.workcenter"
machine_tool_id = fields.Many2one('sf.machine_tool', '机床')
is_process_outsourcing = fields.Boolean('工艺外协')
users_ids = fields.Many2many("res.users", 'users_workcenter')
equipment_ids = fields.One2many(
'maintenance.equipment', 'workcenter_id', string="Maintenance Equipment",
check_company=True)
# 查询工艺外协加工中心
def get_process_outsourcing_workcenter(self):
outsourcing_workcenter = self.env['mrp.workcenter'].search([('is_process_outsourcing', '=', True)])
return outsourcing_workcenter.id
@api.onchange('machine_tool_id')
def update_machine_tool_is_binding(self):
machine_tool = self.env["sf.machine_tool"].search([('is_binding', '=', True)])