From a29265f17dd50d6450f0b7be5129e1a484d8a777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?= Date: Thu, 15 May 2025 16:39:57 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=AD=A3=E5=88=99?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E6=88=90=E5=93=81=E5=90=8D=E5=AD=97=E5=BA=8F?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jikimo_purchase_request/models/purchase_request.py | 2 +- sf_manufacturing/models/sale_order.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jikimo_purchase_request/models/purchase_request.py b/jikimo_purchase_request/models/purchase_request.py index 3db8a2d1..7bd6eea5 100644 --- a/jikimo_purchase_request/models/purchase_request.py +++ b/jikimo_purchase_request/models/purchase_request.py @@ -92,7 +92,7 @@ class PurchaseRequestLine(models.Model): continue if record.product_id.categ_id.name == '坯料': product_name = '' - match = re.search(r'(S\d{5}-\d*)', record.product_id.name) + match = re.search(r'(S\d{5}-\d+)', record.product_id.name) # 如果匹配成功,提取结果 if match: product_name = match.group(0) diff --git a/sf_manufacturing/models/sale_order.py b/sf_manufacturing/models/sale_order.py index 48a7cb02..cb214bc9 100644 --- a/sf_manufacturing/models/sale_order.py +++ b/sf_manufacturing/models/sale_order.py @@ -76,7 +76,7 @@ class SaleOrder(models.Model): 'embryo_redundancy_id': line.embryo_redundancy_id, } product_name = '' - match = re.search(r'(S\d{5}-\d*)', product.name) + match = re.search(r'(S\d{5}-\d+)', product.name) # 如果匹配成功,提取结果 if match: product_name = match.group(0) From a3c0fd3ccf64b7962c78d55a9e06ff5e0c61fe94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?= Date: Thu, 15 May 2025 16:48:34 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=B7=A5=E8=89=BA?= =?UTF-8?q?=E5=A4=96=E5=8D=8F=E9=87=87=E8=B4=AD=E5=8D=95=E4=B8=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_workorder.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index cd449c69..e0449176 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -440,12 +440,12 @@ class ResMrpWorkOrder(models.Model): action['context'] = dict(self._context, default_origin=self.name) return action - @api.depends('state', 'production_id.name') def _compute_surface_technics_purchase_ids(self): for order in self: if order.routing_type == '表面工艺' and order.state not in ['cancel']: - domain = [('group_id', '=', self.production_id.procurement_group_id.id), - ('purchase_type', '=', 'consignment'), ('state', '!=', 'cancel')] + domain = [('purchase_type', '=', 'consignment'), + ('origin', 'like', '%' + self.production_id.name + '%'), + ('state', '!=', 'cancel')] # domain = [('purchase_type', '=', 'consignment'), # ('origin', 'like', '%' + self.production_id.name + '%'), # ('state', '!=', 'cancel')]