Removed IsModifierCompulsory from MenuCategory as it is now not needed and minimum in ModifierCategory set to non-zero to achieve the same.
Fix: DiscountLimit was not scaled to 100 in MenuCategory detail. So it is now chaled in the json and scaled back in the frontend for the list as that was not supposed to be scaled. Feature: Modifier is now done Fix: In product save, it was checking menu_category second time again instead of sale_category
This commit is contained in:
@ -28,9 +28,8 @@ def save(request):
|
||||
raise ValidationError("Tax Rate must be a decimal >= 0 and <= 100")
|
||||
except (ValueError, InvalidOperation):
|
||||
raise ValidationError("Tax Rate must be a decimal >= 0 and <= 100")
|
||||
is_modifier_compulsory = json.get("isModifierCompulsory", True)
|
||||
is_active = json.get("isActive", True)
|
||||
item = MenuCategory(name, discount_limit, is_modifier_compulsory, is_active, 0)
|
||||
item = MenuCategory(name, discount_limit, is_active, 0)
|
||||
request.dbsession.add(item)
|
||||
transaction.commit()
|
||||
return menu_category_info(item.id, request.dbsession)
|
||||
@ -61,7 +60,6 @@ def update(request):
|
||||
raise ValidationError("Tax Rate must be a decimal >= 0 and <= 100")
|
||||
except (ValueError, InvalidOperation):
|
||||
raise ValidationError("Tax Rate must be a decimal >= 0 and <= 100")
|
||||
item.is_modifier_compulsory = json.get("isModifierCompulsory", True)
|
||||
item.is_active = json.get("isActive", True)
|
||||
transaction.commit()
|
||||
return menu_category_info(item.id, request.dbsession)
|
||||
@ -202,7 +200,6 @@ def menu_category_info(item, dbsession):
|
||||
return {
|
||||
"name": "",
|
||||
"discountLimit": 0,
|
||||
"isModifierCompulsory": False,
|
||||
"isActive": True,
|
||||
"isFixture": False,
|
||||
"sortOrder": 0,
|
||||
@ -212,8 +209,7 @@ def menu_category_info(item, dbsession):
|
||||
return {
|
||||
"id": item.id,
|
||||
"name": item.name,
|
||||
"discountLimit": item.discount_limit,
|
||||
"isModifierCompulsory": item.is_modifier_compulsory,
|
||||
"discountLimit": item.discount_limit * 100,
|
||||
"isActive": item.is_active,
|
||||
"isFixture": item.is_fixture,
|
||||
"sortOrder": item.sort_order,
|
||||
|
||||
Reference in New Issue
Block a user