trytonpsk-sale_pos_frontend.../restaurant.py

35 lines
1.0 KiB
Python

# This file is part sale_shop module for Tryton.
# The COPYRIGHT file at the top level of this repository contains
# the full copyright notices and license terms.
from trytond.model import ModelView, ModelSQL, fields
__all__ = ['SaleShopTable', 'Reservation']
class SaleShopTable(ModelSQL, ModelView):
'Sale Shop Table'
__name__ = 'sale.shop.table'
shop = fields.Many2One('sale.shop', 'Shop', required=True)
name = fields.Char('Table Name', required=True, select=True)
active = fields.Boolean('Active', select=True)
capacity = fields.Integer('Capacity', required=True, select=True)
state = fields.Selection([
('available', 'Available'),
('occupied', 'Occupied'),
('reserved', 'Reserved')
], 'State', states={'readonly': True}
)
@staticmethod
def default_active():
return True
@staticmethod
def default_state():
return 'available'
class Reservation(ModelSQL, ModelView):
'Sale Reservation'
__name__ = 'sale.reservation'