- tablet_orders (0034) + services/tablet_orders.py: venue rules (menu_tablet.ordering) with
per-tablet overrides: kitchen or waiter confirms first, no open order open/refuse, limits
(items per order, of one dish, time between orders)
- /api/menu-tablet: quote, order, order/{id}, bill (see + ask), requests accept/decline, ordering
- terminal: Add to the order (POS ProductDialog), cart, note, send, live status, the bill
- waiter: TabletRequests on the table page, tablet_order message theme with Open the table
- manager: Settings -> Menu tablets
- tests: test_tablet_orders.py, menu-tablet unit, menu_tablet.mjs e2e (the done-when)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
51 lines
3.3 KiB
Python
51 lines
3.3 KiB
Python
"""Module manifest — see core/modules/model.py and APPS_PLATFORM §4."""
|
|
from core.modules.model import ConfigField, DeviceApp, Limit, Module, Mount, Perm, SettingDef
|
|
|
|
POINTS = ('in_store', 'in_store_takeaway', 'qr_table', 'online_takeaway', 'online_delivery', 'online_preorder', 'none')
|
|
|
|
MODULE = Module(
|
|
key='menu_tablet',
|
|
kind='app',
|
|
name='Menu tablet',
|
|
description="The venue's menu on a tablet: a quick price check for staff and a menu for guests (plan step 5.7a).",
|
|
depends=('catalog',),
|
|
permissions=(
|
|
Perm('menu_tablet.manage', 'Set up menu tablets', roles=('owner', 'store_manager')),
|
|
),
|
|
limits=(
|
|
Limit('devices', 'Number of menu tablets', free=0, licensed_default=1),
|
|
),
|
|
routers=(
|
|
Mount('routers.menu_tablet', '/api/menu-tablet'),
|
|
),
|
|
# Ordering from a tablet at a table (6.6, D-30): the venue's rules, each overridable per tablet
|
|
settings=(
|
|
SettingDef('menu_tablet.ordering', '{}', 'Ordering from menu tablets at tables (plan step 6.6): confirm (kitchen | waiter), no_order (open | refuse), max_items, max_of_one, min_seconds. Edited in Settings > Menu tablets.', type='json'),
|
|
),
|
|
# How the menu looks on this tablet (owner 2026-11-17: views, photos, descriptions, grouping…)
|
|
device_app=DeviceApp(login_modes=('none',), scope=(), config=(
|
|
ConfigField('view', 'enum', default='expanded', choices=('compact', 'expanded', 'full'), group='look'),
|
|
ConfigField('photos', 'bool', default=True, group='look'),
|
|
ConfigField('descriptions', 'bool', default=True, group='look'),
|
|
ConfigField('group', 'bool', default=True, group='look'),
|
|
ConfigField('theme', 'enum', default='light', choices=('light', 'dark'), group='look'),
|
|
ConfigField('sales_point', 'enum', default='in_store', choices=POINTS, group='menu'),
|
|
ConfigField('sold_out', 'enum', default='strike', choices=('strike', 'hide'), group='menu'),
|
|
ConfigField('category', 'ref', default=None, choices_from='categories', group='menu'),
|
|
ConfigField('search', 'bool', default=True, group='use'),
|
|
ConfigField('languages', 'enum', default='both', choices=('both', 'el', 'en'), group='use'),
|
|
ConfigField('idle_seconds', 'int', default=120, choices=(0, 30, 60, 120, 300, 600), group='use'),
|
|
# A tablet on a table (5.7b): only then guests can call a waiter
|
|
ConfigField('table', 'ref', default=None, choices_from='tables', group='table'),
|
|
ConfigField('call_waiter', 'bool', default=True, group='table'),
|
|
# Guests order from it (6.6, D-30): off until the venue turns it on; the rest -1 / venue = the venue's setting
|
|
ConfigField('ordering', 'bool', default=False, group='order'),
|
|
ConfigField('bill', 'bool', default=True, group='order'),
|
|
ConfigField('order_confirm', 'enum', default='venue', choices=('venue', 'kitchen', 'waiter'), group='order'),
|
|
ConfigField('order_no_order', 'enum', default='venue', choices=('venue', 'open', 'refuse'), group='order'),
|
|
ConfigField('order_max_items', 'int', default=-1, choices=(-1, 5, 10, 15, 20, 30, 50), group='order'),
|
|
ConfigField('order_max_of_one', 'int', default=-1, choices=(-1, 1, 2, 3, 5, 10, 20), group='order'),
|
|
ConfigField('order_min_seconds', 'int', default=-1, choices=(-1, 0, 30, 60, 120, 300, 600), group='order'),
|
|
)),
|
|
)
|