From d014ba980b99a34f6aa8716789384130cef96d7a Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Mon, 24 Mar 2025 14:25:19 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=BF=87=E6=BB=A4=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/stock.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sf_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py index ffea3b36..06985115 100644 --- a/sf_manufacturing/models/stock.py +++ b/sf_manufacturing/models/stock.py @@ -783,6 +783,8 @@ class ReStockMove(models.Model): continue production_id = self.env['mrp.production'].sudo().search( [('name', '=', move.origin)],limit=1) + if not production_id: + continue product_name = '' match = re.search(r'(S\d{5}-\d)', production_id.product_id.name) # 如果匹配成功,提取结果 From a0606842e5c33cce0e032f9ba5a1125bf5d9541c Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Mon, 24 Mar 2025 14:26:53 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=BF=87=E6=BB=A4=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/stock.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sf_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py index 06985115..92543ddb 100644 --- a/sf_manufacturing/models/stock.py +++ b/sf_manufacturing/models/stock.py @@ -786,6 +786,7 @@ class ReStockMove(models.Model): if not production_id: continue product_name = '' + logging.info('制造订单的产品',production_id.product_id.name) match = re.search(r'(S\d{5}-\d)', production_id.product_id.name) # 如果匹配成功,提取结果 if match: