diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index a078a573..7278d24f 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -1646,7 +1646,9 @@ class sf_programming_record(models.Model): # 编号、编程原因、编程方式、当前编程次数、目标制造单号、申请时间、下发时间 number = fields.Char('编号') reason = fields.Text('重新编程原因') - programming_method = fields.Selection([('人工编程', '人工编程'), ('自动编程', '自动编程')], string="编程方式") + programming_method = fields.Selection([ + ('auto', '自动'), + ('manual operation', '人工')], string="编程方式") current_programming_count = fields.Integer('当前编程次数') target_production_id = fields.Char('目标制造单号') apply_time = fields.Datetime('申请时间') diff --git a/sf_manufacturing/wizard/sf_programming_reason.py b/sf_manufacturing/wizard/sf_programming_reason.py index a8bad5d0..f3f54e4d 100644 --- a/sf_manufacturing/wizard/sf_programming_reason.py +++ b/sf_manufacturing/wizard/sf_programming_reason.py @@ -27,7 +27,6 @@ class sf_programming_reason(models.TransientModel): {'programming_state': '编程中', 'work_state': '编程中'}) cloud_programming = self.production_id._cron_get_programming_state() - self.production_id.programming_record_ids.create({ 'number': len(self.production_id.programming_record_ids) + 1, 'production_id': self.production_id.id, @@ -35,8 +34,8 @@ class sf_programming_reason(models.TransientModel): 'programming_method': cloud_programming['programme_way'], 'current_programming_count': cloud_programming['reprogramming_num'], 'target_production_id': cloud_programming['production_order_no'], - 'apply_time': self._context.get('apply_time'), - 'send_time': cloud_programming['programming_time'], + 'apply_time': self._context.get('default_apply_time'), + 'send_time': cloud_programming['send_time'], }) # 返回弹窗提示“已下达编程任务和消息,请等待编程单下发”