CNC工单返工

This commit is contained in:
guanhuan
2025-01-23 16:42:16 +08:00
parent 9b49edb290
commit 5636681ee6
5 changed files with 53 additions and 34 deletions

View File

@@ -577,16 +577,19 @@ class MrpProduction(models.Model):
# 编程单更新
# 增加触发时间参数
def update_programming_state(self, trigger_time=None):
def update_programming_state(self, trigger_time=None, reprogramming_reason=None):
try:
manufacturing_type = 'rework'
manufacturing_type = None
if self.is_scrap:
manufacturing_type = 'scrap'
elif self.tool_state == '2':
manufacturing_type = 'invalid_tool_rework'
elif self.is_rework:
manufacturing_type = 'rework'
res = {'programming_no': self.programming_no,
'manufacturing_type': manufacturing_type,
'trigger_time': trigger_time}
'trigger_time': trigger_time,
'reprogramming_reason': reprogramming_reason}
logging.info('res=%s:' % res)
configsettings = self.env['res.config.settings'].get_values()
config_header = Common.get_headers(self, configsettings['token'], configsettings['sf_secret_key'])