修改工单完成后,自动完成制造订单,完工产品就绪状态
This commit is contained in:
@@ -31,9 +31,9 @@ class ResMrpWorkOrder(models.Model):
|
||||
processing_panel = fields.Char('加工面')
|
||||
sequence = fields.Integer(string='工序')
|
||||
routing_type = fields.Selection([
|
||||
('获取CNC加工程序', '获取CNC加工程序'),
|
||||
('装夹', '装夹'),
|
||||
('前置三元定位检测', '前置三元定位检测'),
|
||||
# ('获取CNC加工程序', '获取CNC加工程序'),
|
||||
('装夹预调', '装夹预调'),
|
||||
# ('前置三元定位检测', '前置三元定位检测'),
|
||||
('CNC加工', 'CNC加工'),
|
||||
('后置三元质量检测', '后置三元质量检测'),
|
||||
('解除装夹', '解除装夹'),
|
||||
@@ -204,15 +204,15 @@ class ResMrpWorkOrder(models.Model):
|
||||
if route.routing_type == '切割':
|
||||
duration_expected = self.env['mrp.routing.workcenter'].sudo().search(
|
||||
[('name', '=', '切割')]).time_cycle
|
||||
elif route.routing_type == '获取CNC加工程序':
|
||||
# elif route.routing_type == '获取CNC加工程序':
|
||||
# duration_expected = self.env['mrp.routing.workcenter'].sudo().search(
|
||||
# [('name', '=', '获取CNC加工程序')]).time_cycle
|
||||
elif route.routing_type == '装夹预制':
|
||||
duration_expected = self.env['mrp.routing.workcenter'].sudo().search(
|
||||
[('name', '=', '获取CNC加工程序')]).time_cycle
|
||||
elif route.routing_type == '工件装夹':
|
||||
duration_expected = self.env['mrp.routing.workcenter'].sudo().search(
|
||||
[('name', '=', '工件装夹')]).time_cycle
|
||||
elif route.routing_type == '前置三元定位检测':
|
||||
duration_expected = self.env['mrp.routing.workcenter'].sudo().search(
|
||||
[('name', '=', '前置三元定位检测')]).time_cycle
|
||||
[('name', '=', '装夹预制')]).time_cycle
|
||||
# elif route.routing_type == '前置三元定位检测':
|
||||
# duration_expected = self.env['mrp.routing.workcenter'].sudo().search(
|
||||
# [('name', '=', '前置三元定位检测')]).time_cycle
|
||||
elif route.routing_type == 'CNC加工':
|
||||
duration_expected = self.env['mrp.routing.workcenter'].sudo().search(
|
||||
[('name', '=', 'CNC加工')]).time_cycle
|
||||
@@ -495,7 +495,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
|
||||
# 重写工单开始按钮方法
|
||||
def button_start(self):
|
||||
if self.routing_type == '装夹' and self.production_id.move_raw_ids[0].move_line_ids[0].lot_id.name:
|
||||
if self.routing_type == '装夹预制' and self.production_id.move_raw_ids[0].move_line_ids[0].lot_id.name:
|
||||
self.pro_code = self.production_id.move_raw_ids[0].move_line_ids[0].lot_id.name
|
||||
# 外协出库单,从“正在等待”变为“就绪”状态
|
||||
if self.is_subcontract is True:
|
||||
|
||||
Reference in New Issue
Block a user