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
17 lines
880 B
# -*- coding: utf-8 -*-
|
|
from odoo import models, fields
|
|
|
|
|
|
class RestaurantTable_booking(models.Model):
|
|
_name = 'restaurant.table_booking'
|
|
_description = "Resaturant table booking"
|
|
_order = 'datetime_start, datetime_stop, table_id'
|
|
|
|
booking_id = fields.Many2one(comodel_name='restaurant.booking', string="Booking", required=True, ondelete='cascade')
|
|
name = fields.Char(related='booking_id.name', store=True)
|
|
count = fields.Integer(related='booking_id.count', store=True)
|
|
datetime_start = fields.Datetime(related='booking_id.datetime_start', store=True)
|
|
datetime_stop = fields.Datetime(related='booking_id.datetime_stop', store=True)
|
|
duration = fields.Float(related='booking_id.duration')
|
|
table_id = fields.Many2one(comodel_name='restaurant.table', string="Table", required=True)
|
|
color = fields.Char(related='table_id.color', store=True)
|