diff --git a/maintenance_location/README.rst b/maintenance_location/README.rst new file mode 100644 index 000000000..e71ea29af --- /dev/null +++ b/maintenance_location/README.rst @@ -0,0 +1,93 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +==================== +Maintenance Location +==================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:a2caa69cdd2b23704424558561a62b4ec0b4057a8d75594e0367262ef16364ed + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/license-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%2Fmaintenance-lightgray.png?logo=github + :target: https://github.com/OCA/maintenance/tree/17.0/maintenance_location + :alt: OCA/maintenance +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/maintenance-17-0/maintenance-17-0-maintenance_location + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/maintenance&target_branch=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Define a location system with hierarchy for maintenance equipments and +requests. + +**Table of contents** + +.. contents:: + :local: + +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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* CreuBlanca +* Dixmit + +Contributors +------------ + +- `Dixmit `__ + + - Enric Tobella + +- CreuBlanca + + - Kevin Luna + - Jaime Arroyo + +- `Heliconia Solutions Pvt. Ltd. `__ + + - Bhavesh Heliconia + +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/maintenance `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/maintenance_location/__init__.py b/maintenance_location/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/maintenance_location/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/maintenance_location/__manifest__.py b/maintenance_location/__manifest__.py new file mode 100644 index 000000000..e5e0f616e --- /dev/null +++ b/maintenance_location/__manifest__.py @@ -0,0 +1,26 @@ +# Copyright 2019 Creu Blanca +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Maintenance Location", + "summary": """ + Define a location system for maintenance""", + "version": "18.0.1.0.0", + "license": "AGPL-3", + "author": "CreuBlanca, Dixmit,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/maintenance", + "depends": ["maintenance_plan"], + "data": [ + "security/ir.model.access.csv", + "views/maintenance_plan.xml", + "views/maintenance_equipment.xml", + "views/maintenance_request.xml", + "views/maintenance_location.xml", + "views/report_maintenance_request.xml", + ], + "demo": [ + "demo/demo_maintenance_location.xml", + "demo/demo_maintenance_plan.xml", + "demo/demo_maintenance_equipment.xml", + ], +} diff --git a/maintenance_location/demo/demo_maintenance_equipment.xml b/maintenance_location/demo/demo_maintenance_equipment.xml new file mode 100644 index 000000000..86f72929e --- /dev/null +++ b/maintenance_location/demo/demo_maintenance_equipment.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/maintenance_location/demo/demo_maintenance_location.xml b/maintenance_location/demo/demo_maintenance_location.xml new file mode 100644 index 000000000..50f84e1ac --- /dev/null +++ b/maintenance_location/demo/demo_maintenance_location.xml @@ -0,0 +1,34 @@ + + + + Building A + Main office building + + + + Level 1 + + + + + Level 2 + + + + + Building B + Secondary building + + + + Warehouse + Storage and logistics area + + + + + Workshop + Maintenance and repair workshop + + + diff --git a/maintenance_location/demo/demo_maintenance_plan.xml b/maintenance_location/demo/demo_maintenance_plan.xml new file mode 100644 index 000000000..74a92c369 --- /dev/null +++ b/maintenance_location/demo/demo_maintenance_plan.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + diff --git a/maintenance_location/i18n/es.po b/maintenance_location/i18n/es.po new file mode 100644 index 000000000..cd8488ba5 --- /dev/null +++ b/maintenance_location/i18n/es.po @@ -0,0 +1,214 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * maintenance_location +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-10-21 09:56+0000\n" +"PO-Revision-Date: 2025-10-21 13:38+0200\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: \n" +"X-Generator: Poedit 3.7\n" + +#. module: maintenance_location +#: model_terms:ir.ui.view,arch_db:maintenance_location.hr_equipment_view_kanban +msgid "&nbsp;" +msgstr "" + +#. module: maintenance_location +#: model_terms:ir.ui.view,arch_db:maintenance_location.maintenance_location_form_view +msgid "" +"
\n" +" Longitude:" +msgstr "" + +#. module: maintenance_location +#: model_terms:ir.ui.view,arch_db:maintenance_location.hr_equipment_view_kanban +msgid "" +msgstr "" + +#. module: maintenance_location +#: model_terms:ir.ui.view,arch_db:maintenance_location.report_maintenance_request_document +msgid "Location:" +msgstr "" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__active +msgid "Active" +msgstr "" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__child_id +msgid "Child Locations" +msgstr "Ubicaciones Hijas" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__complete_name +msgid "Complete Name" +msgstr "Nombre completo" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__create_uid +msgid "Created by" +msgstr "Creado por" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__create_date +msgid "Created on" +msgstr "Creado en" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__description +msgid "Description" +msgstr "" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__display_name +msgid "Display Name" +msgstr "Nombre mostrado" + +#. module: maintenance_location +#. odoo-python +#: code:addons/maintenance_location/models/maintenance_location.py:0 +msgid "Error ! You cannot create recursive Locations." +msgstr "Error! No puedes crear ubicaciones cíclicas." + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__id +msgid "ID" +msgstr "ID (identificación)" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__write_uid +msgid "Last Updated by" +msgstr "Última actualización de" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__write_date +msgid "Last Updated on" +msgstr "Última actualización en" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__latitude +msgid "Latitude" +msgstr "" + +#. module: maintenance_location +#: model_terms:ir.ui.view,arch_db:maintenance_location.maintenance_location_form_view +msgid "Latitude:" +msgstr "" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_equipment__location_id +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_plan__location_id +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_request__location_id +#: model_terms:ir.ui.view,arch_db:maintenance_location.maintenance_location_form_view +msgid "Location" +msgstr "Ubicación" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_equipment__location +#, fuzzy +#| msgid "Location :" +msgid "Location Old" +msgstr "Location :" + +#. module: maintenance_location +#: model_terms:ir.ui.view,arch_db:maintenance_location.maintenance_location_form_view +msgid "Location name" +msgstr "Nombre de la ubicación" + +#. module: maintenance_location +#: model_terms:ir.ui.view,arch_db:maintenance_location.hr_equipment_request_view_kanban +#, fuzzy +#| msgid "Location :" +msgid "Location:" +msgstr "Location :" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__longitude +msgid "Longitude" +msgstr "" + +#. module: maintenance_location +#: model:ir.model,name:maintenance_location.model_maintenance_equipment +#, fuzzy +#| msgid "Maintenance Requests" +msgid "Maintenance Equipment" +msgstr "Peticiones de mantenimiento" + +#. module: maintenance_location +#: model:ir.actions.act_window,name:maintenance_location.maintenance_location_act_window +#: model:ir.model,name:maintenance_location.model_maintenance_location +msgid "Maintenance Location" +msgstr "Ubicación" + +#. module: maintenance_location +#: model:ir.ui.menu,name:maintenance_location.maintenance_location_menu +msgid "Maintenance Locations" +msgstr "Ubicaciones" + +#. module: maintenance_location +#: model:ir.model,name:maintenance_location.model_maintenance_plan +#, fuzzy +#| msgid "Maintenance Location" +msgid "Maintenance Plan" +msgstr "Ubicación" + +#. module: maintenance_location +#: model:ir.model,name:maintenance_location.model_maintenance_request +#, fuzzy +#| msgid "Maintenance Requests" +msgid "Maintenance Request" +msgstr "Peticiones de mantenimiento" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__name +msgid "Name" +msgstr "Nombre" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__parent_id +msgid "Parent Location" +msgstr "Ubicación padre" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__parent_path +#, fuzzy +#| msgid "Parent Location" +msgid "Parent Path" +msgstr "Ubicación padre" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__partner_id +msgid "Partner" +msgstr "Centro" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__sequence +msgid "Sequence" +msgstr "" + +#. module: maintenance_location +#: model_terms:ir.ui.view,arch_db:maintenance_location.maintenance_location_form_view +msgid "e.g. Building A" +msgstr "p.e. Edificio A" + +#~ msgid "Equipment" +#~ msgstr "Equipamiento" + +#~ msgid "Last Modified on" +#~ msgstr "Última modificación en" + +#~ msgid "Left Parent" +#~ msgstr "Padre izquierdo" + +#~ msgid "Right Parent" +#~ msgstr "Padre derecho" diff --git a/maintenance_location/i18n/it.po b/maintenance_location/i18n/it.po new file mode 100644 index 000000000..bf4f38504 --- /dev/null +++ b/maintenance_location/i18n/it.po @@ -0,0 +1,197 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * maintenance_location +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-10-21 09:56+0000\n" +"PO-Revision-Date: 2025-10-21 13:39+0200\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Poedit 3.7\n" + +#. module: maintenance_location +#: model_terms:ir.ui.view,arch_db:maintenance_location.hr_equipment_view_kanban +msgid "&nbsp;" +msgstr "" + +#. module: maintenance_location +#: model_terms:ir.ui.view,arch_db:maintenance_location.maintenance_location_form_view +msgid "" +"
\n" +" Longitude:" +msgstr "" +"
\n" +" Longitudine:" + +#. module: maintenance_location +#: model_terms:ir.ui.view,arch_db:maintenance_location.hr_equipment_view_kanban +msgid "" +msgstr "" + +#. module: maintenance_location +#: model_terms:ir.ui.view,arch_db:maintenance_location.report_maintenance_request_document +msgid "Location:" +msgstr "" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__active +msgid "Active" +msgstr "Attiva" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__child_id +msgid "Child Locations" +msgstr "Ubicazioni figlie" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__complete_name +msgid "Complete Name" +msgstr "Nome completo" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__create_uid +msgid "Created by" +msgstr "Creato da" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__create_date +msgid "Created on" +msgstr "Creato il" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__description +msgid "Description" +msgstr "Descrizione" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__display_name +msgid "Display Name" +msgstr "Nome visualizzato" + +#. module: maintenance_location +#. odoo-python +#: code:addons/maintenance_location/models/maintenance_location.py:0 +msgid "Error ! You cannot create recursive Locations." +msgstr "Errore! Non è possibile creare ubicazioni ricorsive." + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__id +msgid "ID" +msgstr "ID" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__write_uid +msgid "Last Updated by" +msgstr "Ultimo aggiornamento di" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__write_date +msgid "Last Updated on" +msgstr "Ultimo aggiornamento il" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__latitude +msgid "Latitude" +msgstr "Latitudine" + +#. module: maintenance_location +#: model_terms:ir.ui.view,arch_db:maintenance_location.maintenance_location_form_view +msgid "Latitude:" +msgstr "Latitudine:" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_equipment__location_id +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_plan__location_id +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_request__location_id +#: model_terms:ir.ui.view,arch_db:maintenance_location.maintenance_location_form_view +msgid "Location" +msgstr "Ubicazione" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_equipment__location +msgid "Location Old" +msgstr "Ubicazione vecchia" + +#. module: maintenance_location +#: model_terms:ir.ui.view,arch_db:maintenance_location.maintenance_location_form_view +msgid "Location name" +msgstr "Nome ubicazione" + +#. module: maintenance_location +#: model_terms:ir.ui.view,arch_db:maintenance_location.hr_equipment_request_view_kanban +#, fuzzy +#| msgid "Location :" +msgid "Location:" +msgstr "Ubicazione:" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__longitude +msgid "Longitude" +msgstr "Longitudine" + +#. module: maintenance_location +#: model:ir.model,name:maintenance_location.model_maintenance_equipment +msgid "Maintenance Equipment" +msgstr "Attrezzatura manutenzione" + +#. module: maintenance_location +#: model:ir.actions.act_window,name:maintenance_location.maintenance_location_act_window +#: model:ir.model,name:maintenance_location.model_maintenance_location +msgid "Maintenance Location" +msgstr "Ubicazione manutenzione" + +#. module: maintenance_location +#: model:ir.ui.menu,name:maintenance_location.maintenance_location_menu +msgid "Maintenance Locations" +msgstr "Ubicazioni manutenzione" + +#. module: maintenance_location +#: model:ir.model,name:maintenance_location.model_maintenance_plan +msgid "Maintenance Plan" +msgstr "Piano manutenzione" + +#. module: maintenance_location +#: model:ir.model,name:maintenance_location.model_maintenance_request +msgid "Maintenance Request" +msgstr "Richiesta manutenzione" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__name +msgid "Name" +msgstr "Nome" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__parent_id +msgid "Parent Location" +msgstr "Ubicazione madre" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__parent_path +msgid "Parent Path" +msgstr "Percorso padre" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__partner_id +msgid "Partner" +msgstr "Partner" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__sequence +msgid "Sequence" +msgstr "Sequenza" + +#. module: maintenance_location +#: model_terms:ir.ui.view,arch_db:maintenance_location.maintenance_location_form_view +msgid "e.g. Building A" +msgstr "e.g. Fabbricato A" + +#~ msgid "Last Modified on" +#~ msgstr "Ultima modifica il" diff --git a/maintenance_location/i18n/maintenance_location.pot b/maintenance_location/i18n/maintenance_location.pot new file mode 100644 index 000000000..ebc62b9ce --- /dev/null +++ b/maintenance_location/i18n/maintenance_location.pot @@ -0,0 +1,188 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * maintenance_location +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-10-21 09:56+0000\n" +"PO-Revision-Date: 2025-10-21 09:56+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: maintenance_location +#: model_terms:ir.ui.view,arch_db:maintenance_location.hr_equipment_view_kanban +msgid "&nbsp;" +msgstr "" + +#. module: maintenance_location +#: model_terms:ir.ui.view,arch_db:maintenance_location.maintenance_location_form_view +msgid "" +"
\n" +" Longitude:" +msgstr "" + +#. module: maintenance_location +#: model_terms:ir.ui.view,arch_db:maintenance_location.hr_equipment_view_kanban +msgid "" +msgstr "" + +#. module: maintenance_location +#: model_terms:ir.ui.view,arch_db:maintenance_location.report_maintenance_request_document +msgid "Location:" +msgstr "" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__active +msgid "Active" +msgstr "" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__child_id +msgid "Child Locations" +msgstr "" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__complete_name +msgid "Complete Name" +msgstr "" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__create_uid +msgid "Created by" +msgstr "" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__create_date +msgid "Created on" +msgstr "" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__description +msgid "Description" +msgstr "" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__display_name +msgid "Display Name" +msgstr "" + +#. module: maintenance_location +#. odoo-python +#: code:addons/maintenance_location/models/maintenance_location.py:0 +msgid "Error ! You cannot create recursive Locations." +msgstr "" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__id +msgid "ID" +msgstr "" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__write_date +msgid "Last Updated on" +msgstr "" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__latitude +msgid "Latitude" +msgstr "" + +#. module: maintenance_location +#: model_terms:ir.ui.view,arch_db:maintenance_location.maintenance_location_form_view +msgid "Latitude:" +msgstr "" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_equipment__location_id +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_plan__location_id +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_request__location_id +#: model_terms:ir.ui.view,arch_db:maintenance_location.maintenance_location_form_view +msgid "Location" +msgstr "" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_equipment__location +msgid "Location Old" +msgstr "" + +#. module: maintenance_location +#: model_terms:ir.ui.view,arch_db:maintenance_location.maintenance_location_form_view +msgid "Location name" +msgstr "" + +#. module: maintenance_location +#: model_terms:ir.ui.view,arch_db:maintenance_location.hr_equipment_request_view_kanban +msgid "Location:" +msgstr "" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__longitude +msgid "Longitude" +msgstr "" + +#. module: maintenance_location +#: model:ir.model,name:maintenance_location.model_maintenance_equipment +msgid "Maintenance Equipment" +msgstr "" + +#. module: maintenance_location +#: model:ir.actions.act_window,name:maintenance_location.maintenance_location_act_window +#: model:ir.model,name:maintenance_location.model_maintenance_location +msgid "Maintenance Location" +msgstr "" + +#. module: maintenance_location +#: model:ir.ui.menu,name:maintenance_location.maintenance_location_menu +msgid "Maintenance Locations" +msgstr "" + +#. module: maintenance_location +#: model:ir.model,name:maintenance_location.model_maintenance_plan +msgid "Maintenance Plan" +msgstr "" + +#. module: maintenance_location +#: model:ir.model,name:maintenance_location.model_maintenance_request +msgid "Maintenance Request" +msgstr "" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__name +msgid "Name" +msgstr "" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__parent_id +msgid "Parent Location" +msgstr "" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__parent_path +msgid "Parent Path" +msgstr "" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__partner_id +msgid "Partner" +msgstr "" + +#. module: maintenance_location +#: model:ir.model.fields,field_description:maintenance_location.field_maintenance_location__sequence +msgid "Sequence" +msgstr "" + +#. module: maintenance_location +#: model_terms:ir.ui.view,arch_db:maintenance_location.maintenance_location_form_view +msgid "e.g. Building A" +msgstr "" diff --git a/maintenance_location/models/__init__.py b/maintenance_location/models/__init__.py new file mode 100644 index 000000000..3b2481dc9 --- /dev/null +++ b/maintenance_location/models/__init__.py @@ -0,0 +1,4 @@ +from . import maintenance_location +from . import maintenance_request +from . import maintenance_equipment +from . import maintenance_plan diff --git a/maintenance_location/models/maintenance_equipment.py b/maintenance_location/models/maintenance_equipment.py new file mode 100644 index 000000000..23ebe87ad --- /dev/null +++ b/maintenance_location/models/maintenance_equipment.py @@ -0,0 +1,19 @@ +# Copyright 2019 Creu Blanca +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class MaintenanceEquipment(models.Model): + _inherit = "maintenance.equipment" + + location_id = fields.Many2one("maintenance.location", tracking=True) + location = fields.Char(string="Location Old") + + def _prepare_request_from_plan(self, maintenance_plan, next_maintenance_date): + res = super()._prepare_request_from_plan( + maintenance_plan, next_maintenance_date + ) + location = maintenance_plan.location_id or self.location_id + res.update({"location_id": location.id}) + return res diff --git a/maintenance_location/models/maintenance_location.py b/maintenance_location/models/maintenance_location.py new file mode 100644 index 000000000..c94da0f18 --- /dev/null +++ b/maintenance_location/models/maintenance_location.py @@ -0,0 +1,52 @@ +# Copyright 2019 Creu Blanca +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import _, api, fields, models +from odoo.exceptions import ValidationError + + +class MaintenanceLocation(models.Model): + _name = "maintenance.location" + _description = "Maintenance Location" + _parent_name = "parent_id" + _parent_store = True + _parent_order = "name" + _rec_name = "complete_name" + _order = "complete_name,id" + + name = fields.Char(required=True) + description = fields.Char() + complete_name = fields.Char( + compute="_compute_complete_name", store=True, recursive=True + ) + + partner_id = fields.Many2one("res.partner") + + parent_id = fields.Many2one( + "maintenance.location", + "Parent Location", + index=True, + ondelete="cascade", + ) + child_id = fields.One2many("maintenance.location", "parent_id", "Child Locations") + parent_path = fields.Char(index=True) + latitude = fields.Float(digits=(16, 5)) + longitude = fields.Float(digits=(16, 5)) + sequence = fields.Integer(default=10) + active = fields.Boolean(default=True) + + @api.depends("name", "parent_id.complete_name") + def _compute_complete_name(self): + for location in self: + if location.parent_id: + location.complete_name = ( + f"{location.parent_id.complete_name} / {location.name}" + ) + else: + location.complete_name = location.name + + @api.constrains("parent_id") + def _check_category_recursion(self): + if self._has_cycle(): + raise ValidationError(_("Error ! You cannot create recursive Locations.")) + return True diff --git a/maintenance_location/models/maintenance_plan.py b/maintenance_location/models/maintenance_plan.py new file mode 100644 index 000000000..e17ac623c --- /dev/null +++ b/maintenance_location/models/maintenance_plan.py @@ -0,0 +1,10 @@ +# Copyright 2020 Creu Blanca +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class MaintenancePlan(models.Model): + _inherit = "maintenance.plan" + + location_id = fields.Many2one("maintenance.location") diff --git a/maintenance_location/models/maintenance_request.py b/maintenance_location/models/maintenance_request.py new file mode 100644 index 000000000..94c1fd8dd --- /dev/null +++ b/maintenance_location/models/maintenance_request.py @@ -0,0 +1,21 @@ +# Copyright 2019 Creu Blanca +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class MaintenanceRequest(models.Model): + _inherit = "maintenance.request" + + location_id = fields.Many2one( + "maintenance.location", + compute="_compute_equipment_id", + store=True, + readonly=False, + ) + + @api.depends("equipment_id") + def _compute_equipment_id(self): + for record in self: + if record.equipment_id and record.equipment_id.location_id: + record.location_id = record.equipment_id.location_id diff --git a/maintenance_location/pyproject.toml b/maintenance_location/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/maintenance_location/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/maintenance_location/readme/CONTRIBUTORS.md b/maintenance_location/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..51646a978 --- /dev/null +++ b/maintenance_location/readme/CONTRIBUTORS.md @@ -0,0 +1,7 @@ +- [Dixmit](https://www.dixmit.com/) + - Enric Tobella +- CreuBlanca + - Kevin Luna + - Jaime Arroyo +- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io) + - Bhavesh Heliconia diff --git a/maintenance_location/readme/DESCRIPTION.md b/maintenance_location/readme/DESCRIPTION.md new file mode 100644 index 000000000..94df9ebf2 --- /dev/null +++ b/maintenance_location/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +Define a location system with hierarchy for maintenance equipments and +requests. diff --git a/maintenance_location/security/ir.model.access.csv b/maintenance_location/security/ir.model.access.csv new file mode 100644 index 000000000..0e7eb053f --- /dev/null +++ b/maintenance_location/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_maintenance_location,access_maintenance_location,model_maintenance_location,base.group_user,1,0,0,0 +access_maintenance_location_maintenance,access_maintenance_location_maintenance,model_maintenance_location,maintenance.group_equipment_manager,1,1,1,1 diff --git a/maintenance_location/static/description/icon.png b/maintenance_location/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/maintenance_location/static/description/icon.png differ diff --git a/maintenance_location/static/description/index.html b/maintenance_location/static/description/index.html new file mode 100644 index 000000000..556f49033 --- /dev/null +++ b/maintenance_location/static/description/index.html @@ -0,0 +1,443 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Maintenance Location

