修改工单显隐控制逻辑
This commit is contained in:
@@ -20,6 +20,8 @@ class MrpProduction(models.Model):
|
||||
model_file = fields.Binary('模型文件', related='product_id.model_file')
|
||||
schedule_state = fields.Selection([('未排', '未排'), ('已排', '已排'), ('已完成', '已完成')],
|
||||
string='排程状态', default='未排')
|
||||
work_order_state = fields.Selection([('未排', '未排'), ('已排', '已排'), ('已完成', '已完成')],
|
||||
string='工单状态', default='未排')
|
||||
|
||||
# state = fields.Selection(selection_add=[
|
||||
# ('pending_scheduling', '待排程'),
|
||||
@@ -53,8 +55,7 @@ class MrpProduction(models.Model):
|
||||
production_line_id = fields.Many2one('sf.production.line', string='生产线')
|
||||
plan_start_processing_time = fields.Datetime('计划开始加工时间')
|
||||
production_line_state = fields.Selection([('待上产线', '待上产线'), ('已上产线', '已上产线'), ('已下产线', '已下产线')],
|
||||
string='上/下产线', default='待上产线')
|
||||
|
||||
string='上/下产线', default='待上产线')
|
||||
|
||||
@api.depends(
|
||||
'move_raw_ids.state', 'move_raw_ids.quantity_done', 'move_finished_ids.state',
|
||||
@@ -94,9 +95,9 @@ class MrpProduction(models.Model):
|
||||
production.state = 'pending_processing'
|
||||
# elif production.state == 'progress' and production.schedule_state == '已完成':
|
||||
# production.state = 'completed'
|
||||
elif production.state == 'pending_processing' and production.schedule_state == '已完成':
|
||||
elif production.state == 'pending_processing' and production.work_order_state == '已完成':
|
||||
production.state = 'completed'
|
||||
elif production.state == 'progress' and production.schedule_state == '已完成':
|
||||
elif production.state == 'progress' and production.work_order_state == '已完成':
|
||||
production.state = 'completed'
|
||||
|
||||
def action_check(self):
|
||||
|
||||
Reference in New Issue
Block a user