恢复刀具房样式和编码

This commit is contained in:
guyaodong
2025-06-19 16:18:04 +08:00
parent 8b66fda899
commit aec2d1c516
4 changed files with 56 additions and 12 deletions

View File

@@ -4,8 +4,14 @@ def migrate(cr, version):
env = api.Environment(cr, SUPERUSER_ID, {})
sf_shelf_model = env["sf.shelf"]
sf_shelf_location_model = env["sf.shelf.location"]
preproduction_shelf_ids = sf_shelf_location_model.get_preproduction_shelf_ids()
shelves = sf_shelf_model.search([])
for shelf in shelves:
if shelf.id not in preproduction_shelf_ids:
continue
shelf_barcode = shelf.barcode or ""
if not shelf_barcode:
continue