pos_order.py 599 B

12345678910111213141516171819202122
  1. # -*- coding: utf-8 -*-
  2. # Copyright 2017 OpenSynergy Indonesia
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  4. from openerp import models, fields
  5. class PosOrder(models.Model):
  6. _inherit = "pos.order"
  7. table_id = fields.Many2one(
  8. string="Table",
  9. comodel_name="pos.table",
  10. )
  11. def _order_fields(self, cr, uid, ui_order, context=None):
  12. res = super(PosOrder, self)._order_fields(
  13. cr, uid, ui_order, context=context
  14. )
  15. if "table" in ui_order:
  16. res['table_id'] = ui_order['table']['id']
  17. return res