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/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')] 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)