From 8b8c8ebd267929971386cd236997c6ca9e730c33 Mon Sep 17 00:00:00 2001 From: "qihao.gong@jikimo.com" Date: Fri, 23 Feb 2024 16:29:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96=E5=BA=93?= =?UTF-8?q?=E5=8C=BA=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_warehouse/models/model.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sf_warehouse/models/model.py b/sf_warehouse/models/model.py index 72387ba1..fc3c7d09 100644 --- a/sf_warehouse/models/model.py +++ b/sf_warehouse/models/model.py @@ -383,11 +383,15 @@ class ShelfLocation(models.Model): if record.product_sn_id: record.sudo().product_id = record.product_sn_id.product_id record.sudo().location_status = '占用' - else: - record.product_id = False - record.location_status = '空闲' - #调取获取货位信息接口 + else: + if record.production_id: + record.location_status = '占用' + else: + record.product_id = False + record.location_status = '空闲' + + # 调取获取货位信息接口 def get_sf_shelf_location_info(self): # sf_sync_config = self.env['res.config.settings'].get_values() # token = sf_sync_config['token']