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) # 如果匹配成功,提取结果