diff --git a/hotel_management_odoo/README.rst b/hotel_management_odoo/README.rst new file mode 100644 index 000000000..92cab697d --- /dev/null +++ b/hotel_management_odoo/README.rst @@ -0,0 +1,41 @@ +Hotel Management +================ +* Hotel Management for Odoo 15 + +Installation +============ + - www.odoo.com/documentation/15.0/setup/install.html + - Install our custom addon + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.odoo.com/documentation/user/13.0/legal/licenses/licenses.html) + +Company +------- +* 'Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: +Athul @ Cybrosys + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ + diff --git a/hotel_management_odoo/__init__.py b/hotel_management_odoo/__init__.py new file mode 100644 index 000000000..366bd5186 --- /dev/null +++ b/hotel_management_odoo/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from . import models +from . import wizard diff --git a/hotel_management_odoo/__manifest__.py b/hotel_management_odoo/__manifest__.py new file mode 100644 index 000000000..1ae1816d2 --- /dev/null +++ b/hotel_management_odoo/__manifest__.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +{ + 'name': 'Hotel Management V15', + 'version': '15.0.1.0.0', + 'summary': 'Hotel Management Application for odoo 15', + 'description': """The module helps you to manage rooms,amenities,services,restaurants. + End Users can book rooms and reserve foods from hotel restaurant.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'category': 'Sales', + 'website': 'https://www.cybrosys.com', + 'depends': ['sale_management', 'account', 'stock'], + 'data': [ + 'security/ir.model.access.csv', + 'data/sequence.xml', + 'views/room_reservation.xml', + 'views/hotel_meals.xml', + 'views/hotel_restaurant.xml', + 'views/res_settings.xml', + 'views/hotel_amenity.xml', + 'views/hotel_services.xml', + 'views/room_checkin_in_out.xml', + 'views/menus.xml', + ], + 'images': ['static/description/banner.png'], + 'installable': True, + 'application': True, + 'license': 'LGPL-3', +} diff --git a/hotel_management_odoo/data/sequence.xml b/hotel_management_odoo/data/sequence.xml new file mode 100644 index 000000000..1a58ecb6c --- /dev/null +++ b/hotel_management_odoo/data/sequence.xml @@ -0,0 +1,26 @@ + + + + + Reservation + room.reservation + RBK + 5 + + + + Checkin + room.checkin + CKIN + 5 + + + + Checkout + room.checkout + CKOUT + 5 + + + + diff --git a/hotel_management_odoo/doc/RELEASE_NOTES.md b/hotel_management_odoo/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..b275eede6 --- /dev/null +++ b/hotel_management_odoo/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 11.5.2022 +#### Version 15.0.1.0.0 +##### ADD +- Initial Commit for hotel_management_odoo diff --git a/hotel_management_odoo/models/__init__.py b/hotel_management_odoo/models/__init__.py new file mode 100644 index 000000000..9eb8e40e8 --- /dev/null +++ b/hotel_management_odoo/models/__init__.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from . import room_reservation +from . import res_settings +from . import hotel_restaurant +from . import hotel_services +from . import hotel_amenity +from . import room_check_in_out +from . import hotel_meals + + + diff --git a/hotel_management_odoo/models/hotel_amenity.py b/hotel_management_odoo/models/hotel_amenity.py new file mode 100644 index 000000000..1180375c3 --- /dev/null +++ b/hotel_management_odoo/models/hotel_amenity.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models, api + + +class AmenityTypes(models.Model): + _name = "amenity.types" + _description = "Amenity Types" + + amenity_type_id = fields.Many2one("amenity.types", "Types") + categ_id = fields.Many2one('product.category', "Product Category", delegate=True, copy=False, ondelete="cascade") + + def write(self, vals): + if "amenity_type_id" in vals: + amenity_categ = self.env["amenity.type"].browse(vals['amenity_type_id']) + vals.update({"categ_id": amenity_categ.categ_id.id}) + return super(AmenityTypes, self).write(vals) + + def unlink(self): + rec = self.env["product.category"].sudo().browse(self.categ_id.id) + rec.unlink() + return super(AmenityTypes, self).unlink() + + +class HotelAmenity(models.Model): + _name = "hotel.amenity" + _description = "Hotel Amenities" + + product_id = fields.Many2one('product.product', "Amenities", required=True, delegate=True, ondelete="cascade", ) + type_id = fields.Many2one("amenity.types", "Amenity Type", required=True, ondelete="restrict", ) + manager_id = fields.Many2one("res.users", string='Manager') + + @api.model + def create(self, vals): + if "type_id" in vals: + prod = self.env["amenity.types"].browse(vals["type_id"]) + vals.update({"categ_id": prod.categ_id.id}) + return super(HotelAmenity, self).create(vals) + + def write(self, vals): + if "type_id" in vals: + prod = self.env["amenity.types"].browse(vals["type_id"]) + vals.update({"categ_id": prod.categ_id.id}) + return super(HotelAmenity, self).write(vals) + + def unlink(self): + rec = self.env["product.product"].sudo().browse(self.product_id.id) + rec.unlink() + return super(HotelAmenity, self).unlink() diff --git a/hotel_management_odoo/models/hotel_meals.py b/hotel_management_odoo/models/hotel_meals.py new file mode 100644 index 000000000..895129638 --- /dev/null +++ b/hotel_management_odoo/models/hotel_meals.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models, api, _ + + +class HotelMeals(models.Model): + _name = 'hotel.meals' + _description = 'Meals' + + meal_type_id = fields.Many2one('meal.types', string='Type', required=True, ondelete="cascade") + product_id = fields.Many2one('product.product', "Meal", required=True, delegate=True, ondelete="cascade") + manager_id = fields.Many2one("res.users", string='Manager') + + + @api.model + def create(self, vals): + if "meal_type_id" in vals: + prod = self.env["meal.types"].browse(vals["meal_type_id"]) + vals.update({"categ_id": prod.product_categ_id.id, 'meals_ok': True}) + return super(HotelMeals, self).create(vals) + + def write(self, vals): + if "meal_type_id" in vals: + prod = self.env["meal.types"].browse(vals["meal_type_id"]) + vals.update({"categ_id": prod.product_categ_id.id}) + return super(HotelMeals, self).write(vals) + + def unlink(self): + rec = self.env["product.product"].sudo().browse(self.product_id.id) + rec.unlink() + return super(HotelMeals, self).unlink() diff --git a/hotel_management_odoo/models/hotel_restaurant.py b/hotel_management_odoo/models/hotel_restaurant.py new file mode 100644 index 000000000..8e322f275 --- /dev/null +++ b/hotel_management_odoo/models/hotel_restaurant.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models, api, _ +from datetime import datetime + + +class MealsTypes(models.Model): + _name = "meal.types" + _description = "Meals Types" + + type_id = fields.Many2one("meal.types", "Types") + product_categ_id = fields.Many2one('product.category', "Product Category", delegate=True, copy=False, + ondelete="cascade") + + @api.model + def create(self, vals): + vals.update({'is_meals_categ': True}) + return super(MealsTypes, self).create(vals) + + def write(self, vals): + if "type_id" in vals: + categ = self.env["meal.type"].browse(vals['meal']) + vals.update({"categ_id": categ.product_categ_id.id}) + return super(MealsTypes, self).write(vals) + + def unlink(self): + rec = self.env["product.category"].sudo().browse(self.product_categ_id.id) + rec.unlink() + return super(MealsTypes, self).unlink() + + diff --git a/hotel_management_odoo/models/hotel_services.py b/hotel_management_odoo/models/hotel_services.py new file mode 100644 index 000000000..aec0bf66f --- /dev/null +++ b/hotel_management_odoo/models/hotel_services.py @@ -0,0 +1,69 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models, api + + +class ServiceCategories(models.Model): + _name = "service.category" + _description = "Service Categories" + + service_categ_id = fields.Many2one("service.category", "Types") + product_categ_id = fields.Many2one('product.category', " Category", delegate=True, copy=False, + ondelete="cascade", ) + + def write(self, vals): + if "service_categ_id" in vals: + categ = self.env["service.category"].browse(vals['service.category']) + vals.update({"categ_id": categ.product_categ_id.id}) + return super(ServiceCategories, self).write(vals) + + def unlink(self): + rec = self.env["product.category"].sudo().browse(self.product_categ_id.id) + rec.unlink() + return super(ServiceCategories, self).unlink() + + +class HotelService(models.Model): + _name = "hotel.service" + _description = "Hotel Service" + + product_id = fields.Many2one('product.product', "Services", required=True, delegate=True, ondelete="cascade", ) + category_id = fields.Many2one("service.category", "Category", required=True, ondelete="restrict", ) + manager_id = fields.Many2one("res.users", string='Manager') + + @api.model + def create(self, vals): + if "category_id" in vals: + prod = self.env["service.category"].browse(vals["category_id"]) + vals.update({"categ_id": prod.product_categ_id.id, 'service_ok': True}) + return super(HotelService, self).create(vals) + + def write(self, vals): + if "category_id" in vals: + prod = self.env["service.category"].browse(vals["category_id"]) + vals.update({"categ_id": prod.product_categ_id.id,'service_ok': True}) + return super(HotelService, self).write(vals) + + def unlink(self): + rec = self.env["product.product"].sudo().browse(self.product_id.id) + rec.unlink() + return super(HotelService, self).unlink() diff --git a/hotel_management_odoo/models/res_settings.py b/hotel_management_odoo/models/res_settings.py new file mode 100644 index 000000000..461cfb02b --- /dev/null +++ b/hotel_management_odoo/models/res_settings.py @@ -0,0 +1,102 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models, api + + +class ProductProduct(models.Model): + _inherit = "product.product" + + service_ok = fields.Boolean("Is Service") + room_ok = fields.Boolean("Is Room") + meals_ok = fields.Boolean("Is Room") + amenity_ok = fields.Boolean(string="Is Amenity") + type_id = fields.Many2one('room.types') + + +class ProductProduct(models.Model): + _inherit = "product.category" + + is_room_categ = fields.Boolean() + is_meals_categ = fields.Boolean() + + +class Rooms(models.Model): + _name = "room.room" + _description = 'Rooms' + + floor_id = fields.Many2one('hotel.floor', string='Floor') + type_id = fields.Many2one('room.types', string='Type',required=True) + product_id = fields.Many2one('product.product', "product_id", required=True, delegate=True, ondelete="cascade") + amenity_ids = fields.Many2many('hotel.amenity') + status = fields.Selection([("available", "Available"), ("occupied", "Occupied"), ('book', 'Booked')], + default="available") + manager_id = fields.Many2one('res.users', string='Manager') + num_person = fields.Integer(string='Number of Persons') + + @api.model + def create(self, vals): + if "type_id" in vals: + prod = self.env["room.types"].browse(vals["type_id"]) + vals.update({"categ_id": prod.categ_id.id, 'room_ok': True}) + return super(Rooms, self).create(vals) + + def write(self, vals): + if "type_id" in vals: + prod = self.env["room.types"].browse(vals["type_id"]) + vals.update({"categ_id": prod.categ_id.id}) + return super(Rooms, self).write(vals) + + def unlink(self): + rec = self.env["product.product"].sudo().browse(self.product_id.id) + rec.unlink() + return super(Rooms, self).unlink() + + +class RoomTypes(models.Model): + _name = "room.types" + _description = 'Room Types' + + room_type_id = fields.Many2one("room.types", "Types") + categ_id = fields.Many2one('product.category', "Product Category", delegate=True, copy=False, ondelete="cascade") + + @api.model + def create(self, vals): + vals.update({'is_room_categ': True}) + return super(RoomTypes, self).create(vals) + + def write(self, vals): + if "room_type_id" in vals: + categ = self.env["room.types"].browse(vals['room_type_id']) + vals.update({"categ_id": categ.categ_id.id}) + return super(RoomTypes, self).write(vals) + + def unlink(self): + rec = self.env["product.category"].sudo().browse(self.categ_id.id) + rec.unlink() + return super(RoomTypes, self).unlink() + + +class Floor(models.Model): + _name = "hotel.floor" + _description = "Floor" + + name = fields.Char(string="Name", required=True) diff --git a/hotel_management_odoo/models/room_check_in_out.py b/hotel_management_odoo/models/room_check_in_out.py new file mode 100644 index 000000000..50e71498c --- /dev/null +++ b/hotel_management_odoo/models/room_check_in_out.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models, api, _ + + +class RoomCheckin(models.Model): + _name = "room.checkin" + _description = 'Room Checkin' + + name = fields.Char(string='Check-In Reference', required=True, copy=False, readonly=True, + default=lambda self: _('New')) + rm_id = fields.Many2one('room.reservation.line', domain="[('reservation_id','=',reservation_id)]", string="Room No",required=True) + reservation_id = fields.Many2one('room.reservation', string='Reservation ',required=True, + domain="[('state','=','confirm')]") + state = fields.Selection([('draft', 'Draft'),('done', 'Done')], + default='draft') + + def action_checkin(self): + self.rm_id.room_id.write({'status': 'occupied'}) + self.reservation_id.write({'state': 'occupied'}) + self.state='done' + + @api.model + def create(self, vals): + if vals.get('name', _('New')) == _('New'): + vals['name'] = self.env['ir.sequence'].next_by_code( + 'room.checkin') or _('New') + return super(RoomCheckin, self).create(vals) + + +class RoomCheckout(models.Model): + _name = "room.checkout" + _description = 'Room Checkout' + + name = fields.Char(string='Check-Out Reference',required=True, copy=False, readonly=True, + default=lambda self: _('New')) + rm_id = fields.Many2one('room.reservation.line', domain="[('reservation_id','=',reservation_id)]", string="Room No",required=True) + reservation_id = fields.Many2one('room.reservation', string='Reservation', domain="[('state','=','occupied')]",required=True) + state = fields.Selection([('draft', 'Draft'), ('done', 'Done')], + default='draft') + + def action_checkout(self): + self.rm_id.room_id.write({'status': 'available'}) + reserv_line = self.env['room.reservation.line'].sudo().search([('reservation_id', '=', self.reservation_id.id)]) + status = 'available' + for rec in reserv_line: + if rec.room_id.status == 'available': + break + else: + status = 'occupied' + if status == 'available': + self.reservation_id.write({'state': 'done'}) + self.state = 'done' + + @api.model + def create(self, vals): + if vals.get('name', _('New')) == _('New'): + vals['name'] = self.env['ir.sequence'].next_by_code( + 'room.checkout') or _('New') + + return super(RoomCheckout, self).create(vals) diff --git a/hotel_management_odoo/models/room_reservation.py b/hotel_management_odoo/models/room_reservation.py new file mode 100644 index 000000000..d845e6f1d --- /dev/null +++ b/hotel_management_odoo/models/room_reservation.py @@ -0,0 +1,198 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models, api, _, exceptions +from datetime import datetime +from odoo.exceptions import ValidationError + + +class ReservationInvoice(models.Model): + _inherit = 'account.move' + + @api.model + def create(self, vals): + res = super(ReservationInvoice, self).create(vals) + if self._context.get("reservation_id"): + reserv = self.env["room.reservation"].browse(self._context["reservation_id"]) + reserv.write({"invoice_id": res.id, "invoice_status": "invoiced"}) + return res + + +class Reservation(models.Model): + _name = "room.reservation" + _description = 'Reservation' + _rec_name = 'name' + + name = fields.Char(string='Booking Reference', required=True, copy=False, readonly=True, + default=lambda self: _('New')) + num_person = fields.Integer(string='Number of Persons', default=1) + reservation_line_ids = fields.One2many('room.reservation.line', "reservation_id", string='Booking Info') + state = fields.Selection([('draft', 'Draft'), ('confirm', + 'Confirm'), ('occupied', 'Occupied'), ('done', 'Done'), + ('cancel', 'Cancel')], + default='draft') + + sale_order_id = fields.Many2one('sale.order', 'sale Order', delegate=True, copy=False, ondelete="cascade") + service_ids = fields.One2many('hotel.service.line', 'reservation_id') + invoice_id = fields.Many2one('account.move') + meals_ids = fields.One2many('hotel.meals.line', 'reservation_id') + + def action_confirm(self): + self.write({'state': 'confirm'}) + self.sale_order_id.write({'invoice_status': 'to invoice', 'state': 'sale'}) + + def action_cancel(self): + self.state = 'cancel' + for rec in self.reservation_line_ids: + rec.room_id.write({'status': 'available'}) + + @api.model + def create(self, vals): + if vals.get('name', _('New')) == _('New'): + vals['name'] = self.env['ir.sequence'].next_by_code( + 'room.reservation') or _('New') + + return super(Reservation, self).create(vals) + + +class ReservationLine(models.Model): + _name = "room.reservation.line" + _description = 'Reservation Lines' + + reservation_id = fields.Many2one('room.reservation', ondelete="cascade") + type_id = fields.Many2one('product.category', string='Room type') + room_id = fields.Many2one('room.room', string='room Number') + checkin_date = fields.Date(string='Checkin Date', required=True) + checkout_date = fields.Date(string='Checkout Date', required=True) + order_line_id = fields.Many2one('sale.order.line', 'sale Order Line', delegate=True, copy=False, ondelete="cascade") + + @api.constrains("checkin_date", "checkout_date") + def _check_dates(self): + if self.checkin_date >= self.checkout_date: + raise ValidationError(_(" Check In Date Should be less than the Check Out Date!")) + + if self.reservation_id.date_order and self.checkin_date: + if self.checkin_date < self.reservation_id.date_order.date(): + raise ValidationError(_("check in date should be greater than the current date.")) + + @api.model + def create(self, vals): + room = self.env['room.room'].sudo().search([('product_id', '=', vals['product_id'])]) + vals['room_id'] = room.id + room.write({'status': 'book'}) + if "reservation_id" in vals: + reserv = self.env["room.reservation"].browse(vals["reservation_id"]) + vals.update({"order_id": reserv.sale_order_id.id}) + duplicate = self.env['room.reservation.line'].sudo().search( + [ + ('product_id', '=', vals['product_id']), ('reservation_id', '!=', vals['reservation_id']), + ('checkin_date', '>=', vals['checkin_date']), ('checkin_date', '<=', vals['checkout_date']), + ('checkout_date', '<=', vals['checkout_date']), ('checkout_date', '>=', vals['checkin_date']), + ('reservation_id.state', 'in', ('confirm', 'occupied')) + ]) + if duplicate: + raise ValidationError(_('Room not available')) + + return super(ReservationLine, self).create(vals) + + def write(self, vals): + if "reservation_id" in vals: + reserv = self.env["room.reservation"].browse(vals["reservation_id"]) + vals.update({"order_id": reserv.sale_order_id.id}) + return super(ReservationLine, self).write(vals) + + @api.onchange('type_id') + def room_clear(self): + self.write({'product_id': [(5,)]}, ) + + @api.onchange('checkin_date', 'checkout_date') + def _compute_days(self): + for rec in self: + if rec.checkin_date and rec.checkout_date: + fmt = '%Y-%m-%d' + date_difference = (rec.checkout_date - rec.checkin_date) + float_days = date_difference.days + float(date_difference.seconds) / 86400 + rec.product_uom_qty = float_days + + @api.onchange('product_id') + def _compute_subtotoal(self): + self.price_unit = self.product_id.list_price + self.tax_id = self.product_id.taxes_id + + +class ServiceLine(models.Model): + _name = "hotel.service.line" + _description = 'service Lines' + + order_line_id = fields.Many2one('sale.order.line', "Services", required=True, delegate=True, ondelete="cascade") + reservation_id = fields.Many2one("room.reservation", ondelete="cascade") + categ_id = fields.Many2one(related='product_id.categ_id') + checkin_date = fields.Datetime("From Date") + checkout_date = fields.Datetime("To Date") + + @api.model + def create(self, vals): + self.price_unit = self.product_id.list_price + if "reservation_id" in vals: + reserv = self.env["room.reservation"].browse(vals["reservation_id"]) + vals.update({"order_id": reserv.sale_order_id.id}) + return super(ServiceLine, self).create(vals) + + @api.onchange('product_id') + def _compute_subtotal(self): + self.price_unit = self.product_id.list_price + + +class MealsLine(models.Model): + _name = "hotel.meals.line" + _description = 'Meals Lines' + + order_line_id = fields.Many2one('sale.order.line', "Services", required=True, delegate=True, ondelete="cascade") + reservation_id = fields.Many2one("room.reservation", ondelete="cascade") + categ_id = fields.Many2one('product.category', string='Type') + checkin_date = fields.Datetime("From Date") + checkout_date = fields.Datetime("To Date") + + @api.model + def create(self, vals): + self.price_unit = self.product_id.list_price + if "reservation_id" in vals: + reserv = self.env["room.reservation"].browse(vals["reservation_id"]) + vals.update({"order_id": reserv.sale_order_id.id}) + return super(MealsLine, self).create(vals) + + @api.onchange('product_id') + def _compute_subtotal(self): + self.price_unit = self.product_id.list_price + + @api.onchange('categ_id') + def room_clear(self): + self.write({'product_id': [(5,)]}, ) + + @api.onchange('checkin_date', 'checkout_date') + def _compute_days(self): + for rec in self: + if rec.checkin_date and rec.checkout_date: + fmt = '%Y-%m-%d' + date_difference = (rec.checkout_date - rec.checkin_date) + float_days = date_difference.days + float(date_difference.seconds) / 86400 + self.price_subtotal = self.price_unit * float_days + self.product_uom_qty = float_days diff --git a/hotel_management_odoo/security/ir.model.access.csv b/hotel_management_odoo/security/ir.model.access.csv new file mode 100644 index 000000000..5471c3bc2 --- /dev/null +++ b/hotel_management_odoo/security/ir.model.access.csv @@ -0,0 +1,17 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_room_reservation,access.room.reservation,model_room_reservation,,1,1,1,1 +access_room_reservation_line,access.room.reservation.line,model_room_reservation_line,,1,1,1,1 +access_room_room,access.room.room,model_room_room,,1,1,1,1 +access_room_types,access.room.types,model_room_types,,1,1,1,1 +access_meal_types,access.meal.types,model_meal_types,,1,1,1,1 +access_hotel_floor,access.hotel.floor,model_hotel_floor,,1,1,1,1 +access_hotel_service,access.hotel.service,model_hotel_service,,1,1,1,1 +access_hotel_service_line,access.hotel.service.line,model_hotel_service_line,,1,1,1,1 +access_service_category,access.category.type,model_service_category,,1,1,1,1 +access_amenity_types,access.amenity.types,model_amenity_types,,1,1,1,1 +access_hotel_amenity,access.hotel.amenity,model_hotel_amenity,,1,1,1,1 +access_hotel_meals_line,access.hotel.meals.line,model_hotel_meals_line,,1,1,1,1 +access_room_checkin,access.room.checkin,model_room_checkin,,1,1,1,1 +access_room_checkout,access.room.checkout,model_room_checkout,,1,1,1,1 +access_hotel_meals,access.hotel.meals,model_hotel_meals,,1,1,1,1 + diff --git a/hotel_management_odoo/static/description/assets/icons/check.png b/hotel_management_odoo/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/hotel_management_odoo/static/description/assets/icons/check.png differ diff --git a/hotel_management_odoo/static/description/assets/icons/chevron.png b/hotel_management_odoo/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/hotel_management_odoo/static/description/assets/icons/chevron.png differ diff --git a/hotel_management_odoo/static/description/assets/icons/cogs.png b/hotel_management_odoo/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/hotel_management_odoo/static/description/assets/icons/cogs.png differ diff --git a/hotel_management_odoo/static/description/assets/icons/consultation.png b/hotel_management_odoo/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/hotel_management_odoo/static/description/assets/icons/consultation.png differ diff --git a/hotel_management_odoo/static/description/assets/icons/ecom-black.png b/hotel_management_odoo/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/hotel_management_odoo/static/description/assets/icons/ecom-black.png differ diff --git a/hotel_management_odoo/static/description/assets/icons/education-black.png b/hotel_management_odoo/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/hotel_management_odoo/static/description/assets/icons/education-black.png differ diff --git a/hotel_management_odoo/static/description/assets/icons/hotel-black.png b/hotel_management_odoo/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/hotel_management_odoo/static/description/assets/icons/hotel-black.png differ diff --git a/hotel_management_odoo/static/description/assets/icons/license.png b/hotel_management_odoo/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/hotel_management_odoo/static/description/assets/icons/license.png differ diff --git a/hotel_management_odoo/static/description/assets/icons/lifebuoy.png b/hotel_management_odoo/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/hotel_management_odoo/static/description/assets/icons/lifebuoy.png differ diff --git a/hotel_management_odoo/static/description/assets/icons/logo.png b/hotel_management_odoo/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/hotel_management_odoo/static/description/assets/icons/logo.png differ diff --git a/hotel_management_odoo/static/description/assets/icons/manufacturing-black.png b/hotel_management_odoo/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/hotel_management_odoo/static/description/assets/icons/manufacturing-black.png differ diff --git a/hotel_management_odoo/static/description/assets/icons/pos-black.png b/hotel_management_odoo/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/hotel_management_odoo/static/description/assets/icons/pos-black.png differ diff --git a/hotel_management_odoo/static/description/assets/icons/puzzle.png b/hotel_management_odoo/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/hotel_management_odoo/static/description/assets/icons/puzzle.png differ diff --git a/hotel_management_odoo/static/description/assets/icons/restaurant-black.png b/hotel_management_odoo/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/hotel_management_odoo/static/description/assets/icons/restaurant-black.png differ diff --git a/hotel_management_odoo/static/description/assets/icons/service-black.png b/hotel_management_odoo/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/hotel_management_odoo/static/description/assets/icons/service-black.png differ diff --git a/hotel_management_odoo/static/description/assets/icons/trading-black.png b/hotel_management_odoo/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/hotel_management_odoo/static/description/assets/icons/trading-black.png differ diff --git a/hotel_management_odoo/static/description/assets/icons/training.png b/hotel_management_odoo/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/hotel_management_odoo/static/description/assets/icons/training.png differ diff --git a/hotel_management_odoo/static/description/assets/icons/update.png b/hotel_management_odoo/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/hotel_management_odoo/static/description/assets/icons/update.png differ diff --git a/hotel_management_odoo/static/description/assets/icons/user.png b/hotel_management_odoo/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/hotel_management_odoo/static/description/assets/icons/user.png differ diff --git a/hotel_management_odoo/static/description/assets/icons/wrench.png b/hotel_management_odoo/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/hotel_management_odoo/static/description/assets/icons/wrench.png differ diff --git a/hotel_management_odoo/static/description/assets/modules/budget_image.png b/hotel_management_odoo/static/description/assets/modules/budget_image.png new file mode 100644 index 000000000..b50130c7d Binary files /dev/null and b/hotel_management_odoo/static/description/assets/modules/budget_image.png differ diff --git a/hotel_management_odoo/static/description/assets/modules/credit_image.png b/hotel_management_odoo/static/description/assets/modules/credit_image.png new file mode 100644 index 000000000..3ad04ecfd Binary files /dev/null and b/hotel_management_odoo/static/description/assets/modules/credit_image.png differ diff --git a/hotel_management_odoo/static/description/assets/modules/employee_image.png b/hotel_management_odoo/static/description/assets/modules/employee_image.png new file mode 100644 index 000000000..30ad58232 Binary files /dev/null and b/hotel_management_odoo/static/description/assets/modules/employee_image.png differ diff --git a/hotel_management_odoo/static/description/assets/modules/export_image.png b/hotel_management_odoo/static/description/assets/modules/export_image.png new file mode 100644 index 000000000..492980ad0 Binary files /dev/null and b/hotel_management_odoo/static/description/assets/modules/export_image.png differ diff --git a/hotel_management_odoo/static/description/assets/modules/gantt_image.png b/hotel_management_odoo/static/description/assets/modules/gantt_image.png new file mode 100644 index 000000000..1ae7cfe3b Binary files /dev/null and b/hotel_management_odoo/static/description/assets/modules/gantt_image.png differ diff --git a/hotel_management_odoo/static/description/assets/modules/quotation_image.png b/hotel_management_odoo/static/description/assets/modules/quotation_image.png new file mode 100644 index 000000000..499b1a72f Binary files /dev/null and b/hotel_management_odoo/static/description/assets/modules/quotation_image.png differ diff --git a/hotel_management_odoo/static/description/assets/screenshots/0.png b/hotel_management_odoo/static/description/assets/screenshots/0.png new file mode 100644 index 000000000..0dcb6b551 Binary files /dev/null and b/hotel_management_odoo/static/description/assets/screenshots/0.png differ diff --git a/hotel_management_odoo/static/description/assets/screenshots/1.png b/hotel_management_odoo/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..52ce368b9 Binary files /dev/null and b/hotel_management_odoo/static/description/assets/screenshots/1.png differ diff --git a/hotel_management_odoo/static/description/assets/screenshots/11.png b/hotel_management_odoo/static/description/assets/screenshots/11.png new file mode 100644 index 000000000..d0fd0c79f Binary files /dev/null and b/hotel_management_odoo/static/description/assets/screenshots/11.png differ diff --git a/hotel_management_odoo/static/description/assets/screenshots/2.png b/hotel_management_odoo/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..109039cc9 Binary files /dev/null and b/hotel_management_odoo/static/description/assets/screenshots/2.png differ diff --git a/hotel_management_odoo/static/description/assets/screenshots/3.png b/hotel_management_odoo/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..ca042c810 Binary files /dev/null and b/hotel_management_odoo/static/description/assets/screenshots/3.png differ diff --git a/hotel_management_odoo/static/description/assets/screenshots/4.png b/hotel_management_odoo/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..07145e335 Binary files /dev/null and b/hotel_management_odoo/static/description/assets/screenshots/4.png differ diff --git a/hotel_management_odoo/static/description/assets/screenshots/5.png b/hotel_management_odoo/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..292e50ff8 Binary files /dev/null and b/hotel_management_odoo/static/description/assets/screenshots/5.png differ diff --git a/hotel_management_odoo/static/description/assets/screenshots/6.png b/hotel_management_odoo/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..4f55abd5a Binary files /dev/null and b/hotel_management_odoo/static/description/assets/screenshots/6.png differ diff --git a/hotel_management_odoo/static/description/assets/screenshots/7.png b/hotel_management_odoo/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..c598a44c8 Binary files /dev/null and b/hotel_management_odoo/static/description/assets/screenshots/7.png differ diff --git a/hotel_management_odoo/static/description/assets/screenshots/8.png b/hotel_management_odoo/static/description/assets/screenshots/8.png new file mode 100644 index 000000000..3b6f2df4e Binary files /dev/null and b/hotel_management_odoo/static/description/assets/screenshots/8.png differ diff --git a/hotel_management_odoo/static/description/assets/screenshots/9.png b/hotel_management_odoo/static/description/assets/screenshots/9.png new file mode 100644 index 000000000..dd03d1bc4 Binary files /dev/null and b/hotel_management_odoo/static/description/assets/screenshots/9.png differ diff --git a/hotel_management_odoo/static/description/assets/screenshots/hero.gif b/hotel_management_odoo/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..8c44df463 Binary files /dev/null and b/hotel_management_odoo/static/description/assets/screenshots/hero.gif differ diff --git a/hotel_management_odoo/static/description/banner.png b/hotel_management_odoo/static/description/banner.png new file mode 100644 index 000000000..6b3f6e4f5 Binary files /dev/null and b/hotel_management_odoo/static/description/banner.png differ diff --git a/hotel_management_odoo/static/description/icon.png b/hotel_management_odoo/static/description/icon.png new file mode 100644 index 000000000..2630e9f62 Binary files /dev/null and b/hotel_management_odoo/static/description/icon.png differ diff --git a/hotel_management_odoo/static/description/images/checked.png b/hotel_management_odoo/static/description/images/checked.png new file mode 100644 index 000000000..578cedb80 Binary files /dev/null and b/hotel_management_odoo/static/description/images/checked.png differ diff --git a/hotel_management_odoo/static/description/images/cybrosys.png b/hotel_management_odoo/static/description/images/cybrosys.png new file mode 100644 index 000000000..d76b5bafb Binary files /dev/null and b/hotel_management_odoo/static/description/images/cybrosys.png differ diff --git a/hotel_management_odoo/static/description/index.html b/hotel_management_odoo/static/description/index.html new file mode 100644 index 000000000..84111f1f6 --- /dev/null +++ b/hotel_management_odoo/static/description/index.html @@ -0,0 +1,725 @@ +
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+ +
+
+
+
+ +
+
+
+

+ Hotel Management

+

+ A Module for managing Hotel and Restaurant +

+ +
+
+ +
+
+

+ Explore this module +

+
+ + + +
+
+

+ Overview +

+
+ +
+

+ The module helps you to manage rooms,amenities,services,restaurants. + End Users can book rooms and reserve foods from hotel restaurant. +

+ +
+
+ + +
+
+

+ Features +

+
+ +
+
+ +
+
+

+ Room Reservation

+

+

+
+
+
+
+ +
+
+

+ Service Management

+
+
+ +
+
+ +
+
+

+ Amenity Management

+
+
+
+
+ +
+
+

+ Restaurant Management

+
+
+
+
+ +
+
+

+ Floor Management

+
+
+
+
+ +
+
+

+ Food Reservation

+
+
+
+
+
+

+ Screenshots +

+
+
+

+ Configuration Settings +

+

+ + +

+
+

+ Amenities +

+

+ + +

+
+

+ Services +

+

+ + +

+
+

+ Floors +

+

+ + +

+
+

+ Room Management +

+

+ + +

+
+

+ Room Reservation +

+

+ + +

+
+

+ Room Reservation Sale Order +

+

+ + +

+
+

+ Reservation Invoice +

+

+ + +

+
+

+ Room Check-In +

+

+ + +