+ +

Beta License: AGPL-3 OCA/maintenance Translate me on Weblate Try me on Runboat

+

Define a location system with hierarchy for maintenance equipments and +requests.

+

Table of contents

+ +
+

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 to smash it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • CreuBlanca
  • +
  • Dixmit
  • +
+
+
+

Contributors

+ +
+
+

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/maintenance project on GitHub.

+

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

+
+
+
+
+ + diff --git a/maintenance_location/tests/__init__.py b/maintenance_location/tests/__init__.py new file mode 100644 index 000000000..e76ac8f83 --- /dev/null +++ b/maintenance_location/tests/__init__.py @@ -0,0 +1 @@ +from . import test_maintenance_location diff --git a/maintenance_location/tests/test_maintenance_location.py b/maintenance_location/tests/test_maintenance_location.py new file mode 100644 index 000000000..4305a5dad --- /dev/null +++ b/maintenance_location/tests/test_maintenance_location.py @@ -0,0 +1,53 @@ +# Copyright 2019 Creu Blanca +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.exceptions import UserError +from odoo.tests.common import TransactionCase + + +class TestMaintenanceLocation(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + self = cls + self.location_1 = self.env["maintenance.location"].create({"name": "L1"}) + self.location_2 = self.env["maintenance.location"].create( + {"name": "L2", "parent_id": self.location_1.id} + ) + self.equipment = self.env["maintenance.equipment"].create( + {"name": "L2", "location_id": self.location_1.id} + ) + self.team = self.env["maintenance.team"].create({"name": "Team"}) + self.request = self.env["maintenance.request"].create( + {"name": "Request", "maintenance_team_id": self.team.id} + ) + + self.equipment = self.env["maintenance.equipment"].create( + {"name": "Laptop", "location_id": self.location_1.id} + ) + + self.plan = self.env["maintenance.plan"].create( + { + "equipment_id": self.equipment.id, + "interval": 1, + "interval_step": "month", + "maintenance_plan_horizon": 2, + "planning_step": "month", + "maintenance_team_id": self.team.id, + "location_id": self.location_1.id, + } + ) + + def test_maintenance_location(self): + self.assertEqual(self.location_2.complete_name, "L1 / L2") + with self.assertRaises(UserError): + self.location_1.write({"parent_id": self.location_2.id}) + + self.request.write({"equipment_id": self.equipment.id}) + self.assertEqual(self.request.location_id.id, self.location_1.id) + + def test_request_creation(self): + request = self.equipment._create_new_request(self.plan) + self.assertTrue(request) + for r in request: + self.assertEqual(r.location_id.id, self.location_1.id) diff --git a/maintenance_location/views/maintenance_equipment.xml b/maintenance_location/views/maintenance_equipment.xml new file mode 100644 index 000000000..2f987470d --- /dev/null +++ b/maintenance_location/views/maintenance_equipment.xml @@ -0,0 +1,59 @@ + + + + + maintenance.equipment.form@maintenance_location + maintenance.equipment + + + + 1 + + + + + + + + + + + maintenance.equipment.search@maintenance_location + maintenance.equipment + + + + + + + + + maintenance.equipment.tree@maintenance_location + maintenance.equipment + + + + + + + + + maintenance.equipment.kanban@maintenance_location + maintenance.equipment + + +
+
+ + + &nbsp; + +
+
+
+
+
diff --git a/maintenance_location/views/maintenance_location.xml b/maintenance_location/views/maintenance_location.xml new file mode 100644 index 000000000..135268954 --- /dev/null +++ b/maintenance_location/views/maintenance_location.xml @@ -0,0 +1,61 @@ + + + + + maintenance.location.form@maintenance_location + maintenance.location + +
+ +
+
+ + + + +
+
+
+
+ + maintenance.location.search@maintenance_location + maintenance.location + + + + + + + + maintenance.location.tree@maintenance_location + maintenance.location + + + + + + + + Maintenance Location + maintenance.location + list,form + [] + {} + + + Maintenance Locations + + + + +
diff --git a/maintenance_location/views/maintenance_plan.xml b/maintenance_location/views/maintenance_plan.xml new file mode 100644 index 000000000..f95d2e699 --- /dev/null +++ b/maintenance_location/views/maintenance_plan.xml @@ -0,0 +1,35 @@ + + + + + maintenance.plan.form@maintenance_location + maintenance.plan + + + + + + + + + maintenance.plan.search@maintenance_location + maintenance.plan + + + + + + + + + maintenance.plan.tree@maintenance_location + maintenance.plan + + + + + + + + diff --git a/maintenance_location/views/maintenance_request.xml b/maintenance_location/views/maintenance_request.xml new file mode 100644 index 000000000..1ded7ce50 --- /dev/null +++ b/maintenance_location/views/maintenance_request.xml @@ -0,0 +1,51 @@ + + + + + maintenance.request.form@maintenance_location + maintenance.request + + + + + + + + + maintenance.request.search@maintenance_location + maintenance.request + + + + + + + + + maintenance.request.tree@maintenance_location + maintenance.request + + + + + + + + + maintenance.request.kanban@maintenance_location + maintenance.request + + + + Location:
+
+
+
+
diff --git a/maintenance_location/views/report_maintenance_request.xml b/maintenance_location/views/report_maintenance_request.xml new file mode 100644 index 000000000..00eec4787 --- /dev/null +++ b/maintenance_location/views/report_maintenance_request.xml @@ -0,0 +1,16 @@ + + + +