2018-01-16 06:58:15 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
2018-01-16 11:34:37 +01:00
|
|
|
# Part of Odoo, Flectra. See LICENSE file for full copyright and licensing details.
|
2018-01-16 06:58:15 +01:00
|
|
|
|
2018-01-16 11:34:37 +01:00
|
|
|
from flectra import api, fields, models
|
2018-01-16 06:58:15 +01:00
|
|
|
|
|
|
|
|
|
|
|
class PosOrder(models.Model):
|
|
|
|
_inherit = 'pos.order'
|
|
|
|
|
|
|
|
table_id = fields.Many2one('restaurant.table', string='Table', help='The table where this order was served')
|
|
|
|
customer_count = fields.Integer(string='Guests', help='The amount of customers that have been served by this order.')
|
|
|
|
|
|
|
|
@api.model
|
|
|
|
def _order_fields(self, ui_order):
|
|
|
|
order_fields = super(PosOrder, self)._order_fields(ui_order)
|
|
|
|
order_fields['table_id'] = ui_order.get('table_id', False)
|
|
|
|
order_fields['customer_count'] = ui_order.get('customer_count', 0)
|
|
|
|
return order_fields
|