diff --git a/fieldservice_repair/README.rst b/fieldservice_repair/README.rst new file mode 100644 index 0000000000..01337a3e8b --- /dev/null +++ b/fieldservice_repair/README.rst @@ -0,0 +1,137 @@ +====================== +Field Service - Repair +====================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:692af8a88cb4633c9631427d1a71712996d94205f998f540d5eb1221ebbc1a95 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/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%2Ffield--service-lightgray.png?logo=github + :target: https://github.com/OCA/field-service/tree/17.0/fieldservice_repair + :alt: OCA/field-service +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/field-service-17-0/field-service-17-0-fieldservice_repair + :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/field-service&target_branch=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Odoo Repair App does not support Field Service operations for products +outside the company facilities. On the other hand, the Field Service App +does not support part management (add, update, remove) of an equipment. + +This module allows you to repair FSM equipments and manage their parts: +add, update/replace, remove. + +**Table of contents** + +.. contents:: + :local: + +Installation +============ + +To install Field Service and have the mapping features, you need to +install fieldservice_stock and mrp_repair + +Please refer to the installation instructions available at: +https://github.com/OCA/field-service/tree/12.0/fieldservice_stock + +Configuration +============= + +To configure this module, you need to: + +- Go to Field Service > Master Data > Equipments +- Set the product and serial number on each of your equipments + +Usage +===== + +To use this module, you need to: + +- Go to Field Service +- Create a FSM order +- Choose the type: Repair +- Select the equipment +- Upon saving, a repair order is created and linked to the FSM order + +Known issues / Roadmap +====================== + +The roadmap of the Field Service application is documented on +`Github `__. + +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 +------- + +* Open Source Integrators + +Contributors +------------ + +- Sandip Mangukiya +- Serpent Consulting Services Pvt. Ltd. +- Marcel Savegnago - Escodoo +- Freni Patel +- Italo LOPES + +Other credits +------------- + +The development of this module has been financially supported by: + +- Open Source Integrators + +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. + +.. |maintainer-smangukiya| image:: https://github.com/smangukiya.png?size=40px + :target: https://github.com/smangukiya + :alt: smangukiya +.. |maintainer-max3903| image:: https://github.com/max3903.png?size=40px + :target: https://github.com/max3903 + :alt: max3903 + +Current `maintainers `__: + +|maintainer-smangukiya| |maintainer-max3903| + +This module is part of the `OCA/field-service `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/fieldservice_repair/__init__.py b/fieldservice_repair/__init__.py new file mode 100644 index 0000000000..1ae95437af --- /dev/null +++ b/fieldservice_repair/__init__.py @@ -0,0 +1,4 @@ +# Copyright (C) 2021 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models diff --git a/fieldservice_repair/__manifest__.py b/fieldservice_repair/__manifest__.py new file mode 100644 index 0000000000..ba195551b7 --- /dev/null +++ b/fieldservice_repair/__manifest__.py @@ -0,0 +1,23 @@ +# Copyright (C) 2021 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Field Service - Repair", + "summary": "Integrate Field Service orders with MRP repair orders", + "version": "17.0.1.0.0", + "category": "Field Service", + "author": "Open Source Integrators, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/field-service", + "depends": [ + "repair", + "fieldservice_equipment_stock", + ], + "data": ["data/fsm_order_type.xml", "views/fsm_order_view.xml"], + "license": "AGPL-3", + "development_status": "Beta", + "maintainers": [ + "smangukiya", + "max3903", + ], + "installable": True, +} diff --git a/fieldservice_repair/data/fsm_order_type.xml b/fieldservice_repair/data/fsm_order_type.xml new file mode 100644 index 0000000000..e9c07bcee5 --- /dev/null +++ b/fieldservice_repair/data/fsm_order_type.xml @@ -0,0 +1,9 @@ + + + + + Repair + repair + + + diff --git a/fieldservice_repair/i18n/de.po b/fieldservice_repair/i18n/de.po new file mode 100644 index 0000000000..c5da298aa2 --- /dev/null +++ b/fieldservice_repair/i18n/de.po @@ -0,0 +1,53 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_repair +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2022-12-03 15:45+0000\n" +"Last-Translator: Nils Coenen | NICO SOLUTIONS - ENGINEERING & IT \n" +"Language-Team: none\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.14.1\n" + +#. module: fieldservice_repair +#: code:addons/fieldservice_repair/models/fsm_order.py:0 +#, python-format +msgid "" +"Cannot create Repair Order because Equipment does not have a Current " +"Inventory Location." +msgstr "" +"Reparaturauftrag kann nicht erstellt werden, da die Ausrüstung keinen " +"aktuellen Bestandsstandort hat." + +#. module: fieldservice_repair +#: model:ir.model,name:fieldservice_repair.model_fsm_order +msgid "Field Service Order" +msgstr "Field-Service-Auftrag" + +#. module: fieldservice_repair +#: model:ir.model,name:fieldservice_repair.model_fsm_order_type +msgid "Field Service Order Type" +msgstr "Field Service Auftragstyp" + +#. module: fieldservice_repair +#: model:ir.model.fields,field_description:fieldservice_repair.field_fsm_order_type__internal_type +msgid "Internal Type" +msgstr "Interner Typ" + +#. module: fieldservice_repair +#: model:ir.model.fields.selection,name:fieldservice_repair.selection__fsm_order_type__internal_type__repair +msgid "Repair" +msgstr "Reparatur" + +#. module: fieldservice_repair +#: model:ir.model.fields,field_description:fieldservice_repair.field_fsm_order__repair_id +msgid "Repair Order" +msgstr "Reparaturauftrag" diff --git a/fieldservice_repair/i18n/es.po b/fieldservice_repair/i18n/es.po new file mode 100644 index 0000000000..864b068966 --- /dev/null +++ b/fieldservice_repair/i18n/es.po @@ -0,0 +1,52 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_repair +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-10-09 07:47+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: none\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: fieldservice_repair +#: code:addons/fieldservice_repair/models/fsm_order.py:0 +#, python-format +msgid "" +"Cannot create Repair Order because Equipment does not have a Current " +"Inventory Location." +msgstr "" +"No se puede crear una Orden de Reparación porque el equipo no tiene una " +"Ubicación de Inventario Actual." + +#. module: fieldservice_repair +#: model:ir.model,name:fieldservice_repair.model_fsm_order +msgid "Field Service Order" +msgstr "Orden de Servicio de Campo" + +#. module: fieldservice_repair +#: model:ir.model,name:fieldservice_repair.model_fsm_order_type +msgid "Field Service Order Type" +msgstr "Tipo de orden de servicio de campo" + +#. module: fieldservice_repair +#: model:ir.model.fields,field_description:fieldservice_repair.field_fsm_order_type__internal_type +msgid "Internal Type" +msgstr "Tipo interno" + +#. module: fieldservice_repair +#: model:ir.model.fields.selection,name:fieldservice_repair.selection__fsm_order_type__internal_type__repair +msgid "Repair" +msgstr "Reparar" + +#. module: fieldservice_repair +#: model:ir.model.fields,field_description:fieldservice_repair.field_fsm_order__repair_id +msgid "Repair Order" +msgstr "Orden de Reparación" diff --git a/fieldservice_repair/i18n/es_AR.po b/fieldservice_repair/i18n/es_AR.po new file mode 100644 index 0000000000..38d00eba59 --- /dev/null +++ b/fieldservice_repair/i18n/es_AR.po @@ -0,0 +1,64 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_repair +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-10-03 21:34+0000\n" +"Last-Translator: Ignacio Buioli \n" +"Language-Team: none\n" +"Language: es_AR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: fieldservice_repair +#: code:addons/fieldservice_repair/models/fsm_order.py:0 +#, python-format +msgid "" +"Cannot create Repair Order because Equipment does not have a Current " +"Inventory Location." +msgstr "" +"No se puede crear un Pedido de rReparación porque el equipo no tiene una " +"Ubicación de Inventario Actual." + +#. module: fieldservice_repair +#: model:ir.model,name:fieldservice_repair.model_fsm_order +msgid "Field Service Order" +msgstr "Pedido de Servicio de Campo" + +#. module: fieldservice_repair +#: model:ir.model,name:fieldservice_repair.model_fsm_order_type +msgid "Field Service Order Type" +msgstr "Tipo de Pedido de Servicio de Campo" + +#. module: fieldservice_repair +#: model:ir.model.fields,field_description:fieldservice_repair.field_fsm_order_type__internal_type +msgid "Internal Type" +msgstr "Tipo Interno" + +#. module: fieldservice_repair +#: model:ir.model.fields.selection,name:fieldservice_repair.selection__fsm_order_type__internal_type__repair +msgid "Repair" +msgstr "Reparar" + +#. module: fieldservice_repair +#: model:ir.model.fields,field_description:fieldservice_repair.field_fsm_order__repair_id +msgid "Repair Order" +msgstr "Pedido de Reparación" + +#~ msgid "Display Name" +#~ msgstr "Mostrar Nombre" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Última Modificación el" + +#~ msgid "Order" +#~ msgstr "Pedido" diff --git a/fieldservice_repair/i18n/fieldservice_repair.pot b/fieldservice_repair/i18n/fieldservice_repair.pot new file mode 100644 index 0000000000..1f0b5075d5 --- /dev/null +++ b/fieldservice_repair/i18n/fieldservice_repair.pot @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_repair +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \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: fieldservice_repair +#: code:addons/fieldservice_repair/models/fsm_order.py:0 +#, python-format +msgid "" +"Cannot create Repair Order because Equipment does not have a Current " +"Inventory Location." +msgstr "" + +#. module: fieldservice_repair +#: model:ir.model,name:fieldservice_repair.model_fsm_order +msgid "Field Service Order" +msgstr "" + +#. module: fieldservice_repair +#: model:ir.model,name:fieldservice_repair.model_fsm_order_type +msgid "Field Service Order Type" +msgstr "" + +#. module: fieldservice_repair +#: model:ir.model.fields,field_description:fieldservice_repair.field_fsm_order_type__internal_type +msgid "Internal Type" +msgstr "" + +#. module: fieldservice_repair +#: model:ir.model.fields.selection,name:fieldservice_repair.selection__fsm_order_type__internal_type__repair +msgid "Repair" +msgstr "" + +#. module: fieldservice_repair +#: model:ir.model.fields,field_description:fieldservice_repair.field_fsm_order__repair_id +msgid "Repair Order" +msgstr "" diff --git a/fieldservice_repair/i18n/it.po b/fieldservice_repair/i18n/it.po new file mode 100644 index 0000000000..6c0e5edca9 --- /dev/null +++ b/fieldservice_repair/i18n/it.po @@ -0,0 +1,64 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_repair +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-04-03 12:40+0000\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: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: fieldservice_repair +#: code:addons/fieldservice_repair/models/fsm_order.py:0 +#, python-format +msgid "" +"Cannot create Repair Order because Equipment does not have a Current " +"Inventory Location." +msgstr "" +"Impossibile creare un ordine di riparazione perché l'attrezzatura non ha una " +"posizione di inventario attuale." + +#. module: fieldservice_repair +#: model:ir.model,name:fieldservice_repair.model_fsm_order +msgid "Field Service Order" +msgstr "Ordine assistenza sul campo" + +#. module: fieldservice_repair +#: model:ir.model,name:fieldservice_repair.model_fsm_order_type +msgid "Field Service Order Type" +msgstr "Tipo ordine assistenza sul campo" + +#. module: fieldservice_repair +#: model:ir.model.fields,field_description:fieldservice_repair.field_fsm_order_type__internal_type +msgid "Internal Type" +msgstr "Tipo interno" + +#. module: fieldservice_repair +#: model:ir.model.fields.selection,name:fieldservice_repair.selection__fsm_order_type__internal_type__repair +msgid "Repair" +msgstr "Riparazione" + +#. module: fieldservice_repair +#: model:ir.model.fields,field_description:fieldservice_repair.field_fsm_order__repair_id +msgid "Repair Order" +msgstr "Ordine di riparazione" + +#~ msgid "Display Name" +#~ msgstr "Nome visualizzato" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Ultima modifica il" + +#~ msgid "Order" +#~ msgstr "Ordine" diff --git a/fieldservice_repair/i18n/pt_BR.po b/fieldservice_repair/i18n/pt_BR.po new file mode 100644 index 0000000000..28f03122de --- /dev/null +++ b/fieldservice_repair/i18n/pt_BR.po @@ -0,0 +1,58 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_repair +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-12-08 22:39+0000\n" +"Last-Translator: marcos-mendez \n" +"Language-Team: none\n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: fieldservice_repair +#: code:addons/fieldservice_repair/models/fsm_order.py:0 +#, python-format +msgid "" +"Cannot create Repair Order because Equipment does not have a Current " +"Inventory Location." +msgstr "" +"Não é possível criar Ordem de Reparo pois o equipamento não possuí " +"Localização de Inventário padrão." + +#. module: fieldservice_repair +#: model:ir.model,name:fieldservice_repair.model_fsm_order +msgid "Field Service Order" +msgstr "Ordem de Serviço de Campo" + +#. module: fieldservice_repair +#: model:ir.model,name:fieldservice_repair.model_fsm_order_type +msgid "Field Service Order Type" +msgstr "Tipo de Ordem de Serviço de Campo" + +#. module: fieldservice_repair +#: model:ir.model.fields,field_description:fieldservice_repair.field_fsm_order_type__internal_type +msgid "Internal Type" +msgstr "Tipo Interno" + +#. module: fieldservice_repair +#: model:ir.model.fields.selection,name:fieldservice_repair.selection__fsm_order_type__internal_type__repair +msgid "Repair" +msgstr "Reparo" + +#. module: fieldservice_repair +#: model:ir.model.fields,field_description:fieldservice_repair.field_fsm_order__repair_id +msgid "Repair Order" +msgstr "Ordem de Reparo" + +#~ msgid "FSM" +#~ msgstr "FSM" + +#~ msgid "Maintenance" +#~ msgstr "Manutenção" diff --git a/fieldservice_repair/models/__init__.py b/fieldservice_repair/models/__init__.py new file mode 100644 index 0000000000..b31331ab41 --- /dev/null +++ b/fieldservice_repair/models/__init__.py @@ -0,0 +1,5 @@ +# Copyright (C) 2021 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import fsm_order +from . import fsm_order_type diff --git a/fieldservice_repair/models/fsm_order.py b/fieldservice_repair/models/fsm_order.py new file mode 100644 index 0000000000..e9dc545321 --- /dev/null +++ b/fieldservice_repair/models/fsm_order.py @@ -0,0 +1,46 @@ +# Copyright (C) 2021 - TODAY, 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 FSMOrder(models.Model): + _inherit = "fsm.order" + + repair_id = fields.Many2one("repair.order", string="Repair Order") + + @api.model + def create(self, vals): + # if FSM order with type repair is created then + # create a repair order + order = super().create(vals) + if order.type.internal_type == "repair": + if order.equipment_id and order.equipment_id.current_stock_location_id: + equipment = order.equipment_id + repair_id = self.env["repair.order"].create( + { + "name": order.name or "", + "product_id": equipment.product_id.id or False, + "product_uom": equipment.product_id.uom_id.id or False, + "location_id": equipment.current_stock_location_id + and equipment.current_stock_location_id.id + or False, + "lot_id": equipment.lot_id.id or "", + "product_qty": 1, + "internal_notes": order.description, + "partner_id": order.location_id.partner_id + and order.location_id.partner_id.id + or False, + } + ) + order.repair_id = repair_id + elif not order.equipment_id.current_stock_location_id: + raise ValidationError( + _( + "Cannot create Repair Order because " + "Equipment does not have a Current " + "Inventory Location." + ) + ) + return order diff --git a/fieldservice_repair/models/fsm_order_type.py b/fieldservice_repair/models/fsm_order_type.py new file mode 100644 index 0000000000..5190ab5dc1 --- /dev/null +++ b/fieldservice_repair/models/fsm_order_type.py @@ -0,0 +1,12 @@ +# Copyright 2021 - TODAY, Marcel Savegnago - Escodoo +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class FsmOrderType(models.Model): + _inherit = "fsm.order.type" + + internal_type = fields.Selection( + selection_add=[("repair", "Repair")], + ) diff --git a/fieldservice_repair/pyproject.toml b/fieldservice_repair/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/fieldservice_repair/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/fieldservice_repair/readme/CONFIGURE.md b/fieldservice_repair/readme/CONFIGURE.md new file mode 100644 index 0000000000..53cb128d05 --- /dev/null +++ b/fieldservice_repair/readme/CONFIGURE.md @@ -0,0 +1,4 @@ +To configure this module, you need to: + +- Go to Field Service \> Master Data \> Equipments +- Set the product and serial number on each of your equipments diff --git a/fieldservice_repair/readme/CONTRIBUTORS.md b/fieldservice_repair/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..70cb920455 --- /dev/null +++ b/fieldservice_repair/readme/CONTRIBUTORS.md @@ -0,0 +1,5 @@ +- Sandip Mangukiya \<\> +- Serpent Consulting Services Pvt. Ltd. \<\> +- Marcel Savegnago - Escodoo \<\> +- Freni Patel \<\> +- Italo LOPES \<\> diff --git a/fieldservice_repair/readme/CREDITS.md b/fieldservice_repair/readme/CREDITS.md new file mode 100644 index 0000000000..7e4827b0a8 --- /dev/null +++ b/fieldservice_repair/readme/CREDITS.md @@ -0,0 +1,3 @@ +The development of this module has been financially supported by: + +- Open Source Integrators \<\> diff --git a/fieldservice_repair/readme/DESCRIPTION.md b/fieldservice_repair/readme/DESCRIPTION.md new file mode 100644 index 0000000000..1ceb94a37a --- /dev/null +++ b/fieldservice_repair/readme/DESCRIPTION.md @@ -0,0 +1,6 @@ +Odoo Repair App does not support Field Service operations for products +outside the company facilities. On the other hand, the Field Service App +does not support part management (add, update, remove) of an equipment. + +This module allows you to repair FSM equipments and manage their parts: +add, update/replace, remove. diff --git a/fieldservice_repair/readme/INSTALL.md b/fieldservice_repair/readme/INSTALL.md new file mode 100644 index 0000000000..8e42dd8edb --- /dev/null +++ b/fieldservice_repair/readme/INSTALL.md @@ -0,0 +1,5 @@ +To install Field Service and have the mapping features, you need to +install fieldservice_stock and mrp_repair + +Please refer to the installation instructions available at: + diff --git a/fieldservice_repair/readme/ROADMAP.md b/fieldservice_repair/readme/ROADMAP.md new file mode 100644 index 0000000000..6cdbdd69cb --- /dev/null +++ b/fieldservice_repair/readme/ROADMAP.md @@ -0,0 +1,2 @@ +The roadmap of the Field Service application is documented on +[Github](https://github.com/OCA/field-service/issues). diff --git a/fieldservice_repair/readme/USAGE.md b/fieldservice_repair/readme/USAGE.md new file mode 100644 index 0000000000..e0f4906957 --- /dev/null +++ b/fieldservice_repair/readme/USAGE.md @@ -0,0 +1,7 @@ +To use this module, you need to: + +- Go to Field Service +- Create a FSM order +- Choose the type: Repair +- Select the equipment +- Upon saving, a repair order is created and linked to the FSM order diff --git a/fieldservice_repair/static/description/icon.png b/fieldservice_repair/static/description/icon.png new file mode 100644 index 0000000000..955674d8f0 Binary files /dev/null and b/fieldservice_repair/static/description/icon.png differ diff --git a/fieldservice_repair/static/description/index.html b/fieldservice_repair/static/description/index.html new file mode 100644 index 0000000000..a2683fd7fe --- /dev/null +++ b/fieldservice_repair/static/description/index.html @@ -0,0 +1,473 @@ + + + + + +Field Service - Repair + + + +
+

