Accept Merge Request #2219: (feature/7154 -> develop)

Merge Request: 恢复刀具房样式和编码

Created By: @谷耀东
Reviewed By: @胡尧
Approved By: @胡尧 
Accepted By: @谷耀东
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/2219
This commit is contained in:
谷耀东
2025-06-19 16:28:02 +08:00
committed by Coding
4 changed files with 56 additions and 12 deletions

View File

@@ -471,7 +471,6 @@ class ShelfLocation(models.Model):
record.display_rfid = record.product_sn_id.rfid if record.product_sn_id else ''
except Exception as e:
record.display_rfid = ''
_logger.error(f"计算 display_rfid 时出错: {e}")
@api.depends('product_id')
def _compute_tool(self):
@@ -601,6 +600,24 @@ class ShelfLocation(models.Model):
_layer_capacity = f"{_layer_capacity:02d}"
record.kanban_show_layer_info=f"{_layer}-{_layer_capacity}"
record.kanban_show_center_control_code=f"{_cc_code}"
@api.model
def get_preproduction_shelf_ids(self):
"""
获取预生产区域的货架ID列表
Returns:
list: 货架ID列表
"""
query = """
SELECT DISTINCT b.shelf_id
FROM stock_location a
LEFT JOIN sf_shelf_location b ON a.id = b.location_id
WHERE a.barcode LIKE 'WH-PREPRODUCTION'
"""
self.env.cr.execute(query)
result = self.env.cr.fetchall()
# 将结果转换为ID列表
shelf_ids = [record[0] for record in result if record[0]]
return shelf_ids
class SfShelfLocationLot(models.Model):
_name = 'sf.shelf.location.lot'
@@ -617,6 +634,7 @@ class SfShelfLocationLot(models.Model):
for item in self:
if item.qty_num > item.qty:
raise ValidationError('变更数量不能比库存数量大!!!')
class SfStockMoveLine(models.Model):