diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d4fba2f21..2cc538ade 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -104,7 +104,7 @@ repos: - --settings=. exclude: /__init__\.py$ - repo: https://github.com/acsone/setuptools-odoo - rev: 2.6.0 + rev: 3.0.3 hooks: - id: setuptools-odoo-make-default - id: setuptools-odoo-get-requirements diff --git a/pms_base/README.rst b/pms_base/README.rst new file mode 100644 index 000000000..c7dc5bd70 --- /dev/null +++ b/pms_base/README.rst @@ -0,0 +1,109 @@ +================================ +PMS (Property Management System) +================================ + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png + :target: https://odoo-community.org/page/development-status + :alt: Alpha +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpms-lightgray.png?logo=github + :target: https://github.com/OCA/pms/tree/14.0/pms + :alt: OCA/pms +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/pms-14-0/pms-14-0-pms + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/293/14.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module is an all-in-one property management system (PMS) focused on medium-sized properties +for managing every aspect of your property's daily operations. + +You can manage properties with multi-property and multi-company support, including your rooms inventory, +reservations, check-in, daily reports, board services, rate and availability plans among other property functionalities. + +.. IMPORTANT:: + This is an alpha version, the data model and design can change at any time without warning. + Only for development or testing purpose, do not use in production. + `More details on development status `_ + +**Table of contents** + +.. contents:: + :local: + +Installation +============ + +This module depends on modules ``base``, ``mail``, ``sale`` and ``multi_pms_properties``. +Ensure yourself to have all them in your addons list. + +Configuration +============= + +You will find the hotel settings in PMS Management > Configuration > Properties > Your Property. + +This module required additional configuration for company, accounting, invoicing and user privileges. + +Usage +===== + +To use this module, please, read the complete user guide at ``_. + +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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Commit [Sun] + +Contributors +~~~~~~~~~~~~ + +* Alexandre Díaz +* Pablo Quesada +* Jose Luis Algara +* `Commit [Sun] `: + + * Dario Lodeiros + * Eric Antones + * Sara Lago + * Brais Abeijon + * Miguel Padin + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/pms `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/pms_base/__init__.py b/pms_base/__init__.py new file mode 100644 index 000000000..02179fb04 --- /dev/null +++ b/pms_base/__init__.py @@ -0,0 +1,2 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from . import models diff --git a/pms_base/__manifest__.py b/pms_base/__manifest__.py new file mode 100644 index 000000000..9dcc9a688 --- /dev/null +++ b/pms_base/__manifest__.py @@ -0,0 +1,38 @@ +# Copyright 2019 Darío Lodeiros, Alexandre Díaz, Jose Luis Algara, Pablo Quesada +# Copyright (c) 2021 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Property Management System", + "summary": "Manage properties", + "version": "14.0.1.0.0", + "development_status": "Alpha", + "category": "Generic Modules/Property Management System", + "website": "https://github.com/OCA/pms", + "author": "Commit [Sun], Open Source Integrators, Odoo Community Association (OCA)", + "maintainers": ["eantones"], + "license": "AGPL-3", + "application": True, + "depends": ["base_geolocalize", "mail", "product"], + "data": [ + "security/res_groups.xml", + "security/ir.model.access.csv", + "security/ir_rule.xml", + "data/pms_stage.xml", + "data/pms_team.xml", + "data/pms_amenity_type.xml", + "data/pms_room_type.xml", + "views/pms_tag.xml", + "views/pms_stage.xml", + "views/pms_amenity_type.xml", + "views/pms_amenity.xml", + "views/pms_room_type.xml", + "views/pms_room.xml", + "views/pms_service.xml", + "views/pms_property.xml", + "views/res_config_settings.xml", + "views/pms_team.xml", + "views/menu.xml", + "views/res_partner_view.xml", + ], +} diff --git a/pms_base/data/pms_amenity_type.xml b/pms_base/data/pms_amenity_type.xml new file mode 100644 index 000000000..65757707b --- /dev/null +++ b/pms_base/data/pms_amenity_type.xml @@ -0,0 +1,15 @@ + + + + Toiletries + + + + Connectivity + + + + Kitchen facilities + + + diff --git a/pms_base/data/pms_room_type.xml b/pms_base/data/pms_room_type.xml new file mode 100644 index 000000000..18615b0fa --- /dev/null +++ b/pms_base/data/pms_room_type.xml @@ -0,0 +1,78 @@ + + + + Economic + + + + Single + + + + Double + + + + Triple + + + + Conference Room + + + + Bathroom + 10 + + + + Bedroom + 20 + + + + Kitchen + 30 + + + + Livingroom + 40 + + + + Diningroom + 50 + + + + Playroom + 60 + + + + Terrace/Patio + 64 + + + + Balcony + 67 + + + + Hall + 70 + + + + Garage + 80 + + + + Basement + 90 + + + diff --git a/pms_base/data/pms_stage.xml b/pms_base/data/pms_stage.xml new file mode 100644 index 000000000..4aaae69de --- /dev/null +++ b/pms_base/data/pms_stage.xml @@ -0,0 +1,23 @@ + + + + New + 10 + True + property + + + + Available + 20 + property + + + + Cancelled + 99 + True + property + + + diff --git a/pms_base/data/pms_team.xml b/pms_base/data/pms_team.xml new file mode 100644 index 000000000..40bb1af16 --- /dev/null +++ b/pms_base/data/pms_team.xml @@ -0,0 +1,7 @@ + + + + Default Team + + + diff --git a/pms_base/models/__init__.py b/pms_base/models/__init__.py new file mode 100644 index 000000000..a971276fa --- /dev/null +++ b/pms_base/models/__init__.py @@ -0,0 +1,19 @@ +# Copyright 2018 Alexandre Díaz +# Copyright 2018 Dario Lodeiros +# Copyright (c) 2021 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import ( + pms_stage, + pms_tag, + pms_team, + pms_room_type, + pms_amenity_type, + pms_room, + pms_amenity, + pms_service, + pms_property, + res_company, + res_config_settings, + res_partner, +) diff --git a/pms_base/models/pms_amenity.py b/pms_base/models/pms_amenity.py new file mode 100644 index 000000000..ad8c8b5e5 --- /dev/null +++ b/pms_base/models/pms_amenity.py @@ -0,0 +1,33 @@ +# Copyright 2017 Alexandre Díaz +# Copyright 2017 Dario Lodeiros +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class PmsAmenity(models.Model): + _name = "pms.amenity" + _description = "Property Amenity" + + active = fields.Boolean( + string="Active", help="Determines if amenity is active", default=True + ) + name = fields.Char( + string="Name", help="Name of the amenity", required=True, translate=True + ) + property_ids = fields.Many2many( + string="Properties", + help="Properties with access to the amenity", + comodel_name="pms.property", + ondelete="restrict", + relation="pms_property_amenity_rel", + column1="amenity_id", + column2="property_id", + ) + type_id = fields.Many2one( + string="Type", + help="Organize amenities by type (multimedia, comfort, etc ...)", + comodel_name="pms.amenity.type", + ) + default_code = fields.Char( + string="Internal Reference", help="Internal unique identifier of the amenity" + ) diff --git a/pms_base/models/pms_amenity_type.py b/pms_base/models/pms_amenity_type.py new file mode 100644 index 000000000..211a0cfb4 --- /dev/null +++ b/pms_base/models/pms_amenity_type.py @@ -0,0 +1,14 @@ +# Copyright 2017 Alexandre Díaz +# Copyright 2017 Dario Lodeiros +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class PmsRoomAmenityType(models.Model): + _name = "pms.amenity.type" + _description = "Amenity Type" + + active = fields.Boolean( + string="Active", help="Determines if amenity type is active", default=True + ) + name = fields.Char(string="Name", required=True, translate=True) diff --git a/pms_base/models/pms_property.py b/pms_base/models/pms_property.py new file mode 100644 index 000000000..058152c89 --- /dev/null +++ b/pms_base/models/pms_property.py @@ -0,0 +1,109 @@ +# Copyright 2019 Pablo Quesada +# Copyright 2019 Dario Lodeiros +# Copyright (c) 2021 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import api, fields, models + +from odoo.addons.base.models.res_partner import _tz_get + + +class PmsProperty(models.Model): + _name = "pms.property" + _description = "Property" + _inherit = ["mail.thread", "mail.activity.mixin"] + _inherits = {"res.partner": "partner_id"} + + partner_id = fields.Many2one( + string="Property", + help="Current property", + comodel_name="res.partner", + required=True, + ondelete="cascade", + ) + owner_id = fields.Many2one( + string="Owner", + help="The owner of the property.", + comodel_name="res.partner", + required=True, + ) + parent_id = fields.Many2one(string="Parent Property", comodel_name="pms.property") + property_child_ids = fields.One2many( + "pms.property", "parent_id", string="Children Property" + ) + company_id = fields.Many2one(string="Company", comodel_name="res.company") + team_id = fields.Many2one(string="Team", comodel_name="pms.team") + room_ids = fields.One2many( + string="Rooms", + help="List of rooms in the property.", + comodel_name="pms.room", + inverse_name="property_id", + ) + room_count = fields.Integer(string="Number of rooms", compute="_compute_room_count") + amenity_ids = fields.Many2many( + string="Amenities", + help="Amenities available in this property", + comodel_name="pms.amenity", + ondelete="restrict", + relation="pms_property_amenity_rel", + column1="property_id", + column2="amenity_id", + ) + service_ids = fields.One2many( + string="Services", + help="List of services available in the property.", + comodel_name="pms.service", + inverse_name="property_id", + ) + tag_ids = fields.Many2many( + string="Tags", + comodel_name="pms.tag", + relation="pms_property_tag_rel", + column1="property_id", + column2="tag_id", + ) + tz = fields.Selection( + string="Timezone", + help="This field is used to determine the timezone of the property.", + required=True, + default=lambda self: self.env.user.tz or "UTC", + selection=_tz_get, + ) + area = fields.Float(string="Area") + area_uom_id = fields.Many2one(string="Area UOM", comodel_name="uom.uom") + heating = fields.Selection( + string="Heating", + selection=[ + ("tankless_gas", "Gas (Tankless)"), + ("boiler_gas", "Gas Boiler"), + ("tankless_electric", "Electric (Tankless)"), + ("boiler_electric", "Electric Boiler"), + ("boiler_building", "Building Boiler"), + ], + ) + childs_property_count = fields.Integer( + "Children Count", compute="_compute_childs_property" + ) + team_id = fields.Many2one("pms.team", string="Team") + floors_num = fields.Integer(string="Floor") + unit_floor = fields.Integer(string="Unit Floor") + + @api.depends("property_child_ids") + def _compute_childs_property(self): + for rec in self: + rec.childs_property_count = len(rec.property_child_ids) + + @api.depends("room_ids") + def _compute_room_count(self): + self.room_count = len(self.room_ids) + + def action_view_childs_property_list(self): + action = self.env["ir.actions.actions"]._for_xml_id( + "pms_base.action_pms_property" + ) + action["domain"] = [("id", "in", self.property_child_ids.ids)] + return action + + @api.model + def create(self, vals): + vals.update({"is_property": True}) + return super(PmsProperty, self).create(vals) diff --git a/pms_base/models/pms_room.py b/pms_base/models/pms_room.py new file mode 100644 index 000000000..cc01f5373 --- /dev/null +++ b/pms_base/models/pms_room.py @@ -0,0 +1,47 @@ +# Copyright 2017 Alexandre Díaz +# Copyright 2017 Dario Lodeiros +# Copyright 2018 Pablo Quesada +# Copyright (c) 2021 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class PmsRoom(models.Model): + _name = "pms.room" + _description = "Property Room" + _order = "sequence, type_id, name" + + name = fields.Char(string="Room Name", help="Room Name", required=True) + active = fields.Boolean( + string="Active", help="Determines if room is active", default=True + ) + sequence = fields.Integer( + string="Sequence", + help="Field used to change the position of the rooms in tree view." + "Changing the position changes the sequence", + default=0, + ) + property_id = fields.Many2one( + string="Property", + required=True, + comodel_name="pms.property", + ondelete="restrict", + ) + type_id = fields.Many2one( + string="Room Type", + help="Unique room type for the rooms", + required=True, + comodel_name="pms.room.type", + ondelete="restrict", + ) + capacity = fields.Integer( + string="Capacity", help="The maximum number of people that can occupy a room" + ) + area = fields.Float(string="Area") + _sql_constraints = [ + ( + "room_property_unique", + "unique(name, property_id)", + "You cannot have more 2 rooms with the same name in the same property.", + ) + ] diff --git a/pms_base/models/pms_room_type.py b/pms_base/models/pms_room_type.py new file mode 100644 index 000000000..6a84c7eee --- /dev/null +++ b/pms_base/models/pms_room_type.py @@ -0,0 +1,17 @@ +# Copyright 2017 Alexandre Díaz +# Copyright 2017 Dario Lodeiros +# Copyright 2021 Eric Antones +# Copyright (c) 2021 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class PmsRoomType(models.Model): + _name = "pms.room.type" + _description = "Room Type" + + name = fields.Char(string="Name", required=True, translate=True) + sequence = fields.Integer(string="Sequence", default=0) + icon = fields.Char( + string="Website Icon", help="Set Icon name from https://fontawesome.com/" + ) diff --git a/pms_base/models/pms_service.py b/pms_base/models/pms_service.py new file mode 100644 index 000000000..816e69583 --- /dev/null +++ b/pms_base/models/pms_service.py @@ -0,0 +1,38 @@ +# Copyright 2017 Alexandre Díaz +# Copyright 2017 Dario Lodeiros +# Copyright 2018 Pablo Quesada +# Copyright (c) 2021 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class PmsService(models.Model): + _name = "pms.service" + _description = "Property Service" + + name = fields.Many2one( + string="Service", + help="Service", + required=True, + comodel_name="product.product", + ondelete="restrict", + domain="[('type', '=', 'service')]", + ) + active = fields.Boolean( + string="Active", help="Determines if service is active", default=True + ) + sequence = fields.Integer( + string="Sequence", + help="Field used to change the position of the rooms in tree view." + "Changing the position changes the sequence", + default=0, + ) + property_id = fields.Many2one( + string="Property", + required=True, + comodel_name="pms.property", + ondelete="restrict", + ) + vendor_id = fields.Many2one( + string="Vendor", required=True, comodel_name="res.partner", ondelete="restrict" + ) diff --git a/pms_base/models/pms_stage.py b/pms_base/models/pms_stage.py new file mode 100644 index 000000000..848a84d4c --- /dev/null +++ b/pms_base/models/pms_stage.py @@ -0,0 +1,50 @@ +# Copyright (c) 2021 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import _, api, fields, models +from odoo.exceptions import ValidationError + + +class PMSStage(models.Model): + _name = "pms.stage" + _description = "PMS Stage" + _order = "sequence, name, id" + + def _default_team_ids(self): + default_team_id = self.env.context.get("default_team_id") + return [default_team_id] if default_team_id else None + + name = fields.Char(string="Name", required=True, translate=True) + sequence = fields.Integer("Sequence", default=1) + fold = fields.Boolean( + "Folded in Kanban", + help="This stage is folded in the kanban view when " + "there are no record in that stage to display.", + ) + is_closed = fields.Boolean( + "Is a close stage", help="Services in this stage are considered " "as closed." + ) + is_default = fields.Boolean("Is a default stage", help="Used as default stage") + description = fields.Text(translate=True) + company_id = fields.Many2one( + "res.company", + string="Company", + required=False, + index=True, + default=lambda self: self.env.user.company_id, + ) + team_ids = fields.Many2many( + "pms.team", string="Teams", default=lambda self: self._default_team_ids() + ) + stage_type = fields.Selection([("property", "Property")], "Type", required=True) + custom_color = fields.Char( + "Color Code", default="#FFFFFF", help="Use Hex Code only Ex:-#FFFFFF" + ) + + @api.constrains("custom_color") + def _check_custom_color_hex_code(self): + if ( + self.custom_color + and not self.custom_color.startswith("#") + or len(self.custom_color) != 7 + ): + raise ValidationError(_("Color code should be Hex Code. Ex:-#FFFFFF")) diff --git a/pms_base/models/pms_tag.py b/pms_base/models/pms_tag.py new file mode 100644 index 000000000..253bd9cd2 --- /dev/null +++ b/pms_base/models/pms_tag.py @@ -0,0 +1,33 @@ +# Copyright 2017 Alexandre Díaz +# Copyright 2017 Dario Lodeiros +# Copyright 2021 Eric Antones +# Copyright (c) 2021 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class PmsTag(models.Model): + _name = "pms.tag" + _description = "PMS Tag" + + name = fields.Char(string="Name", required=True, translate=True) + parent_id = fields.Many2one("pms.tag", string="Parent") + color = fields.Integer("Color Index", default=10) + full_name = fields.Char(string="Full Name", compute="_compute_full_name") + company_id = fields.Many2one( + "res.company", + string="Company", + required=True, + index=True, + default=lambda self: self.env.user.company_id, + help="Company related to this tag", + ) + + _sql_constraints = [("name_uniq", "unique (name)", "Tag name already exists!")] + + def _compute_full_name(self): + for record in self: + if record.parent_id: + record.full_name = record.parent_id.name + "/" + record.name + else: + record.full_name = record.name diff --git a/pms_base/models/pms_team.py b/pms_base/models/pms_team.py new file mode 100644 index 000000000..bc99781b3 --- /dev/null +++ b/pms_base/models/pms_team.py @@ -0,0 +1,41 @@ +# Copyright (c) 2021 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class PMSTeam(models.Model): + _name = "pms.team" + _description = "PMS Team" + _inherit = ["mail.thread", "mail.activity.mixin"] + + def _default_stages(self): + return self.env["pms.stage"].search([("is_default", "=", True)]) + + def _compute_property_count(self): + property_count = 0 + property_obj = self.env["pms.property"] + for rec in self: + property_count = property_obj.search_count([("team_id", "=", rec.id)]) + rec.property_count = property_count + + name = fields.Char(required=True, translate=True) + description = fields.Text(translate=True) + color = fields.Integer("Color Index") + stage_ids = fields.Many2many("pms.stage", string="Stages", default=_default_stages) + property_ids = fields.One2many("pms.property", "team_id", string="Properties") + property_count = fields.Integer( + compute="_compute_property_count", string="Properties Count" + ) + sequence = fields.Integer( + "Sequence", default=1, help="Used to sort teams. Lower is better." + ) + company_id = fields.Many2one( + "res.company", + string="Company", + required=False, + index=True, + default=lambda self: self.env.user.company_id, + help="Company related to this team", + ) + + _sql_constraints = [("name_uniq", "unique (name)", "Team name already exists!")] diff --git a/pms_base/models/res_company.py b/pms_base/models/res_company.py new file mode 100644 index 000000000..296c076a7 --- /dev/null +++ b/pms_base/models/res_company.py @@ -0,0 +1,15 @@ +# Copyright 2017 Alexandre Díaz +# Copyright 2017 Dario Lodeiros +# Copyright (c) 2021 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class ResCompany(models.Model): + _inherit = "res.company" + + pms_uom = fields.Selection( + [("ft", "Square Foot"), ("m", "Square Meter")], + string="Unit of Measure", + default="m", + ) diff --git a/pms_base/models/res_config_settings.py b/pms_base/models/res_config_settings.py new file mode 100644 index 000000000..4d77b8310 --- /dev/null +++ b/pms_base/models/res_config_settings.py @@ -0,0 +1,39 @@ +# Copyright 2017 Alexandre Díaz +# Copyright 2017 Dario Lodeiros +# Copyright (c) 2021 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class ResConfigSettings(models.TransientModel): + _inherit = "res.config.settings" + + # Groups + group_pms_show_amenity = fields.Boolean( + string="Show Amenities", implied_group="pms_base.group_pms_show_amenity" + ) + group_pms_show_room = fields.Boolean( + string="Show Rooms", implied_group="pms_base.group_pms_show_room" + ) + group_pms_show_service = fields.Boolean( + string="Show Services", implied_group="pms_base.group_pms_show_service" + ) + group_pms_show_team = fields.Boolean( + string="Show Teams", implied_group="pms_base.group_pms_show_team" + ) + + # Modules + module_pms_account = fields.Boolean(string="Manage Accounting") + module_pms_account_asset = fields.Boolean(string="Manage Assets") + module_pms_contract = fields.Boolean(string="Manage Contracts") + module_pms_crm = fields.Boolean(string="Link a property to a lead") + module_pms_sale = fields.Boolean(string="Manage Reservations") + module_pms_website = fields.Boolean(string="Publish properties") + module_pms_website_sale = fields.Boolean(string="Allow online booking") + module_connector_guesty = fields.Boolean(string="Connect with Guesty") + module_connector_wubook = fields.Boolean(string="Connect with Wubook") + + # Companies + pms_uom = fields.Selection( + string="Unit of Measure", related="company_id.pms_uom", readonly=False + ) diff --git a/pms_base/models/res_partner.py b/pms_base/models/res_partner.py new file mode 100644 index 000000000..5c1703782 --- /dev/null +++ b/pms_base/models/res_partner.py @@ -0,0 +1,9 @@ +# Copyright (c) 2021 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class ResPartner(models.Model): + _inherit = "res.partner" + + is_property = fields.Boolean(string="Is a Property") diff --git a/pms_base/readme/CONFIGURE.rst b/pms_base/readme/CONFIGURE.rst new file mode 100644 index 000000000..173b6bdd6 --- /dev/null +++ b/pms_base/readme/CONFIGURE.rst @@ -0,0 +1 @@ +* Go to Properties > Configuration > Settings. diff --git a/pms_base/readme/CONTRIBUTORS.rst b/pms_base/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..ced562e48 --- /dev/null +++ b/pms_base/readme/CONTRIBUTORS.rst @@ -0,0 +1,14 @@ +* Alexandre Díaz +* Pablo Quesada +* Jose Luis Algara +* `Commit [Sun] `: + + * Dario Lodeiros + * Eric Antones + * Sara Lago + * Brais Abeijon + * Miguel Padin + +* `Open Source Integrators `: + + * Maxime Chambreuil diff --git a/pms_base/readme/DESCRIPTION.rst b/pms_base/readme/DESCRIPTION.rst new file mode 100644 index 000000000..55ee4048c --- /dev/null +++ b/pms_base/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +This module is the base module for the property management system (PMS) modules. + +It provides the "Properties" apps with menu, settings, groups and data. diff --git a/pms_base/readme/USAGE.rst b/pms_base/readme/USAGE.rst new file mode 100644 index 000000000..acb2b8f3d --- /dev/null +++ b/pms_base/readme/USAGE.rst @@ -0,0 +1 @@ +To use this module, please read the complete user guide at ``_. diff --git a/pms_base/security/ir.model.access.csv b/pms_base/security/ir.model.access.csv new file mode 100644 index 000000000..1ca377b77 --- /dev/null +++ b/pms_base/security/ir.model.access.csv @@ -0,0 +1,19 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_pms_amenity_user,access_pms_amenity_user,model_pms_amenity,pms_base.group_pms_user,1,0,0,0 +access_pms_amenity_type_user,access_pms_amenity_type_user,model_pms_amenity_type,pms_base.group_pms_user,1,0,0,0 +access_pms_room_user,access_pms_room_user,model_pms_room,pms_base.group_pms_user,1,0,0,0 +access_pms_tag_user,access_pms_tag_user,model_pms_tag,pms_base.group_pms_user,1,0,0,0 +access_pms_room_type_user,access_pms_room_type_user,model_pms_room_type,pms_base.group_pms_user,1,0,0,0 +access_pms_service_user,access_pms_service_user,model_pms_service,pms_base.group_pms_user,1,0,0,0 +access_pms_stage_use,access_pms_stage,model_pms_stage,pms_base.group_pms_user,1,0,0,0 +access_pms_team_user,access_pms_team,model_pms_team,pms_base.group_pms_user,1,0,0,0 +access_pms_property_user,access_property_user,model_pms_property,pms_base.group_pms_user,1,0,0,0 +access_pms_amenity_manager,access_pms_amenity_manager,model_pms_amenity,pms_base.group_pms_manager,1,1,1,1 +access_pms_amenity_type_manager,access_pms_amenity_type_manager,model_pms_amenity_type,pms_base.group_pms_manager,1,1,1,1 +access_pms_room_manager,access_pms_room_manager,model_pms_room,pms_base.group_pms_manager,1,1,1,1 +access_pms_room_type_manager,access_pms_room_type_manager,model_pms_room_type,pms_base.group_pms_manager,1,1,1,1 +access_pms_service_manager,access_pms_service_manager,model_pms_service,pms_base.group_pms_manager,1,1,1,1 +access_pms_tag_manager,access_pms_tag_manager,model_pms_tag,pms_base.group_pms_manager,1,1,1,1 +access_pms_stage_manager,access_pms_stage,model_pms_stage,pms_base.group_pms_manager,1,1,1,1 +access_pms_team_manager,access_pms_team,model_pms_team,pms_base.group_pms_manager,1,1,1,1 +access_pms_property_manager,access_property_manager,model_pms_property,pms_base.group_pms_manager,1,1,1,1 diff --git a/pms_base/security/ir_rule.xml b/pms_base/security/ir_rule.xml new file mode 100644 index 000000000..3b0696611 --- /dev/null +++ b/pms_base/security/ir_rule.xml @@ -0,0 +1,13 @@ + + + + + Multi-Company Property Rule + + + ['|', ('company_id', '=', False), ('company_id', 'in', company_ids)] + + + diff --git a/pms_base/security/res_groups.xml b/pms_base/security/res_groups.xml new file mode 100644 index 000000000..c07a32bfc --- /dev/null +++ b/pms_base/security/res_groups.xml @@ -0,0 +1,38 @@ + + + + + Property Management / User + + + + + Property Management/ Manager + + + + + + + Show Amenities + + + + + Show Rooms + + + + + Show Services + + + + + Show Teams + + + diff --git a/pms_base/static/description/icon.png b/pms_base/static/description/icon.png new file mode 100644 index 000000000..a81dd64c3 Binary files /dev/null and b/pms_base/static/description/icon.png differ diff --git a/pms_base/static/description/index.html b/pms_base/static/description/index.html new file mode 100644 index 000000000..f2429e666 --- /dev/null +++ b/pms_base/static/description/index.html @@ -0,0 +1,455 @@ + + + + + + +PMS (Property Management System) + + + +
+

PMS (Property Management System)

+ + +

Alpha License: AGPL-3 OCA/pms Translate me on Weblate Try me on Runbot

+

This module is an all-in-one property management system (PMS) focused on medium-sized properties +for managing every aspect of your property’s daily operations.

+

You can manage properties with multi-property and multi-company support, including your rooms inventory, +reservations, check-in, daily reports, board services, rate and availability plans among other property functionalities.

+
+

Important

+

This is an alpha version, the data model and design can change at any time without warning. +Only for development or testing purpose, do not use in production. +More details on development status

+
+

Table of contents

+ +
+

Installation

+

This module depends on modules base, mail, sale and multi_pms_properties. +Ensure yourself to have all them in your addons list.

+
+
+

Configuration

+

You will find the hotel settings in PMS Management > Configuration > Properties > Your Property.

+

This module required additional configuration for company, accounting, invoicing and user privileges.

+
+
+

Usage

+

To use this module, please, read the complete user guide at roomdoo.com.

+
+
+

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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Commit [Sun]
  • +
+
+
+

Contributors

+
    +
  • Alexandre Díaz
  • +
  • Pablo Quesada
  • +
  • Jose Luis Algara
  • +
  • Commit [Sun] <https://www.commitsun.com>:
      +
    • Dario Lodeiros
    • +
    • Eric Antones
    • +
    • Sara Lago
    • +
    • Brais Abeijon
    • +
    • Miguel Padin
    • +
    +
  • +
+
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/pms project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/pms_base/views/menu.xml b/pms_base/views/menu.xml new file mode 100644 index 000000000..ba5b76f2c --- /dev/null +++ b/pms_base/views/menu.xml @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pms_base/views/pms_amenity.xml b/pms_base/views/pms_amenity.xml new file mode 100644 index 000000000..54b4ccd2f --- /dev/null +++ b/pms_base/views/pms_amenity.xml @@ -0,0 +1,66 @@ + + + + pms.amenity.form + pms.amenity + +
+
+ +
+

+

+ + + + + + + + + + + + + + + + + + + + pms.amenity.search + pms.amenity + + + + + + + + + + + pms.amenity.tree + pms.amenity + + + + + + + + + + + Amenities + pms.amenity + tree,form + + + diff --git a/pms_base/views/pms_amenity_type.xml b/pms_base/views/pms_amenity_type.xml new file mode 100644 index 000000000..f17be73df --- /dev/null +++ b/pms_base/views/pms_amenity_type.xml @@ -0,0 +1,44 @@ + + + + + pms.amenity.type.form + pms.amenity.type + +
+
+ +
+