+
+

+ Room Check-Out +

+

+ + +

+
+

+ Meals +

+

+ + +

+
+ +
+
+

Suggested Products

+
+ + +
+
\ No newline at end of file diff --git a/hotel_management_odoo/views/hotel_amenity.xml b/hotel_management_odoo/views/hotel_amenity.xml new file mode 100644 index 000000000..413dda204 --- /dev/null +++ b/hotel_management_odoo/views/hotel_amenity.xml @@ -0,0 +1,104 @@ + + + + Amenity Types + ir.actions.act_window + amenity.types + tree,form + +

+ Create Amenity Type +

+
+
+ + amenity.types.form + amenity.types + +
+ + + + + + + +
+
+
+ + amenity.types.tree + amenity.types + + + + + + + + + Amenities + ir.actions.act_window + hotel.amenity + tree,form + +

+ Create Amenity +

+
+
+ + hotel.amenity.form + hotel.amenity + +
+ +

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + hotel.amenity.tree + hotel.amenity + + + + + + + + +
\ No newline at end of file diff --git a/hotel_management_odoo/views/hotel_meals.xml b/hotel_management_odoo/views/hotel_meals.xml new file mode 100644 index 000000000..8709fa4db --- /dev/null +++ b/hotel_management_odoo/views/hotel_meals.xml @@ -0,0 +1,67 @@ + + + + Meals + ir.actions.act_window + hotel.meals + tree,form + +

