diff --git a/hotel_node_helper/README.rst b/hotel_node_helper/README.rst new file mode 100644 index 000000000..4a067e3c4 --- /dev/null +++ b/hotel_node_helper/README.rst @@ -0,0 +1,22 @@ +================= +Hotel Node Helper +================= + +This module is for providing helper functions to the hotel node master module. + +**Try me on Runbot** + +**Known issues / Roadmap** + +... + +**Bug Tracker** + +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback here. + +Credits + +Contributors + +Maintainer + diff --git a/hotel_node_helper/__init__.py b/hotel_node_helper/__init__.py new file mode 100644 index 000000000..69f7babdf --- /dev/null +++ b/hotel_node_helper/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models diff --git a/hotel_node_helper/__manifest__.py b/hotel_node_helper/__manifest__.py new file mode 100644 index 000000000..917ab41b4 --- /dev/null +++ b/hotel_node_helper/__manifest__.py @@ -0,0 +1,21 @@ +{ + 'name': 'Hotel Node Helper', + 'summary': """Provides helper functions to the hotel node master module""", + 'version': '0.1.0', + 'author': 'Pablo Q. Barriuso, \ + Darío Lodeiros, \ + Alexandre Díaz, \ + Odoo Community Association (OCA)', + 'category': 'Generic Modules/Hotel Management', + 'depends': [ + 'hotel' + ], + 'license': "AGPL-3", + 'data': [ + 'security/hotel_node_security.xml', + 'security/ir.model.access.csv' + ], + 'demo': [], + 'auto_install': False, + 'installable': True +} diff --git a/hotel_node_helper/models/__init__.py b/hotel_node_helper/models/__init__.py new file mode 100644 index 000000000..c21375169 --- /dev/null +++ b/hotel_node_helper/models/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import inherited_hotel_room_type diff --git a/hotel_node_helper/models/inherited_hotel_room_type.py b/hotel_node_helper/models/inherited_hotel_room_type.py new file mode 100644 index 000000000..ac03ae961 --- /dev/null +++ b/hotel_node_helper/models/inherited_hotel_room_type.py @@ -0,0 +1,22 @@ +# Copyright 2018 Pablo Q. Barriuso +# Copyright 2018 Alexandre Díaz +# Copyright 2018 Dario Lodeiros +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +import wdb +from odoo import models, fields, api + + +class HotelRoomType(models.Model): + + _inherit = 'hotel.room.type' + + @api.model + def check_availability_room_ids(self, dfrom, dto, + room_type_id=False, notthis=[]): + """ + Check availability for all or specific room types between dates + @return: A list of `ids` with free rooms + """ + free_rooms = super().check_availability_room(dfrom, dto, room_type_id, notthis) + return free_rooms.ids diff --git a/hotel_node_helper/security/hotel_node_security.xml b/hotel_node_helper/security/hotel_node_security.xml new file mode 100644 index 000000000..74979936c --- /dev/null +++ b/hotel_node_helper/security/hotel_node_security.xml @@ -0,0 +1,3 @@ + + + diff --git a/hotel_node_helper/security/ir.model.access.csv b/hotel_node_helper/security/ir.model.access.csv new file mode 100644 index 000000000..97dd8b917 --- /dev/null +++ b/hotel_node_helper/security/ir.model.access.csv @@ -0,0 +1 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink diff --git a/hotel_node_helper/static/description/icon.png b/hotel_node_helper/static/description/icon.png new file mode 100644 index 000000000..0b47e0cf9 Binary files /dev/null and b/hotel_node_helper/static/description/icon.png differ