diff --git a/fieldservice_isp_flow/README.rst b/fieldservice_isp_flow/README.rst new file mode 100644 index 0000000000..06ad93fb2c --- /dev/null +++ b/fieldservice_isp_flow/README.rst @@ -0,0 +1,131 @@ +============================ +Field Service - Flow for ISP +============================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:87d6af242f0d9da1c2151a3fb34b7d5f1cf404ceee118084b1191ce1284472c9 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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_isp_flow + :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_isp_flow + :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| + +This module is an add-on for the Field Service application in Odoo. It +provides default stages for orders and some validation logic when +changing current stage. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +The stage of an order is used to monitor its progress. Stages can be +configured based on your company's specific business needs. A basic set +of order stages comes pre-configured for use. + +1. Go to *Field Service > Configuration > Stages* +2. Create or edit a stage +3. Set the name for the stage. +4. Set the sequence order for the stage. +5. Select *Order* type to apply this stage to your orders. +6. Additonally, you can set a color for the stage. + +Usage +===== + +To use this module, you need to: + +- Create a new service order +- Under the Inventory tab, select the warehouse, the delivery method + and add products with quantity +- Confirm the order to create the delivery orders with the selected + method + +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 +* Akretion + +Contributors +------------ + +- Maxime Chambreuil +- Serpent Consulting Services Pvt. Ltd. +- Raphaël Reverdy +- Freni Patel +- [APSL](https://apsl.tech): + + - Antoni Marroig + +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-osi-scampbell| image:: https://github.com/osi-scampbell.png?size=40px + :target: https://github.com/osi-scampbell + :alt: osi-scampbell + +Current `maintainer `__: + +|maintainer-osi-scampbell| + +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_isp_flow/__init__.py b/fieldservice_isp_flow/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/fieldservice_isp_flow/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/fieldservice_isp_flow/__manifest__.py b/fieldservice_isp_flow/__manifest__.py new file mode 100644 index 0000000000..34e6d238e3 --- /dev/null +++ b/fieldservice_isp_flow/__manifest__.py @@ -0,0 +1,22 @@ +# Copyright (C) 2021 - Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Field Service - Flow for ISP", + "summary": "Field Service workflow for Internet Service Providers", + "version": "17.0.1.0.0", + "category": "Field Service", + "author": "Open Source Integrators, " "Akretion, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/field-service", + "depends": [ + "fieldservice", + ], + "data": [ + "data/fsm_stage.xml", + "views/fsm_order.xml", + ], + "application": False, + "license": "AGPL-3", + "development_status": "Beta", + "maintainers": ["osi-scampbell"], +} diff --git a/fieldservice_isp_flow/data/fsm_stage.xml b/fieldservice_isp_flow/data/fsm_stage.xml new file mode 100644 index 0000000000..25e17db8f8 --- /dev/null +++ b/fieldservice_isp_flow/data/fsm_stage.xml @@ -0,0 +1,51 @@ + + + + Confirmed + 20 + order + True + #F1C40F + + + + Requested + 30 + order + True + #F39C12 + + + + Assigned + 40 + order + True + #16A085 + + + + Scheduled + 50 + order + True + #9B59B6 + + + + En Route + 60 + order + True + #C0392B + + + + Started + 70 + order + True + #95A5A6 + + + diff --git a/fieldservice_isp_flow/i18n/de.po b/fieldservice_isp_flow/i18n/de.po new file mode 100644 index 0000000000..3079938c44 --- /dev/null +++ b/fieldservice_isp_flow/i18n/de.po @@ -0,0 +1,119 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_isp_flow +# +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_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Assign" +msgstr "Zuweisen" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Assigned until 'Assigned To' is filled in" +msgstr "" +"Kann nicht in Zugewiesen bewegt werden, solange 'Zugewiesen an' nicht " +"ausgefüllt ist" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Complete until 'Actual End' is filled in" +msgstr "" +"Kann nicht in Abgeschlossen bewegt werden, solange bis 'Tatsächliches Ende' " +"ausgefüllt ist" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Complete until 'Resolution' is filled in" +msgstr "" +"Kann nicht in Abgeschlossen bewegt werden, solange 'Auflösung' nicht " +"ausgefüllt ist" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Requested until 'Request Workers' is filled in" +msgstr "" +"Kann nicht in Angefordert bewegt werden, solange 'Arbeiter anfordern' nicht " +"ausgefüllt ist" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "" +"Cannot move to Scheduled until both 'Assigned To' and 'Scheduled Start Date' " +"are filled in" +msgstr "" +"Kann nicht in Geplant bewegt werden, solange 'Zugewiesen an' als auch " +"'Geplantes Startdatum' nicht ausgefüllt sind" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Start until 'Actual Start' is filled in" +msgstr "" +"Kann nicht in Start bewegt werden, solange 'Tatsächlicher Start' nicht " +"ausgefüllt ist" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Confirm" +msgstr "Bestätigen" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "En Route" +msgstr "Unterwegs" + +#. module: fieldservice_isp_flow +#: model:ir.model,name:fieldservice_isp_flow.model_fsm_order +msgid "Field Service Order" +msgstr "Field-Service-Auftrag" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_search_view +msgid "Orders" +msgstr "Aufträge" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_search_view +msgid "Past Due Orders" +msgstr "Überfällige Aufträge" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Request" +msgstr "Anfrage" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Schedule" +msgstr "Planen" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Start" +msgstr "" diff --git a/fieldservice_isp_flow/i18n/es.po b/fieldservice_isp_flow/i18n/es.po new file mode 100644 index 0000000000..9c613464a3 --- /dev/null +++ b/fieldservice_isp_flow/i18n/es.po @@ -0,0 +1,109 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_isp_flow +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-11-22 04:35+0000\n" +"Last-Translator: Nelson Ramírez Sánchez \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 3.8\n" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Assign" +msgstr "Asignar" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Assigned until 'Assigned To' is filled in" +msgstr "No se puede mover a Asignado hasta que se complete 'Asignado a'" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Complete until 'Actual End' is filled in" +msgstr "No se puede mover a Completado hasta que se complete 'Fin Real'" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Complete until 'Resolution' is filled in" +msgstr "No se puede mover a Completo hasta que se complete 'Resolución'" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Requested until 'Request Workers' is filled in" +msgstr "" +"No se puede pasar a Solicitado hasta que se complete 'Solicitar trabajadores'" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "" +"Cannot move to Scheduled until both 'Assigned To' and 'Scheduled Start Date' " +"are filled in" +msgstr "" +"No se puede mover a Programado hasta que se completen tanto 'Asignado a' " +"como 'Fecha de inicio programada'" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Start until 'Actual Start' is filled in" +msgstr "No se puede mover a Inicio hasta que se complete 'Inicio Real'" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Confirm" +msgstr "Confirmar" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "En Route" +msgstr "En Ruta" + +#. module: fieldservice_isp_flow +#: model:ir.model,name:fieldservice_isp_flow.model_fsm_order +msgid "Field Service Order" +msgstr "Orden de Servicio de Campo" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_search_view +msgid "Orders" +msgstr "Ordenes" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_search_view +msgid "Past Due Orders" +msgstr "Órdenes Vencidas" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Request" +msgstr "Solicitud" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Schedule" +msgstr "Calendario" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Start" +msgstr "Iniciar" diff --git a/fieldservice_isp_flow/i18n/es_AR.po b/fieldservice_isp_flow/i18n/es_AR.po new file mode 100644 index 0000000000..f1b37d8d2a --- /dev/null +++ b/fieldservice_isp_flow/i18n/es_AR.po @@ -0,0 +1,118 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_isp_flow +# +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_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Assign" +msgstr "Asignar" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Assigned until 'Assigned To' is filled in" +msgstr "No se puede mover a Asignado hasta que se complete 'Asignado a'" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Complete until 'Actual End' is filled in" +msgstr "No se puede mover a Completo hasta que se complete 'Final Real'" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Complete until 'Resolution' is filled in" +msgstr "No se puede mover a Completo hasta que se complete 'Resolución'" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Requested until 'Request Workers' is filled in" +msgstr "" +"No se puede mover a Solicitado hasta que se complete 'Solicitar trabajadores'" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "" +"Cannot move to Scheduled until both 'Assigned To' and 'Scheduled Start Date' " +"are filled in" +msgstr "" +"No se puede mover a Programado hasta que se completen tanto 'Asignado a' " +"como 'Fecha de Inicio Programada'" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Start until 'Actual Start' is filled in" +msgstr "No se puede mover a Inicio hasta que se complete 'Inicio Real'" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Confirm" +msgstr "Confirmar" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "En Route" +msgstr "En Camino" + +#. module: fieldservice_isp_flow +#: model:ir.model,name:fieldservice_isp_flow.model_fsm_order +msgid "Field Service Order" +msgstr "Pedido de Servicio de Campo" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_search_view +msgid "Orders" +msgstr "Pedidos" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_search_view +msgid "Past Due Orders" +msgstr "Pedidos Vencidos" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Request" +msgstr "Solicitud" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Schedule" +msgstr "Programar" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Start" +msgstr "Inicio" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Última Modificación el" + +#~ msgid "Order" +#~ msgstr "Pedido" diff --git a/fieldservice_isp_flow/i18n/es_CL.po b/fieldservice_isp_flow/i18n/es_CL.po new file mode 100644 index 0000000000..4341ff6409 --- /dev/null +++ b/fieldservice_isp_flow/i18n/es_CL.po @@ -0,0 +1,109 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_isp_flow +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-11-22 04:35+0000\n" +"Last-Translator: Nelson Ramírez Sánchez \n" +"Language-Team: none\n" +"Language: es_CL\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 3.8\n" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Assign" +msgstr "Asignar" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Assigned until 'Assigned To' is filled in" +msgstr "No se puede mover a Asignado hasta que se complete 'Asignado a'" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Complete until 'Actual End' is filled in" +msgstr "No se puede mover a Completado hasta que se complete 'Fin Real'" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Complete until 'Resolution' is filled in" +msgstr "No se puede mover a Completo hasta que se complete 'Resolución'" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Requested until 'Request Workers' is filled in" +msgstr "" +"No se puede pasar a Solicitado hasta que se complete 'Solicitar trabajadores'" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "" +"Cannot move to Scheduled until both 'Assigned To' and 'Scheduled Start Date' " +"are filled in" +msgstr "" +"No se puede mover a Programado hasta que se completen tanto 'Asignado a' " +"como 'Fecha de inicio programada'" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Start until 'Actual Start' is filled in" +msgstr "No se puede mover a Inicio hasta que se complete 'Inicio Real'" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Confirm" +msgstr "Confirmar" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "En Route" +msgstr "En Ruta" + +#. module: fieldservice_isp_flow +#: model:ir.model,name:fieldservice_isp_flow.model_fsm_order +msgid "Field Service Order" +msgstr "Orden de Servicio de Campo" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_search_view +msgid "Orders" +msgstr "Ordenes" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_search_view +msgid "Past Due Orders" +msgstr "Órdenes Vencidas" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Request" +msgstr "Solicitud" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Schedule" +msgstr "Calendario" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Start" +msgstr "Iniciar" diff --git a/fieldservice_isp_flow/i18n/fieldservice_isp_flow.pot b/fieldservice_isp_flow/i18n/fieldservice_isp_flow.pot new file mode 100644 index 0000000000..520c1ab94f --- /dev/null +++ b/fieldservice_isp_flow/i18n/fieldservice_isp_flow.pot @@ -0,0 +1,103 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_isp_flow +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Assign" +msgstr "" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Assigned until 'Assigned To' is filled in" +msgstr "" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Complete until 'Actual End' is filled in" +msgstr "" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Complete until 'Resolution' is filled in" +msgstr "" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Requested until 'Request Workers' is filled in" +msgstr "" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "" +"Cannot move to Scheduled until both 'Assigned To' and 'Scheduled Start Date'" +" are filled in" +msgstr "" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Start until 'Actual Start' is filled in" +msgstr "" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Confirm" +msgstr "" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "En Route" +msgstr "" + +#. module: fieldservice_isp_flow +#: model:ir.model,name:fieldservice_isp_flow.model_fsm_order +msgid "Field Service Order" +msgstr "" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_search_view +msgid "Orders" +msgstr "" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_search_view +msgid "Past Due Orders" +msgstr "" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Request" +msgstr "" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Schedule" +msgstr "" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Start" +msgstr "" diff --git a/fieldservice_isp_flow/i18n/it.po b/fieldservice_isp_flow/i18n/it.po new file mode 100644 index 0000000000..da841d4bb3 --- /dev/null +++ b/fieldservice_isp_flow/i18n/it.po @@ -0,0 +1,109 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_isp_flow +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-07-18 13:11+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_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Assign" +msgstr "Assegna" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Assigned until 'Assigned To' is filled in" +msgstr "Non impostabile a Assegnato finché non è compilato 'Assegnato a'" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Complete until 'Actual End' is filled in" +msgstr "Non impostabile a Completo finché non è compilato 'Fine effettiva'" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Complete until 'Resolution' is filled in" +msgstr "Non impostabile a Completo finché non è compilato 'Risoluzione'" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Requested until 'Request Workers' is filled in" +msgstr "" +"Non impostabile a Richiesto finché non è compilato 'Lavoratori richiesta'" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "" +"Cannot move to Scheduled until both 'Assigned To' and 'Scheduled Start Date' " +"are filled in" +msgstr "" +"Non impostabile a Schedulato finché non sono compilati 'Assegnato a' e 'Data " +"iniziale schedulata'" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Start until 'Actual Start' is filled in" +msgstr "Non impostabile a Inizio finché non è compilato 'Inizio effettivo'" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Confirm" +msgstr "Conferma" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "En Route" +msgstr "In viaggio" + +#. module: fieldservice_isp_flow +#: model:ir.model,name:fieldservice_isp_flow.model_fsm_order +msgid "Field Service Order" +msgstr "Ordine assistenza sul campo" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_search_view +msgid "Orders" +msgstr "Ordini" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_search_view +msgid "Past Due Orders" +msgstr "Ordini scaduti" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Request" +msgstr "Richiesta" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Schedule" +msgstr "Schedula" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Start" +msgstr "Avvia" diff --git a/fieldservice_isp_flow/i18n/pt_BR.po b/fieldservice_isp_flow/i18n/pt_BR.po new file mode 100644 index 0000000000..e33d537ccf --- /dev/null +++ b/fieldservice_isp_flow/i18n/pt_BR.po @@ -0,0 +1,110 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_isp_flow +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-02-05 22:13+0000\n" +"Last-Translator: Marcel Savegnago \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 3.10\n" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Assign" +msgstr "Atribuir" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Assigned until 'Assigned To' is filled in" +msgstr "Não pode passar para Atribuído até que 'Atribuído' seja preenchido" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Complete until 'Actual End' is filled in" +msgstr "Não pode passar para Completado até que ‘Fim Real’ seja preenchido" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Complete until 'Resolution' is filled in" +msgstr "Não pode passar para Concluído até que 'Resolução' seja preenchida" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Requested until 'Request Workers' is filled in" +msgstr "" +"Não pode mover para Solicitado até que ’Solicitar trabalhadores' seja " +"preenchido" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "" +"Cannot move to Scheduled until both 'Assigned To' and 'Scheduled Start Date' " +"are filled in" +msgstr "" +"Não pode passar para Agendado até que tanto 'Atribuído' quanto 'Data de " +"início programada' sejam preenchidos" + +#. module: fieldservice_isp_flow +#. odoo-python +#: code:addons/fieldservice_isp_flow/models/fsm_order.py:0 +#, python-format +msgid "Cannot move to Start until 'Actual Start' is filled in" +msgstr "Não pode passar para Iniciado até que ‘Inicio Real seja preenchido" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Confirm" +msgstr "Confirmar" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "En Route" +msgstr "Em Rota" + +#. module: fieldservice_isp_flow +#: model:ir.model,name:fieldservice_isp_flow.model_fsm_order +msgid "Field Service Order" +msgstr "Ordem de Serviço de Campo" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_search_view +msgid "Orders" +msgstr "Ordens" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_search_view +msgid "Past Due Orders" +msgstr "Ordens Vencidas" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Request" +msgstr "Requisição" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Schedule" +msgstr "Cronograma" + +#. module: fieldservice_isp_flow +#: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form +msgid "Start" +msgstr "Iniciar" diff --git a/fieldservice_isp_flow/models/__init__.py b/fieldservice_isp_flow/models/__init__.py new file mode 100644 index 0000000000..ed384d514e --- /dev/null +++ b/fieldservice_isp_flow/models/__init__.py @@ -0,0 +1 @@ +from . import fsm_order diff --git a/fieldservice_isp_flow/models/fsm_order.py b/fieldservice_isp_flow/models/fsm_order.py new file mode 100644 index 0000000000..385be61b53 --- /dev/null +++ b/fieldservice_isp_flow/models/fsm_order.py @@ -0,0 +1,108 @@ +# Copyright (C) 2021 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import _, models +from odoo.exceptions import ValidationError + + +class FSMOrder(models.Model): + _inherit = "fsm.order" + + def action_confirm(self): + return self.write( + {"stage_id": self.env.ref("fieldservice_isp_flow.fsm_stage_confirmed").id} + ) + + def action_request(self): + if not self.person_ids: + raise ValidationError( + _("Cannot move to Requested " + "until 'Request Workers' is filled in") + ) + return self.write( + {"stage_id": self.env.ref("fieldservice_isp_flow.fsm_stage_requested").id} + ) + + def action_assign(self): + if self.person_id: + return self.write( + { + "stage_id": self.env.ref( + "fieldservice_isp_flow.fsm_stage_assigned" + ).id + } + ) + raise ValidationError( + _("Cannot move to Assigned " + "until 'Assigned To' is filled in") + ) + + def action_schedule(self): + if self.scheduled_date_start and self.person_id: + return self.write( + { + "stage_id": self.env.ref( + "fieldservice_isp_flow.fsm_stage_scheduled" + ).id + } + ) + raise ValidationError( + _( + "Cannot move to Scheduled " + + "until both 'Assigned To' and " + + "'Scheduled Start Date' are filled in" + ) + ) + + def action_enroute(self): + return self.write( + {"stage_id": self.env.ref("fieldservice_isp_flow.fsm_stage_enroute").id} + ) + + def action_start(self): + if not self.date_start: + raise ValidationError( + _("Cannot move to Start " + "until 'Actual Start' is filled in") + ) + return self.write( + {"stage_id": self.env.ref("fieldservice_isp_flow.fsm_stage_started").id} + ) + + def action_complete(self): + if not self.date_end: + raise ValidationError( + _("Cannot move to Complete " + "until 'Actual End' is filled in") + ) + if not self.resolution: + raise ValidationError( + _("Cannot move to Complete " + "until 'Resolution' is filled in") + ) + return super().action_complete() + + def _track_subtype(self, init_values): + self.ensure_one() + if "stage_id" in init_values: + if ( + self.stage_id.id + == self.env.ref("fieldservice_isp_flow.fsm_stage_confirmed").id + ): + return self.env.ref("fieldservice.mt_order_confirmed") + if ( + self.stage_id.id + == self.env.ref("fieldservice_isp_flow.fsm_stage_scheduled").id + ): + return self.env.ref("fieldservice.mt_order_scheduled") + if ( + self.stage_id.id + == self.env.ref("fieldservice_isp_flow.fsm_stage_assigned").id + ): + return self.env.ref("fieldservice.mt_order_assigned") + if ( + self.stage_id.id + == self.env.ref("fieldservice_isp_flow.fsm_stage_enroute").id + ): + return self.env.ref("fieldservice.mt_order_enroute") + if ( + self.stage_id.id + == self.env.ref("fieldservice_isp_flow.fsm_stage_started").id + ): + return self.env.ref("fieldservice.mt_order_started") + return super()._track_subtype(init_values) diff --git a/fieldservice_isp_flow/pyproject.toml b/fieldservice_isp_flow/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/fieldservice_isp_flow/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/fieldservice_isp_flow/readme/CONFIGURE.md b/fieldservice_isp_flow/readme/CONFIGURE.md new file mode 100644 index 0000000000..4d2189fd4f --- /dev/null +++ b/fieldservice_isp_flow/readme/CONFIGURE.md @@ -0,0 +1,10 @@ +The stage of an order is used to monitor its progress. Stages can be +configured based on your company's specific business needs. A basic set +of order stages comes pre-configured for use. + +1. Go to *Field Service \> Configuration \> Stages* +2. Create or edit a stage +3. Set the name for the stage. +4. Set the sequence order for the stage. +5. Select *Order* type to apply this stage to your orders. +6. Additonally, you can set a color for the stage. diff --git a/fieldservice_isp_flow/readme/CONTRIBUTORS.md b/fieldservice_isp_flow/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..bdff6095e7 --- /dev/null +++ b/fieldservice_isp_flow/readme/CONTRIBUTORS.md @@ -0,0 +1,6 @@ +- Maxime Chambreuil \<\> +- Serpent Consulting Services Pvt. Ltd. \<\> +- Raphaël Reverdy \<\> +- Freni Patel \<\> +- \[APSL\](): + - Antoni Marroig \<\> diff --git a/fieldservice_isp_flow/readme/CREDITS.md b/fieldservice_isp_flow/readme/CREDITS.md new file mode 100644 index 0000000000..7e4827b0a8 --- /dev/null +++ b/fieldservice_isp_flow/readme/CREDITS.md @@ -0,0 +1,3 @@ +The development of this module has been financially supported by: + +- Open Source Integrators \<\> diff --git a/fieldservice_isp_flow/readme/DESCRIPTION.md b/fieldservice_isp_flow/readme/DESCRIPTION.md new file mode 100644 index 0000000000..2f7cfb08b0 --- /dev/null +++ b/fieldservice_isp_flow/readme/DESCRIPTION.md @@ -0,0 +1,3 @@ +This module is an add-on for the Field Service application in Odoo. It +provides default stages for orders and some validation logic when +changing current stage. diff --git a/fieldservice_isp_flow/readme/ROADMAP.md b/fieldservice_isp_flow/readme/ROADMAP.md new file mode 100644 index 0000000000..e14dbdee6f --- /dev/null +++ b/fieldservice_isp_flow/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/1). diff --git a/fieldservice_isp_flow/readme/USAGE.md b/fieldservice_isp_flow/readme/USAGE.md new file mode 100644 index 0000000000..b2d526a4b6 --- /dev/null +++ b/fieldservice_isp_flow/readme/USAGE.md @@ -0,0 +1,7 @@ +To use this module, you need to: + +- Create a new service order +- Under the Inventory tab, select the warehouse, the delivery method and + add products with quantity +- Confirm the order to create the delivery orders with the selected + method diff --git a/fieldservice_isp_flow/static/description/icon.png b/fieldservice_isp_flow/static/description/icon.png new file mode 100644 index 0000000000..955674d8f0 Binary files /dev/null and b/fieldservice_isp_flow/static/description/icon.png differ diff --git a/fieldservice_isp_flow/static/description/index.html b/fieldservice_isp_flow/static/description/index.html new file mode 100644 index 0000000000..cb378d07af --- /dev/null +++ b/fieldservice_isp_flow/static/description/index.html @@ -0,0 +1,474 @@ + + + + + + +Field Service - Flow for ISP + + + +
+