+ Create Meal +

+
+
+ + hotel.meals.form + hotel.meals + +
+ +

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + hotel.meals.tree + hotel.meals + + + + + + + + +
\ No newline at end of file diff --git a/hotel_management_odoo/views/hotel_restaurant.xml b/hotel_management_odoo/views/hotel_restaurant.xml new file mode 100644 index 000000000..4242f1cb3 --- /dev/null +++ b/hotel_management_odoo/views/hotel_restaurant.xml @@ -0,0 +1,53 @@ + + + + + Meal Types + ir.actions.act_window + meal.types + tree,form + +

+ Create Meal Type +

+
+
+ + restaurant.meals.type.tree + meal.types + + + + + + + + restaurant.meals.type.form + meal.types + +
+ + + + + + + +
+
+
+ + + +
\ No newline at end of file diff --git a/hotel_management_odoo/views/hotel_services.xml b/hotel_management_odoo/views/hotel_services.xml new file mode 100644 index 000000000..109bee635 --- /dev/null +++ b/hotel_management_odoo/views/hotel_services.xml @@ -0,0 +1,106 @@ + + + + + Hotel Services + ir.actions.act_window + hotel.service + tree,form + +

+ Create Service +

+
+
+ + hotel.service.form + hotel.service + +
+ +

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + hotel.service.tree + hotel.service + + + + + + + + + + + + Service Category + ir.actions.act_window + service.category + tree,form + +

