Dockerfile updates
This commit is contained in:
+10
-3
@@ -794,15 +794,19 @@ def seed_throughput_products_from_costing(db) -> dict[str, int]:
|
||||
|
||||
default_bag_size = _infer_throughput_bag_size(costing_product)
|
||||
is_bulka_default = _infer_throughput_bulka_default(costing_product)
|
||||
client_name = (costing_product.client_name or "").strip() or None
|
||||
product = (by_item.get(item_id) if item_id else None) or by_name.get(name_key)
|
||||
if product is None:
|
||||
product = ThroughputProduct(
|
||||
tenant_id=TENANT_ID,
|
||||
item_id=item_id,
|
||||
name=name,
|
||||
client_name=client_name,
|
||||
default_bag_size=default_bag_size,
|
||||
is_bulka_default=is_bulka_default,
|
||||
active=costing_product.visible,
|
||||
# Every costing SKU should be selectable in the throughput picker
|
||||
# (the Client filter + search keep the long list manageable).
|
||||
active=True,
|
||||
is_stock_item=True,
|
||||
notes="Seeded from costing products",
|
||||
)
|
||||
@@ -830,8 +834,11 @@ def seed_throughput_products_from_costing(db) -> dict[str, int]:
|
||||
if product.is_bulka_default != is_bulka_default:
|
||||
product.is_bulka_default = is_bulka_default
|
||||
changed = True
|
||||
if product.active != costing_product.visible:
|
||||
product.active = costing_product.visible
|
||||
if product.client_name != client_name:
|
||||
product.client_name = client_name
|
||||
changed = True
|
||||
if product.active is not True:
|
||||
product.active = True
|
||||
changed = True
|
||||
if product.is_stock_item is not True:
|
||||
product.is_stock_item = True
|
||||
|
||||
Reference in New Issue
Block a user