Fix: New Product did not work due to missing quantity is the schema

Fix: New Product would not auto add modifiers
This commit is contained in:
Amritanshu Agrawal 2023-03-06 21:42:09 +05:30
parent 516b22ed1c
commit 7d0874093c

View File

@ -124,7 +124,7 @@ def add_modifiers(product_id: uuid.UUID, menu_category_id: uuid.UUID, date_: dat
categories = db.execute(
select(count(ProductVersion.id), ModifierCategory.id)
.join(Product.versions)
.join(ModifierCategoryProduct, ProductVersion.id == ModifierCategoryProduct.product_id)
.join(ModifierCategoryProduct, Product.id == ModifierCategoryProduct.product_id)
.join(ModifierCategory, ModifierCategory.id == ModifierCategoryProduct.modifier_category_id)
.where(
and_(
@ -271,6 +271,7 @@ def show_blank(
isNotAvailable=False,
isActive=True,
sortOrder=0,
quantity=0,
)