+ Create Service Category +

+
+
+ + service.category.form + service.category + +
+ + + + + + + +
+
+
+ + service.category.tree + service.category + + + + + + +
diff --git a/hotel_management_odoo/views/menus.xml b/hotel_management_odoo/views/menus.xml new file mode 100644 index 000000000..1c4d48723 --- /dev/null +++ b/hotel_management_odoo/views/menus.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/hotel_management_odoo/views/res_settings.xml b/hotel_management_odoo/views/res_settings.xml new file mode 100644 index 000000000..493faa83e --- /dev/null +++ b/hotel_management_odoo/views/res_settings.xml @@ -0,0 +1,135 @@ + + + + Rooms + ir.actions.act_window + room.room + tree,form + +

+ Create Room +

+
+
+ + room.room.tree + room.room + + + + + + + + + + + room.room.form + room.room + +
+ +

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + + + Room Types + ir.actions.act_window + room.types + tree,form + +

+ Create Room Type +

+
+
+ + room.types.form + room.types + +
+ + + + + + + +
+
+
+ + room.types.tree + room.types + + + + + + + + + + + Floor + ir.actions.act_window + hotel.floor + tree,form + +

+ Create Floor +

+
+
+
\ No newline at end of file diff --git a/hotel_management_odoo/views/room_checkin_in_out.xml b/hotel_management_odoo/views/room_checkin_in_out.xml new file mode 100644 index 000000000..f0471e451 --- /dev/null +++ b/hotel_management_odoo/views/room_checkin_in_out.xml @@ -0,0 +1,100 @@ + + + + + Room Check-In + ir.actions.act_window + room.checkin + tree,form + +