Field Service - Flow for ISP

+ + +

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

+

This module is an add-on for the Field Service application in Odoo. It +provides default stages for orders and some validation logic when +changing current stage.

+

Table of contents

+ +
+

Configuration

+

The stage of an order is used to monitor its progress. Stages can be +configured based on your company’s specific business needs. A basic set +of order stages comes pre-configured for use.

+
    +
  1. Go to Field Service > Configuration > Stages
  2. +
  3. Create or edit a stage
  4. +
  5. Set the name for the stage.
  6. +
  7. Set the sequence order for the stage.
  8. +
  9. Select Order type to apply this stage to your orders.
  10. +
  11. Additonally, you can set a color for the stage.
  12. +
+
+
+

Usage

+

To use this module, you need to:

+
    +
  • Create a new service order
  • +
  • Under the Inventory tab, select the warehouse, the delivery method +and add products with quantity
  • +
  • Confirm the order to create the delivery orders with the selected +method
  • +
+
+
+

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
  • +
  • Akretion
  • +
+
+
+

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 maintainer:

+

osi-scampbell

+

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_isp_flow/tests/__init__.py b/fieldservice_isp_flow/tests/__init__.py new file mode 100644 index 0000000000..292d750c1b --- /dev/null +++ b/fieldservice_isp_flow/tests/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2019 Brian McMaster +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) + +from . import test_fsm_isp_flow diff --git a/fieldservice_isp_flow/tests/test_fsm_isp_flow.py b/fieldservice_isp_flow/tests/test_fsm_isp_flow.py new file mode 100644 index 0000000000..e391100f8f --- /dev/null +++ b/fieldservice_isp_flow/tests/test_fsm_isp_flow.py @@ -0,0 +1,117 @@ +# 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 Form, TransactionCase + + +class FSMIspFlowCase(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.WorkOrder = cls.env["fsm.order"] + cls.Worker = cls.env["fsm.person"] + view_id = "fieldservice.fsm_person_form" + with Form(cls.Worker, view=view_id) as f: + f.name = "Worker A" + cls.worker = f.save() + cls.test_partner = cls.env["res.partner"].create( + {"name": "Test Partner", "phone": "123", "email": "tp@email.com"} + ) + # create a Res Partner to be converted to FSM Location/Person + cls.test_loc_partner = cls.env["res.partner"].create( + {"name": "Test Loc Partner", "phone": "ABC", "email": "tlp@email.com"} + ) + cls.test_location = cls.env.ref("fieldservice.test_location") + cls.init_values = { + "stage_id": cls.env.ref("fieldservice_isp_flow.fsm_stage_confirmed").id + } + cls.stage1 = cls.env.ref("fieldservice_isp_flow.fsm_stage_confirmed") + cls.stage2 = cls.env.ref("fieldservice_isp_flow.fsm_stage_scheduled") + cls.stage3 = cls.env.ref("fieldservice_isp_flow.fsm_stage_assigned") + cls.stage4 = cls.env.ref("fieldservice_isp_flow.fsm_stage_enroute") + cls.stage5 = cls.env.ref("fieldservice_isp_flow.fsm_stage_started") + + def test_fsm_orders(self): + """Test creating new workorders, and test following functions.""" + # Create an Orders + hours_diff = 100 + date_start = fields.Datetime.today() + + order = self.WorkOrder.create( + { + "location_id": self.test_location.id, + "date_start": date_start, + "date_end": date_start + timedelta(hours=hours_diff), + "request_early": fields.Datetime.today(), + } + ) + order2 = self.WorkOrder.create( + { + "location_id": self.test_location.id, + "request_early": fields.Datetime.today(), + "person_id": self.worker.id, + "date_end": date_start + timedelta(hours=hours_diff), + "scheduled_date_start": date_start, + } + ) + order3 = self.WorkOrder.create( + { + "location_id": self.test_location.id, + "stage_id": self.stage1.id, + } + ) + order4 = self.WorkOrder.create( + { + "location_id": self.test_location.id, + "stage_id": self.stage2.id, + } + ) + order5 = self.WorkOrder.create( + { + "location_id": self.test_location.id, + "stage_id": self.stage3.id, + } + ) + order6 = self.WorkOrder.create( + { + "location_id": self.test_location.id, + "stage_id": self.stage4.id, + } + ) + order7 = self.WorkOrder.create( + { + "location_id": self.test_location.id, + "stage_id": self.stage5.id, + } + ) + order.action_confirm() + order.action_enroute() + order.action_start() + order2.action_assign() + order2.action_schedule() + order3._track_subtype(self.init_values) + order4._track_subtype(self.init_values) + order5._track_subtype(self.init_values) + order6._track_subtype(self.init_values) + order7._track_subtype(self.init_values) + order._track_subtype(self.init_values) + order._track_subtype(self.init_values) + data_dict = order2.action_schedule() + self.assertEqual(data_dict, True) + with self.assertRaises(ValidationError): + order2.action_complete() + with self.assertRaises(ValidationError): + order.action_request() + with self.assertRaises(ValidationError): + order.action_assign() + with self.assertRaises(ValidationError): + order.action_schedule() + with self.assertRaises(ValidationError): + order.date_end = False + order.action_complete() + with self.assertRaises(ValidationError): + order2.action_start() diff --git a/fieldservice_isp_flow/views/fsm_order.xml b/fieldservice_isp_flow/views/fsm_order.xml new file mode 100644 index 0000000000..b856846753 --- /dev/null +++ b/fieldservice_isp_flow/views/fsm_order.xml @@ -0,0 +1,108 @@ + + + + + fsm.order.form + fsm.order + + + + + + + + fsm.order.tree + fsm.order + + + + stage_id in ( + %(fieldservice.fsm_stage_new)d, + %(fieldservice_isp_flow.fsm_stage_confirmed)d, + %(fieldservice_isp_flow.fsm_stage_requested)d, + %(fieldservice_isp_flow.fsm_stage_assigned)d) + + stage_id in ( + %(fieldservice_isp_flow.fsm_stage_scheduled)d, + %(fieldservice_isp_flow.fsm_stage_enroute)d, + %(fieldservice_isp_flow.fsm_stage_started)d, + %(fieldservice.fsm_stage_completed)d) + + + + + + + + fsm.order.search + fsm.order + + + + + + + + + + +