25 lines
771 B
Python
25 lines
771 B
Python
from trytond.model import Model, ModelSQL, ModelView, fields
|
|
|
|
|
|
|
|
class Device(Model):
|
|
'Devices'
|
|
__name__ = 'sale_device'
|
|
name = fields.Char("Name")
|
|
ip_address = fields.Char('IP Address or Network', help='IPv4 or IPv6 IP address or network. Valid values include: 192.168.0.26 or 192.168.0.0/24')
|
|
|
|
class Printer(Device, ModelSQL, ModelView):
|
|
'Printer'
|
|
__name__ = 'sale.printer'
|
|
|
|
zone = fields.Selection([('bar', "Bar"),
|
|
('kitchen', "Kitchen"),
|
|
('reception', "Reception")], "Zone")
|
|
shop = fields.Many2One('sale.shop', "Shop")
|
|
api = fields.Many2One('sale.printer_api', "API")
|
|
|
|
class Api(Device, ModelSQL, ModelView):
|
|
'Api printer'
|
|
__name__ = 'sale.printer_api'
|
|
|