+ Create Check-In +

+
+
+ + room.checkin.tree + room.checkin + + + + + + + + + room.checkin.form + room.checkin + +
+
+
+ +
+

+ +

+
+ + + + + + +
+
+
+
+ + Room Check-Out + ir.actions.act_window + room.checkout + tree,form + +

+ Create Check-Out +

+
+
+ + room.checkout.tree + room.checkout + + + + + + + + + room.checkout.form + room.checkout + +
+
+
+ +
+

+ +

+
+ + + + + + +
+
+
+
+
\ No newline at end of file diff --git a/hotel_management_odoo/views/room_reservation.xml b/hotel_management_odoo/views/room_reservation.xml new file mode 100644 index 000000000..aef3ede60 --- /dev/null +++ b/hotel_management_odoo/views/room_reservation.xml @@ -0,0 +1,125 @@ + + + + Rooms + ir.actions.act_window + room.reservation + tree,form + +

+ Create Reservation +

+
+
+ + room.reservation.tree + room.reservation + + + + + + + + + + + + room.reservation.form + room.reservation + +
+
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + +
\ No newline at end of file diff --git a/hotel_management_odoo/wizard/__init__.py b/hotel_management_odoo/wizard/__init__.py new file mode 100644 index 000000000..efd1a249c --- /dev/null +++ b/hotel_management_odoo/wizard/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import room_invoice \ No newline at end of file diff --git a/hotel_management_odoo/wizard/room_invoice.py b/hotel_management_odoo/wizard/room_invoice.py new file mode 100644 index 000000000..b5974493f --- /dev/null +++ b/hotel_management_odoo/wizard/room_invoice.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class PaymentInv(models.TransientModel): + _inherit = "sale.advance.payment.inv" + + advance_payment_method = fields.Selection( + [("delivered", "Regular invoice"), ("percentage", "Down payment (percentage)"), + ("fixed", "Down payment (fixed amount)")], + string="Create Invoice", + default="delivered", + required=True, ) + + def create_invoices(self): + ctx = self.env.context.copy() + if self._context.get("active_model") == "room.reservation": + HotelFolio = self.env["room.reservation"] + reservation = self.env["room.reservation"].browse(self._context.get("active_ids", [])) + ctx.update( + { + 'reservation_id': reservation.id, + 'active_ids': reservation.sale_order_id.ids, + 'active_id': reservation.sale_order_id.id, + } + ) + return super(PaymentInv, self.with_context(**ctx)).create_invoices()