Field Service - Repair

+ + +

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

+

Odoo Repair App does not support Field Service operations for products +outside the company facilities. On the other hand, the Field Service App +does not support part management (add, update, remove) of an equipment.

+

This module allows you to repair FSM equipments and manage their parts: +add, update/replace, remove.

+

Table of contents

+ +
+

Installation

+

To install Field Service and have the mapping features, you need to +install fieldservice_stock and mrp_repair

+

Please refer to the installation instructions available at: +https://github.com/OCA/field-service/tree/12.0/fieldservice_stock

+
+
+

Configuration

+

To configure this module, you need to:

+
    +
  • Go to Field Service > Master Data > Equipments
  • +
  • Set the product and serial number on each of your equipments
  • +
+
+
+

Usage

+

To use this module, you need to:

+
    +
  • Go to Field Service
  • +
  • Create a FSM order
  • +
  • Choose the type: Repair
  • +
  • Select the equipment
  • +
  • Upon saving, a repair order is created and linked to the FSM order
  • +
+
+
+

Known issues / Roadmap

+

The roadmap of the Field Service application is documented on +Github.

+
+
+

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

+
    +
  • Open Source Integrators
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The development of this module has been financially supported by:

+ +
+
+

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.

+

Current maintainers:

+

smangukiya max3903

