V7
class hotel_room_amenities_type(osv.osv):
_name = 'hotel.room_amenities_type'
_description = 'amenities Type'
_inherits = {'product.category':'cat_id'}
_columns = {
'cat_id':fields.many2one('product.category', 'category', required=True, ondelete='cascade'),
}
_defaults = {
'isamenitype': lambda * a: 1,
}
class product_category(osv.osv):
_inherit = "product.category"
_columns = {
'isroomtype':fields.boolean('Is Room Type'),
'isamenitype':fields.boolean('Is amenities Type'),
'isservicetype':fields.boolean('Is Service Type'),
}
product_category()
V8
class HotelRoomAmenitiesType(models.Model):
_name = 'hotel.room.amenities.type' _description = 'amenities Type'
cat_id = fields.Many2one('product.category', 'category', required=True, delegate=True, ondelete='cascade')