From 2b3a2dd21ccfb9efa5ab5685239173b1f40a50a6 Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Thu, 5 Jun 2025 09:16:02 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=A4=84=E7=90=86=E8=BF=94=E5=B7=A5?= =?UTF-8?q?=E6=8A=A5=E9=94=99=EF=BC=8C2=E3=80=81=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E7=9A=84=E5=90=88=E5=90=8C=E6=96=87=E6=A1=A3=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jikimo_workorder_exception/models/mrp_workorder.py | 2 +- sf_manufacturing/models/sale_order.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/jikimo_workorder_exception/models/mrp_workorder.py b/jikimo_workorder_exception/models/mrp_workorder.py index 64f0dd8f..14ea1508 100644 --- a/jikimo_workorder_exception/models/mrp_workorder.py +++ b/jikimo_workorder_exception/models/mrp_workorder.py @@ -9,7 +9,7 @@ class MrpWorkorder(models.Model): exception_ids = fields.One2many('jikimo.workorder.exception', 'workorder_id', string='工单异常记录') def write(self, values): - if values.get('test_results') and self.exception_ids: + if 'test_results' in values and self.exception_ids: pending_exception = self.exception_ids.filtered( lambda exc: exc.state == 'pending' and exc.exception_code == 'YC0005' ) diff --git a/sf_manufacturing/models/sale_order.py b/sf_manufacturing/models/sale_order.py index 84afa4c6..04933064 100644 --- a/sf_manufacturing/models/sale_order.py +++ b/sf_manufacturing/models/sale_order.py @@ -207,7 +207,8 @@ class SaleOrder(models.Model): 'name': contract_file_name, 'attachment_id': attachment.id, 'folder_id': workspace, - 'res_model': 'sale.order' + 'res_model': 'sale.order', + 'res_id': self.id, }) self.write({