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']