From 589df289bee18117bdaee3520fbcada1061afd91 Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Mon, 25 Nov 2024 17:24:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=85=E9=83=A8=E8=B0=83=E6=8B=A8=E5=8D=95?= =?UTF-8?q?=E7=BC=BA=E5=B0=91=E6=BA=90=E5=8D=95=E6=8D=AE?= 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 c9c97ec7..9ffc0aa2 100644 --- a/sf_manufacturing/models/stock.py +++ b/sf_manufacturing/models/stock.py @@ -972,6 +972,8 @@ class ReStockMove(models.Model): res = super(ReStockMove, self)._get_new_picking_values() if self[0].origin and self.picking_type_id.name in ['生产发料', '内部调拨']: production = self.env['mrp.production'].search([('name', '=', self[0].origin)], limit=1, order='id asc') + if not production: + return res productions = self.env['mrp.production'].search( [('origin', '=', production.origin), ('product_id', '=', production.product_id.id)]) res['origin'] = ','.join(productions.mapped('name'))