处理返工报错

This commit is contained in:
yuxianghui
2025-06-05 10:17:39 +08:00
parent 0204e0e24f
commit c6cb1d367d
2 changed files with 18 additions and 13 deletions

View File

@@ -9,7 +9,7 @@ class MrpWorkorder(models.Model):
exception_ids = fields.One2many('jikimo.workorder.exception', 'workorder_id', string='工单异常记录')
def write(self, values):
if 'test_results' in values and self.exception_ids:
if values.get('test_results') and self.exception_ids:
pending_exception = self.exception_ids.filtered(
lambda exc: exc.state == 'pending' and exc.exception_code == 'YC0005'
)