库位变更接口优化

This commit is contained in:
mgw
2024-04-24 08:58:15 +08:00
parent ca01b055b8
commit 59c8631c15
6 changed files with 77 additions and 31 deletions

View File

@@ -113,7 +113,8 @@ class MrpProduction(models.Model):
if production.state == 'progress' and production.schedule_state == '已排':
# production.state = 'pending_processing'
production.state = 'pending_cam'
elif production.state == 'pending_cam' and production.process_state == '待加工':
if production.state == 'progress' and production.schedule_state == '已排' and production.process_state == '待加工':
# if production.state == 'pending_cam' and production.process_state == '待加工':
production.state = 'pending_processing'
elif production.state == 'pending_processing' and production.process_state == '待解除装夹':
production.state = 'pending_era_cam'

View File

@@ -406,9 +406,10 @@ class ResMrpWorkOrder(models.Model):
work = workorder.production_id.workorder_ids
work.compensation_value_x = eval(self.material_center_point)[0]
work.compensation_value_y = eval(self.material_center_point)[1]
work.process_state = '待加工'
self.sudo().production_id.state = 'pending_processing'
workorder.button_finish()
self.process_state = '待加工'
# self.sudo().production_id.state = 'pending_processing'
except Exception as e:
# 重新抛出捕获到的异常信息
raise UserError(str(e))