+

This module is part of the OCA/field-service project on GitHub.

+

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

+
+
+
+ + diff --git a/fieldservice_repair/tests/__init__.py b/fieldservice_repair/tests/__init__.py new file mode 100644 index 0000000000..7d0e7609c4 --- /dev/null +++ b/fieldservice_repair/tests/__init__.py @@ -0,0 +1,6 @@ +# Copyright (C) 2020, Brian McMaster +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) + +from . import test_fsm_repair + +# from . import test_fsm_wizard diff --git a/fieldservice_repair/tests/test_fsm_repair.py b/fieldservice_repair/tests/test_fsm_repair.py new file mode 100644 index 0000000000..a77e4967bb --- /dev/null +++ b/fieldservice_repair/tests/test_fsm_repair.py @@ -0,0 +1,64 @@ +# Copyright (C) 2021 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) + +from datetime import timedelta + +from odoo import fields +from odoo.exceptions import ValidationError +from odoo.tests.common import TransactionCase + + +class TestFSMRepairCommon(TransactionCase): + def setUp(self): + super().setUp() + self.test_location = self.env.ref("fieldservice.test_location") + self.stock_location = self.env.ref("stock.stock_location_customers") + self.FSMOrder = self.env["fsm.order"] + self.OrderType = self.env["fsm.order.type"].create( + {"name": "Test1", "internal_type": "repair"} + ) + self.product1 = self.env["product.product"].create( + {"name": "Product A", "type": "product"} + ) + self.lot1 = self.env["stock.lot"].create( + { + "name": "sn11", + "product_id": self.product1.id, + "company_id": self.env.company.id, + } + ) + self.equipment = self.env["fsm.equipment"].create( + { + "name": "test equipment", + "product_id": self.product1.id, + "lot_id": self.lot1.id, + } + ) + + def test_fsm_orders(self): + """Test creating new workorders, and test following functions.""" + # Create an Orders + hours_diff = 100 + date_start = fields.Datetime.today() + with self.assertRaises(ValidationError): + self.FSMOrder.create( + { + "type": self.OrderType.id, + "location_id": self.test_location.id, + "equipment_id": self.equipment.id, + "date_start": date_start, + "date_end": date_start + timedelta(hours=hours_diff), + "request_early": fields.Datetime.today(), + } + ) + self.equipment.current_stock_location_id = self.stock_location.id + self.FSMOrder.create( + { + "type": self.OrderType.id, + "location_id": self.test_location.id, + "equipment_id": self.equipment.id, + "date_start": date_start, + "date_end": date_start + timedelta(hours=hours_diff), + "request_early": fields.Datetime.today(), + } + ) diff --git a/fieldservice_repair/views/fsm_order_view.xml b/fieldservice_repair/views/fsm_order_view.xml new file mode 100644 index 0000000000..70e57b5db6 --- /dev/null +++ b/fieldservice_repair/views/fsm_order_view.xml @@ -0,0 +1,22 @@ + + + + + + fsm.order.maintenance.form + fsm.order + + + + + + + + + + +