mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP] hotel property py guide lines
This commit is contained in:
@@ -13,34 +13,44 @@ class HotelProperty(models.Model):
|
|||||||
_inherits = {'res.partner': 'partner_id'}
|
_inherits = {'res.partner': 'partner_id'}
|
||||||
|
|
||||||
# Fields declaration
|
# Fields declaration
|
||||||
partner_id = fields.Many2one('res.partner', 'Hotel Property',
|
partner_id = fields.Many2one(
|
||||||
required=True, delegate=True, ondelete='cascade')
|
'res.partner',
|
||||||
company_id = fields.Many2one('res.company', help='The company that owns or operates this hotel.',
|
'Hotel Property',
|
||||||
required=True)
|
required=True,
|
||||||
user_ids = fields.Many2many('res.users', 'hotel_property_users_rel', 'hotel_id', 'user_id',
|
delegate=True,
|
||||||
string='Accepted Users')
|
ondelete='cascade')
|
||||||
|
company_id = fields.Many2one(
|
||||||
room_type_ids = fields.One2many('hotel.room.type', 'hotel_id', 'Room Types')
|
'res.company',
|
||||||
room_ids = fields.One2many('hotel.room', 'hotel_id', 'Rooms')
|
required=True,
|
||||||
|
help='The company that owns or operates this hotel.')
|
||||||
# TODO: refactoring res.config.settings', 'default_pricelist_id' by the current hotel.property.pricelist_id
|
user_ids = fields.Many2many(
|
||||||
default_pricelist_id = fields.Many2one('product.pricelist', 'Product Pricelist',
|
'res.users',
|
||||||
help='The default pricelist used in this hotel.',
|
'hotel_property_users_rel',
|
||||||
required=True)
|
'hotel_id',
|
||||||
# TODO: refactoring res.config.settings', 'default_restriction_id by the current hotel.property.restriction_id
|
'user_id',
|
||||||
default_restriction_id = fields.Many2one('hotel.room.type.restriction', 'Restriction Plan',
|
string='Accepted Users')
|
||||||
help='The default restriction plan used in this hotel.',
|
room_type_ids = fields.One2many(
|
||||||
required=True)
|
'hotel.room.type',
|
||||||
|
'hotel_id',
|
||||||
# TODO: refactoring 'res.config.settings', 'default_arrival_hour' by the current hotel.property.arrival_hour
|
'Room Types')
|
||||||
|
room_ids = fields.One2many(
|
||||||
|
'hotel.room',
|
||||||
|
'hotel_id',
|
||||||
|
'Rooms')
|
||||||
|
default_pricelist_id = fields.Many2one(
|
||||||
|
'product.pricelist',
|
||||||
|
string='Product Pricelist',
|
||||||
|
required=True,
|
||||||
|
help='The default pricelist used in this hotel.')
|
||||||
|
default_restriction_id = fields.Many2one(
|
||||||
|
'hotel.room.type.restriction',
|
||||||
|
'Restriction Plan',
|
||||||
|
required=True,
|
||||||
|
help='The default restriction plan used in this hotel.')
|
||||||
default_arrival_hour = fields.Char('Arrival Hour (GMT)',
|
default_arrival_hour = fields.Char('Arrival Hour (GMT)',
|
||||||
help="HH:mm Format", default="14:00")
|
help="HH:mm Format", default="14:00")
|
||||||
# TODO: refactoring 'res.config.settings', 'default_departure_hour' by the current hotel.property.departure_hour
|
|
||||||
default_departure_hour = fields.Char('Departure Hour (GMT)',
|
default_departure_hour = fields.Char('Departure Hour (GMT)',
|
||||||
help="HH:mm Format", default="12:00")
|
help="HH:mm Format", default="12:00")
|
||||||
|
|
||||||
# TODO: refactoring 'res.config.settings', 'tz_hotel' by the current hotel.property.tz (inherited in res.partner)
|
|
||||||
|
|
||||||
default_cancel_policy_days = fields.Integer('Cancellation Days')
|
default_cancel_policy_days = fields.Integer('Cancellation Days')
|
||||||
default_cancel_policy_percent = fields.Float('Percent to pay')
|
default_cancel_policy_percent = fields.Float('Percent to pay')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user