From 2c5cc91ef7b332f82a88f50ebb57d99d748ca6d1 Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Sat, 18 May 2024 18:42:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=88=80=E5=85=B7=E5=BC=B9?= =?UTF-8?q?=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_tool_management/wizard/wizard.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sf_tool_management/wizard/wizard.py b/sf_tool_management/wizard/wizard.py index d4cb5143..5da38de2 100644 --- a/sf_tool_management/wizard/wizard.py +++ b/sf_tool_management/wizard/wizard.py @@ -830,10 +830,8 @@ class ProductProduct(models.Model): new_time = datetime.strptime(str(fields.Date.today()), "%Y-%m-%d").strftime("%Y%m%d") code += str(new_time) + '-' stock_lot_id = self.env['stock.lot'].sudo().search( - [('name', 'like', new_time), ('product_id.name', '=', '功能刀具')], - limit=1, - order="id desc" - ) + [('name', 'like', new_time), ('product_id.categ_type', '=', '功能刀具'), + ('product_id.tracking', '=', 'serial')], limit=1, order="id desc") if not stock_lot_id: num = "%03d" % 1 else: