diff --git a/oca_dependencies.txt b/oca_dependencies.txt index 76391d148..e59c9044b 100644 --- a/oca_dependencies.txt +++ b/oca_dependencies.txt @@ -3,3 +3,4 @@ partner-contact reporting-engine queue community-data-files +contract diff --git a/pms_contract/README.rst b/pms_contract/README.rst new file mode 100644 index 000000000..c7dc5bd70 --- /dev/null +++ b/pms_contract/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_contract/__init__.py b/pms_contract/__init__.py new file mode 100644 index 000000000..02179fb04 --- /dev/null +++ b/pms_contract/__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_contract/__manifest__.py b/pms_contract/__manifest__.py new file mode 100644 index 000000000..f97c378fd --- /dev/null +++ b/pms_contract/__manifest__.py @@ -0,0 +1,25 @@ +# 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 contracts related to your 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", + "depends": [ + "contract", + "pms_account", + ], + "data": [ + "views/pms_service.xml", + "views/contract_contract.xml", + "views/pms_property.xml", + "views/menu.xml", + ], +} diff --git a/pms_contract/i18n/es.po b/pms_contract/i18n/es.po new file mode 100644 index 000000000..55aaba850 --- /dev/null +++ b/pms_contract/i18n/es.po @@ -0,0 +1,89 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pms_contract +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0+e-20211202\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-12-23 19:39+0000\n" +"PO-Revision-Date: 2021-12-23 19:39+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: pms_contract +#: model:ir.model,name:pms_contract.model_contract_contract +#: model:ir.model.fields,field_description:pms_contract.field_pms_service__contract_id +msgid "Contract" +msgstr "Contrato" + +#. module: pms_contract +#: model:ir.model.fields,field_description:pms_contract.field_pms_property__contract_count +msgid "Contract Count" +msgstr "Numéro de contrato" + +#. module: pms_contract +#: model:ir.model,name:pms_contract.model_contract_line +msgid "Contract Line" +msgstr "Línea de contrato" + +#. module: pms_contract +#: model:ir.model.fields,field_description:pms_contract.field_pms_property__contract_ids +#: model_terms:ir.ui.view,arch_db:pms_contract.view_pms_property_form +msgid "Contracts" +msgstr "Contratos" + +#. module: pms_contract +#: model:ir.model.fields,field_description:pms_contract.field_contract_contract__display_name +#: model:ir.model.fields,field_description:pms_contract.field_contract_line__display_name +#: model:ir.model.fields,field_description:pms_contract.field_pms_property__display_name +#: model:ir.model.fields,field_description:pms_contract.field_pms_service__display_name +msgid "Display Name" +msgstr "" + +#. module: pms_contract +#: model:ir.model.fields,field_description:pms_contract.field_contract_contract__id +#: model:ir.model.fields,field_description:pms_contract.field_contract_line__id +#: model:ir.model.fields,field_description:pms_contract.field_pms_property__id +#: model:ir.model.fields,field_description:pms_contract.field_pms_service__id +msgid "ID" +msgstr "" + +#. module: pms_contract +#: model:ir.model.fields,field_description:pms_contract.field_contract_contract____last_update +#: model:ir.model.fields,field_description:pms_contract.field_contract_line____last_update +#: model:ir.model.fields,field_description:pms_contract.field_pms_property____last_update +#: model:ir.model.fields,field_description:pms_contract.field_pms_service____last_update +msgid "Last Modified on" +msgstr "" + +#. module: pms_contract +#: model:ir.model.fields,field_description:pms_contract.field_contract_contract__property_ids +#: model_terms:ir.ui.view,arch_db:pms_contract.view_contract_form +msgid "Properties" +msgstr "Propiedades" + +#. module: pms_contract +#: model:ir.model,name:pms_contract.model_pms_property +#: model:ir.model.fields,field_description:pms_contract.field_contract_line__property_id +msgid "Property" +msgstr "Propiedad" + +#. module: pms_contract +#: model:ir.model.fields,field_description:pms_contract.field_contract_contract__property_count +msgid "Property Count" +msgstr "Numéro de propiedades" + +#. module: pms_contract +#: model:ir.model,name:pms_contract.model_pms_service +msgid "Property Service" +msgstr "Servicio de propiedad" + +#. module: pms_contract +#: model:ir.ui.menu,name:pms_contract.menu_vendor_contracts +msgid "Vendor Contracts" +msgstr "Contratos de proveedores" diff --git a/pms_contract/i18n/pms_contract.pot b/pms_contract/i18n/pms_contract.pot new file mode 100644 index 000000000..55aaba850 --- /dev/null +++ b/pms_contract/i18n/pms_contract.pot @@ -0,0 +1,89 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pms_contract +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0+e-20211202\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-12-23 19:39+0000\n" +"PO-Revision-Date: 2021-12-23 19:39+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: pms_contract +#: model:ir.model,name:pms_contract.model_contract_contract +#: model:ir.model.fields,field_description:pms_contract.field_pms_service__contract_id +msgid "Contract" +msgstr "Contrato" + +#. module: pms_contract +#: model:ir.model.fields,field_description:pms_contract.field_pms_property__contract_count +msgid "Contract Count" +msgstr "Numéro de contrato" + +#. module: pms_contract +#: model:ir.model,name:pms_contract.model_contract_line +msgid "Contract Line" +msgstr "Línea de contrato" + +#. module: pms_contract +#: model:ir.model.fields,field_description:pms_contract.field_pms_property__contract_ids +#: model_terms:ir.ui.view,arch_db:pms_contract.view_pms_property_form +msgid "Contracts" +msgstr "Contratos" + +#. module: pms_contract +#: model:ir.model.fields,field_description:pms_contract.field_contract_contract__display_name +#: model:ir.model.fields,field_description:pms_contract.field_contract_line__display_name +#: model:ir.model.fields,field_description:pms_contract.field_pms_property__display_name +#: model:ir.model.fields,field_description:pms_contract.field_pms_service__display_name +msgid "Display Name" +msgstr "" + +#. module: pms_contract +#: model:ir.model.fields,field_description:pms_contract.field_contract_contract__id +#: model:ir.model.fields,field_description:pms_contract.field_contract_line__id +#: model:ir.model.fields,field_description:pms_contract.field_pms_property__id +#: model:ir.model.fields,field_description:pms_contract.field_pms_service__id +msgid "ID" +msgstr "" + +#. module: pms_contract +#: model:ir.model.fields,field_description:pms_contract.field_contract_contract____last_update +#: model:ir.model.fields,field_description:pms_contract.field_contract_line____last_update +#: model:ir.model.fields,field_description:pms_contract.field_pms_property____last_update +#: model:ir.model.fields,field_description:pms_contract.field_pms_service____last_update +msgid "Last Modified on" +msgstr "" + +#. module: pms_contract +#: model:ir.model.fields,field_description:pms_contract.field_contract_contract__property_ids +#: model_terms:ir.ui.view,arch_db:pms_contract.view_contract_form +msgid "Properties" +msgstr "Propiedades" + +#. module: pms_contract +#: model:ir.model,name:pms_contract.model_pms_property +#: model:ir.model.fields,field_description:pms_contract.field_contract_line__property_id +msgid "Property" +msgstr "Propiedad" + +#. module: pms_contract +#: model:ir.model.fields,field_description:pms_contract.field_contract_contract__property_count +msgid "Property Count" +msgstr "Numéro de propiedades" + +#. module: pms_contract +#: model:ir.model,name:pms_contract.model_pms_service +msgid "Property Service" +msgstr "Servicio de propiedad" + +#. module: pms_contract +#: model:ir.ui.menu,name:pms_contract.menu_vendor_contracts +msgid "Vendor Contracts" +msgstr "Contratos de proveedores" diff --git a/pms_contract/models/__init__.py b/pms_contract/models/__init__.py new file mode 100644 index 000000000..ee6041d17 --- /dev/null +++ b/pms_contract/models/__init__.py @@ -0,0 +1,10 @@ +# 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 ( + contract_contract, + contract_line, + pms_service, + pms_property, +) diff --git a/pms_contract/models/contract_contract.py b/pms_contract/models/contract_contract.py new file mode 100644 index 000000000..ab1ffb2bc --- /dev/null +++ b/pms_contract/models/contract_contract.py @@ -0,0 +1,41 @@ +# 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 + + +class ContractContract(models.Model): + _inherit = "contract.contract" + + property_ids = fields.Many2many( + "pms.property", + string="Properties", + compute="_compute_get_properties", + readonly=True, + copy=False, + ) + property_count = fields.Integer( + string="Property Count", + compute="_compute_get_properties", + readonly=True, + copy=False, + ) + + @api.depends("contract_line_ids") + def _compute_get_properties(self): + for contract in self: + properties = contract.contract_line_ids.mapped("property_id") + contract.property_ids = properties + contract.property_count = len(properties) + + def action_view_properties(self): + action = self.env.ref("pms_base.action_pms_property").read()[0] + if self.property_count > 1: + action["domain"] = [("id", "in", self.property_ids.ids)] + elif self.property_ids: + action["views"] = [ + (self.env.ref("pms_base.view_pms_property_form").id, "form") + ] + action["res_id"] = self.property_ids.ids[0] + return action diff --git a/pms_contract/models/contract_line.py b/pms_contract/models/contract_line.py new file mode 100644 index 000000000..9400a5347 --- /dev/null +++ b/pms_contract/models/contract_line.py @@ -0,0 +1,20 @@ +# 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 fields, models + + +class ContractLine(models.Model): + _inherit = "contract.line" + + property_id = fields.Many2one( + "pms.property", + string="Property", + ) + + def _prepare_invoice_line(self, move_form): + invoice_line_vals = super()._prepare_invoice_line(move_form=move_form) + if self.property_id: + invoice_line_vals.update({"property_ids": [(6, 0, self.property_id.ids)]}) + return invoice_line_vals diff --git a/pms_contract/models/pms_property.py b/pms_contract/models/pms_property.py new file mode 100644 index 000000000..8c705ebcf --- /dev/null +++ b/pms_contract/models/pms_property.py @@ -0,0 +1,41 @@ +# 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 + + +class PmsProperty(models.Model): + _inherit = "pms.property" + + contract_ids = fields.Many2many( + "contract.contract", + string="Contracts", + compute="_compute_get_contracts", + readonly=True, + copy=False, + ) + contract_count = fields.Integer( + string="Contract Count", + compute="_compute_get_contracts", + readonly=True, + copy=False, + ) + + @api.depends("service_ids") + def _compute_get_contracts(self): + for property in self: + contracts = property.service_ids.mapped("contract_id") + property.contract_ids = contracts + property.contract_count = len(contracts) + + def action_view_contracts(self): + action = self.env.ref("contract.action_customer_contract").read()[0] + if len(self.contract_ids) > 1: + action["domain"] = [("id", "in", self.contract_ids.ids)] + elif self.contract_ids: + action["views"] = [ + (self.env.ref("contract.contract_contract_form_view").id, "form") + ] + action["res_id"] = self.contract_ids.ids[0] + return action diff --git a/pms_contract/models/pms_service.py b/pms_contract/models/pms_service.py new file mode 100644 index 000000000..b12f54b70 --- /dev/null +++ b/pms_contract/models/pms_service.py @@ -0,0 +1,15 @@ +# 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 fields, models + + +class PmsService(models.Model): + _inherit = "pms.service" + + contract_id = fields.Many2one( + "contract.contract", + string="Contract", + copy=False, + ) diff --git a/pms_contract/readme/CONFIGURE.rst b/pms_contract/readme/CONFIGURE.rst new file mode 100644 index 000000000..173b6bdd6 --- /dev/null +++ b/pms_contract/readme/CONFIGURE.rst @@ -0,0 +1 @@ +* Go to Properties > Configuration > Settings. diff --git a/pms_contract/readme/CONTRIBUTORS.rst b/pms_contract/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..ced562e48 --- /dev/null +++ b/pms_contract/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_contract/readme/DESCRIPTION.rst b/pms_contract/readme/DESCRIPTION.rst new file mode 100644 index 000000000..f13cb3268 --- /dev/null +++ b/pms_contract/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module allows you to manage the contracts and recurring invoices/bills related to the properties. diff --git a/pms_contract/readme/USAGE.rst b/pms_contract/readme/USAGE.rst new file mode 100644 index 000000000..acb2b8f3d --- /dev/null +++ b/pms_contract/readme/USAGE.rst @@ -0,0 +1 @@ +To use this module, please read the complete user guide at ``_. diff --git a/pms_contract/static/description/icon.png b/pms_contract/static/description/icon.png new file mode 100644 index 000000000..a81dd64c3 Binary files /dev/null and b/pms_contract/static/description/icon.png differ diff --git a/pms_contract/static/description/index.html b/pms_contract/static/description/index.html new file mode 100644 index 000000000..f2429e666 --- /dev/null +++ b/pms_contract/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_contract/views/contract_contract.xml b/pms_contract/views/contract_contract.xml new file mode 100644 index 000000000..d00c407f3 --- /dev/null +++ b/pms_contract/views/contract_contract.xml @@ -0,0 +1,29 @@ + + + + contract.contract.property.form + contract.contract + + + + + + + + + + + + diff --git a/pms_contract/views/menu.xml b/pms_contract/views/menu.xml new file mode 100644 index 000000000..94acc2d37 --- /dev/null +++ b/pms_contract/views/menu.xml @@ -0,0 +1,11 @@ + + + + + diff --git a/pms_contract/views/pms_property.xml b/pms_contract/views/pms_property.xml new file mode 100644 index 000000000..d03437d58 --- /dev/null +++ b/pms_contract/views/pms_property.xml @@ -0,0 +1,27 @@ + + + + pms.property.form + pms.property + + + + + + + + + + + + diff --git a/pms_contract/views/pms_service.xml b/pms_contract/views/pms_service.xml new file mode 100644 index 000000000..658e2adb5 --- /dev/null +++ b/pms_contract/views/pms_service.xml @@ -0,0 +1,29 @@ + + + + pms.service.form + pms.service + + + + + + + + + + pms.service.tree + pms.service + + + + + + + + + diff --git a/setup/pms_contract/odoo/addons/pms_contract b/setup/pms_contract/odoo/addons/pms_contract new file mode 120000 index 000000000..305e17adb --- /dev/null +++ b/setup/pms_contract/odoo/addons/pms_contract @@ -0,0 +1 @@ +../../../../pms_contract \ No newline at end of file diff --git a/setup/pms_contract/setup.py b/setup/pms_contract/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/pms_contract/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)