Odoo modules related to point of sales
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
880 B

  1. # -*- coding: utf-8 -*-
  2. from odoo import models, fields
  3. class RestaurantTable_booking(models.Model):
  4. _name = 'restaurant.table_booking'
  5. _description = "Resaturant table booking"
  6. _order = 'datetime_start, datetime_stop, table_id'
  7. booking_id = fields.Many2one(comodel_name='restaurant.booking', string="Booking", required=True, ondelete='cascade')
  8. name = fields.Char(related='booking_id.name', store=True)
  9. count = fields.Integer(related='booking_id.count', store=True)
  10. datetime_start = fields.Datetime(related='booking_id.datetime_start', store=True)
  11. datetime_stop = fields.Datetime(related='booking_id.datetime_stop', store=True)
  12. duration = fields.Float(related='booking_id.duration')
  13. table_id = fields.Many2one(comodel_name='restaurant.table', string="Table", required=True)
  14. color = fields.Char(related='table_id.color', store=True)