From 904c63bfcbb0af5364f253a7d76d0ddc86c8c323 Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Fri, 14 Jun 2024 15:38:52 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BC=98=E5=8C=96=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=88=80=E5=85=B7=E5=AE=89=E5=85=A8=E5=BA=93=E5=AD=98=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E8=AE=A1=E7=AE=97=E6=96=B9=E6=B3=95=EF=BC=9B2?= =?UTF-8?q?=E3=80=81=E8=B4=A7=E4=BD=8D=E7=9C=8B=E6=9D=BF=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD=E5=88=80=E5=85=B7Rfid?= =?UTF-8?q?=E3=80=81=E5=90=8D=E7=A7=B0=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_tool_management/models/stock.py | 7 ++++--- sf_tool_management/views/stock.xml | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sf_tool_management/models/stock.py b/sf_tool_management/models/stock.py index c55cda97..be0f2e45 100644 --- a/sf_tool_management/models/stock.py +++ b/sf_tool_management/models/stock.py @@ -15,8 +15,9 @@ class ShelfLocation(models.Model): if item.product_id.categ_id.name == '功能刀具': tool_id = self.env['sf.functional.cutting.tool.entity'].sudo().search( [('barcode_id', '=', item.product_sn_id.id)]) - item.tool_rfid = tool_id.rfid - item.tool_name_id = tool_id.id - return True + if tool_id: + item.tool_rfid = tool_id.rfid + item.tool_name_id = tool_id.id + continue item.tool_rfid = '' item.tool_name_id = False diff --git a/sf_tool_management/views/stock.xml b/sf_tool_management/views/stock.xml index 063e3ccd..81783631 100644 --- a/sf_tool_management/views/stock.xml +++ b/sf_tool_management/views/stock.xml @@ -6,8 +6,8 @@ - - + +