From 0d262f1783b72c17137f3491b76bbb19cafbf336 Mon Sep 17 00:00:00 2001 From: bojan Date: Sat, 15 Oct 2022 17:26:48 +0200 Subject: [PATCH 001/280] [14.0][ADD] fieldservice_equipment_type: equipment type --- fieldservice_equipment_type/README.rst | 1 + fieldservice_equipment_type/__init__.py | 1 + fieldservice_equipment_type/__manifest__.py | 18 +++++ .../models/__init__.py | 2 + .../models/fsm_equipment.py | 10 +++ .../models/fsm_equipment_type.py | 14 ++++ .../readme/CONTRIBUTORS.rst | 1 + .../readme/DESCRIPTION.rst | 1 + .../security/ir.model.access.csv | 3 + fieldservice_equipment_type/tests/__init__.py | 1 + .../tests/fsm_equipment_type.py | 24 ++++++ .../views/fsm_equipment.xml | 13 ++++ .../views/fsm_equipment_type.xml | 74 +++++++++++++++++++ .../odoo/addons/fieldservice_equipment_type | 1 + setup/fieldservice_equipment_type/setup.py | 6 ++ 15 files changed, 170 insertions(+) create mode 100644 fieldservice_equipment_type/README.rst create mode 100644 fieldservice_equipment_type/__init__.py create mode 100644 fieldservice_equipment_type/__manifest__.py create mode 100644 fieldservice_equipment_type/models/__init__.py create mode 100644 fieldservice_equipment_type/models/fsm_equipment.py create mode 100644 fieldservice_equipment_type/models/fsm_equipment_type.py create mode 100644 fieldservice_equipment_type/readme/CONTRIBUTORS.rst create mode 100644 fieldservice_equipment_type/readme/DESCRIPTION.rst create mode 100644 fieldservice_equipment_type/security/ir.model.access.csv create mode 100644 fieldservice_equipment_type/tests/__init__.py create mode 100644 fieldservice_equipment_type/tests/fsm_equipment_type.py create mode 100644 fieldservice_equipment_type/views/fsm_equipment.xml create mode 100644 fieldservice_equipment_type/views/fsm_equipment_type.xml create mode 120000 setup/fieldservice_equipment_type/odoo/addons/fieldservice_equipment_type create mode 100644 setup/fieldservice_equipment_type/setup.py diff --git a/fieldservice_equipment_type/README.rst b/fieldservice_equipment_type/README.rst new file mode 100644 index 0000000000..03b49ad94a --- /dev/null +++ b/fieldservice_equipment_type/README.rst @@ -0,0 +1 @@ +This module adds an Equipment Type (fsm.equipment.type) model and a type_id field to the Equipment (fsm.equipment) model. diff --git a/fieldservice_equipment_type/__init__.py b/fieldservice_equipment_type/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/fieldservice_equipment_type/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/fieldservice_equipment_type/__manifest__.py b/fieldservice_equipment_type/__manifest__.py new file mode 100644 index 0000000000..c7abfebf2e --- /dev/null +++ b/fieldservice_equipment_type/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2022 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +{ + "name": "Field Service Equipment Type", + "summary": "Field Service Equipment Type", + "version": "14.0.1.0.0", + "author": "Camptocamp, Odoo Community Association (OCA)", + "license": "AGPL-3", + "category": "Field Service", + "depends": ["fieldservice"], + "website": "https://github.com/OCA/field-service", + "data": [ + "security/ir.model.access.csv", + "views/fsm_equipment_type.xml", + "views/fsm_equipment.xml", + ], + "installable": True, +} diff --git a/fieldservice_equipment_type/models/__init__.py b/fieldservice_equipment_type/models/__init__.py new file mode 100644 index 0000000000..241d6a930f --- /dev/null +++ b/fieldservice_equipment_type/models/__init__.py @@ -0,0 +1,2 @@ +from . import fsm_equipment_type +from . import fsm_equipment diff --git a/fieldservice_equipment_type/models/fsm_equipment.py b/fieldservice_equipment_type/models/fsm_equipment.py new file mode 100644 index 0000000000..cf1006e28f --- /dev/null +++ b/fieldservice_equipment_type/models/fsm_equipment.py @@ -0,0 +1,10 @@ +# Copyright 2022 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class FSMEquipment(models.Model): + _inherit = "fsm.equipment" + + type_id = fields.Many2one("fsm.equipment.type") diff --git a/fieldservice_equipment_type/models/fsm_equipment_type.py b/fieldservice_equipment_type/models/fsm_equipment_type.py new file mode 100644 index 0000000000..27a278f1bd --- /dev/null +++ b/fieldservice_equipment_type/models/fsm_equipment_type.py @@ -0,0 +1,14 @@ +# Copyright 2022 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class FSMEquipmentType(models.Model): + _name = "fsm.equipment.type" + _description = "FSM Equipment Type" + + name = fields.Char(required=True) + code = fields.Char(required=True) + description = fields.Text() + active = fields.Boolean(default=True) diff --git a/fieldservice_equipment_type/readme/CONTRIBUTORS.rst b/fieldservice_equipment_type/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..7d1a526704 --- /dev/null +++ b/fieldservice_equipment_type/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Bojan Anchev diff --git a/fieldservice_equipment_type/readme/DESCRIPTION.rst b/fieldservice_equipment_type/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..5244f7f6f5 --- /dev/null +++ b/fieldservice_equipment_type/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module adds an option for the user to select an equipment type for an equipment. diff --git a/fieldservice_equipment_type/security/ir.model.access.csv b/fieldservice_equipment_type/security/ir.model.access.csv new file mode 100644 index 0000000000..19eb40a18c --- /dev/null +++ b/fieldservice_equipment_type/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_fsm_equipment_type_user,fsm.equipment.type.user,model_fsm_equipment_type,fieldservice.group_fsm_user_own,1,0,0,0 +access_fsm_equipment_type_manager,fsm.equipment.type.manager,model_fsm_equipment_type,fieldservice.group_fsm_manager,1,1,1,1 diff --git a/fieldservice_equipment_type/tests/__init__.py b/fieldservice_equipment_type/tests/__init__.py new file mode 100644 index 0000000000..574b69a71b --- /dev/null +++ b/fieldservice_equipment_type/tests/__init__.py @@ -0,0 +1 @@ +from . import fsm_equipment_type diff --git a/fieldservice_equipment_type/tests/fsm_equipment_type.py b/fieldservice_equipment_type/tests/fsm_equipment_type.py new file mode 100644 index 0000000000..aacc58b631 --- /dev/null +++ b/fieldservice_equipment_type/tests/fsm_equipment_type.py @@ -0,0 +1,24 @@ +# Copyright 2022 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.tests.common import TransactionCase + + +class TestFSMEquipmentType(TransactionCase): + def setUp(self): + super().setUp() + self.Equipment = self.env["fsm.equipment"] + self.EquipmentType = self.env["fsm.equipment.type"] + self.equipment = self.Equipment.create({"name": "Equipment"}) + self.equipment_type = self.EquipmentType.create( + { + "name": "Equipment Type", + "code": "KO", + "description": "Equipment Type Description", + } + ) + + def test_fsm_equipment_type(self): + """Test creating new equipment type, and assigning it to an existing equipment.""" + self.equipment.write({"type_id": self.equipment_type.id}) + self.assertEqual(self.equipment_type, self.equipment.type_id) diff --git a/fieldservice_equipment_type/views/fsm_equipment.xml b/fieldservice_equipment_type/views/fsm_equipment.xml new file mode 100644 index 0000000000..5a4fec1c28 --- /dev/null +++ b/fieldservice_equipment_type/views/fsm_equipment.xml @@ -0,0 +1,13 @@ + + + + fsm.equipment + + + + + + + + + diff --git a/fieldservice_equipment_type/views/fsm_equipment_type.xml b/fieldservice_equipment_type/views/fsm_equipment_type.xml new file mode 100644 index 0000000000..879b7213fe --- /dev/null +++ b/fieldservice_equipment_type/views/fsm_equipment_type.xml @@ -0,0 +1,74 @@ + + + + fsm.equipment.type + +
+ +
+
+
+
+
+
+ +
+
+
+
+ + + fsm.equipment.type + + + + + + + + + + + FSM Equipment Type + fsm.equipment.type + tree,form + + + + +
diff --git a/setup/fieldservice_equipment_type/odoo/addons/fieldservice_equipment_type b/setup/fieldservice_equipment_type/odoo/addons/fieldservice_equipment_type new file mode 120000 index 0000000000..679e513f15 --- /dev/null +++ b/setup/fieldservice_equipment_type/odoo/addons/fieldservice_equipment_type @@ -0,0 +1 @@ +../../../../fieldservice_equipment_type \ No newline at end of file diff --git a/setup/fieldservice_equipment_type/setup.py b/setup/fieldservice_equipment_type/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/fieldservice_equipment_type/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) From b6fa0fbce6e575dd46866fc9775feb2facf8dd04 Mon Sep 17 00:00:00 2001 From: Florian Mounier Date: Tue, 28 Feb 2023 11:09:05 +0100 Subject: [PATCH 002/280] [FIX][14.0] fieldservice_sale_recurring: make link between invoice and fsm order for recurring order --- fieldservice_sale_recurring/__manifest__.py | 1 + .../models/fsm_recurring.py | 5 +++++ .../models/sale_order_line.py | 18 ++++++++++++++++++ 3 files changed, 24 insertions(+) diff --git a/fieldservice_sale_recurring/__manifest__.py b/fieldservice_sale_recurring/__manifest__.py index 2948aeea9b..17881a44fb 100644 --- a/fieldservice_sale_recurring/__manifest__.py +++ b/fieldservice_sale_recurring/__manifest__.py @@ -11,6 +11,7 @@ "depends": [ "fieldservice_recurring", "fieldservice_sale", + "fieldservice_account", ], "data": [ "security/ir.model.access.csv", diff --git a/fieldservice_sale_recurring/models/fsm_recurring.py b/fieldservice_sale_recurring/models/fsm_recurring.py index 8f1489a2b4..1503c69221 100644 --- a/fieldservice_sale_recurring/models/fsm_recurring.py +++ b/fieldservice_sale_recurring/models/fsm_recurring.py @@ -20,3 +20,8 @@ def action_view_sales(self): "context": {"create": False}, "name": _("Sales Orders"), } + + def _prepare_order_values(self, date=None): + res = super()._prepare_order_values(date) + res["sale_line_id"] = self.sale_line_id.id + return res diff --git a/fieldservice_sale_recurring/models/sale_order_line.py b/fieldservice_sale_recurring/models/sale_order_line.py index 5df15da18a..01ac57e3db 100644 --- a/fieldservice_sale_recurring/models/sale_order_line.py +++ b/fieldservice_sale_recurring/models/sale_order_line.py @@ -68,3 +68,21 @@ def _field_create_fsm_recurring(self): fsm_recurring.message_post(body=fsm_recurring_msg) result[so_line.id] = fsm_recurring return result + + def _get_invoiceable_fsm_order_domain(self): + """ + add fsm_recurring_id to domain + :return: + """ + dom = super()._get_invoiceable_fsm_order_domain() + if self.fsm_recurring_id: + dom.append(("fsm_recurring_id", "=", self.fsm_recurring_id.id)) + return dom + + def _prepare_invoice_line(self, **optional_values): + res = super()._prepare_invoice_line(**optional_values) + if self.fsm_recurring_id: + fsm_orders = self._get_invoiceable_fsm_order() + if fsm_orders: + res.update({"fsm_order_ids": [(6, 0, fsm_orders.ids)]}) + return res From e03394ef68f299bf9ce6e0ae47b79b5ab0055684 Mon Sep 17 00:00:00 2001 From: Antonio Rivera Date: Mon, 3 Jul 2023 13:45:15 -0600 Subject: [PATCH 003/280] [FIX] fieldservice_stage_server_action --- .../models/fsm_order.py | 34 +++++++++++++------ 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/fieldservice_stage_server_action/models/fsm_order.py b/fieldservice_stage_server_action/models/fsm_order.py index a64d253631..c639b95acc 100644 --- a/fieldservice_stage_server_action/models/fsm_order.py +++ b/fieldservice_stage_server_action/models/fsm_order.py @@ -22,16 +22,28 @@ def create(self, vals_list): def write(self, vals): res = super().write(vals) - action = ( - self.env["fsm.stage"].browse(vals["stage_id"]).action_id - if "stage_id" in vals - else None - ) - if action: + if "stage_id" in vals: for record in self: - context = { - "active_model": record._name, - "active_ids": record.ids, - } - action.with_context(**context).run() + if record.stage_id.id != vals.get("stage_id"): + action = ( + self.env["fsm.stage"].browse(vals["stage_id"]).action_id + if "stage_id" in vals + else None + ) + if action: + context = { + "active_model": record._name, + "active_ids": record.ids, + } + action.with_context(**context).run() + else: + self.activity_ids.create( + { + "res_id": self.id, + "res_model_id": self.env["ir.model"] + .search([("model", "=", "fsm.order")], limit=1) + .id, + "activity_type_id": 1, + } + ) return res From 935fb8844522bde54149262a8694a5215860aa46 Mon Sep 17 00:00:00 2001 From: Antonio Rivera Date: Wed, 5 Jul 2023 11:14:59 -0600 Subject: [PATCH 004/280] [FIX] fieldservice_geoengine --- fieldservice_geoengine/tests/test_fsm_location.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fieldservice_geoengine/tests/test_fsm_location.py b/fieldservice_geoengine/tests/test_fsm_location.py index 0ccf0822e9..5bdc614ace 100644 --- a/fieldservice_geoengine/tests/test_fsm_location.py +++ b/fieldservice_geoengine/tests/test_fsm_location.py @@ -60,7 +60,7 @@ def test_fsm_location_creation(self): self.assertTrue(test_location_1.partner_latitude) self.assertTrue(test_location_1.partner_longitude) self.assertAlmostEqual( - test_location_1.partner_latitude, 50.629850, delta=self.delta + test_location_1.partner_latitude, 50.629980, delta=self.delta ) self.assertAlmostEqual( test_location_1.partner_longitude, 4.863860, delta=self.delta From dd35d883d7f7c84b4cc7e5e62e6b3d891658ea39 Mon Sep 17 00:00:00 2001 From: Maxime Chambreuil Date: Mon, 10 Jul 2023 08:17:19 -0600 Subject: [PATCH 005/280] Update test_fsm_location.py --- fieldservice_geoengine/tests/test_fsm_location.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fieldservice_geoengine/tests/test_fsm_location.py b/fieldservice_geoengine/tests/test_fsm_location.py index 5bdc614ace..89d5fb9112 100644 --- a/fieldservice_geoengine/tests/test_fsm_location.py +++ b/fieldservice_geoengine/tests/test_fsm_location.py @@ -63,7 +63,7 @@ def test_fsm_location_creation(self): test_location_1.partner_latitude, 50.629980, delta=self.delta ) self.assertAlmostEqual( - test_location_1.partner_longitude, 4.863860, delta=self.delta + test_location_1.partner_longitude, 4.863370, delta=self.delta ) # direct creation and same exit data partner_latitude = 1.0 From ee4da7e6f739242e1474d738575f37d9e6f891e3 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Mon, 10 Jul 2023 14:33:41 +0000 Subject: [PATCH 006/280] fieldservice_geoengine 14.0.1.2.2 --- fieldservice_geoengine/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fieldservice_geoengine/__manifest__.py b/fieldservice_geoengine/__manifest__.py index 6d31c2e999..eef883e932 100644 --- a/fieldservice_geoengine/__manifest__.py +++ b/fieldservice_geoengine/__manifest__.py @@ -6,7 +6,7 @@ "name": "Field Service Geoengine", "summary": "Display Field Service locations on a map with Open Street Map", "license": "AGPL-3", - "version": "14.0.1.2.1", + "version": "14.0.1.2.2", "category": "Field Service", "author": "Open Source Integrators, Odoo Community Association (OCA), Pytech SRL", "website": "https://github.com/OCA/field-service", From 98331442152a7d32cbe44fc7f63047aea93ee113 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Mon, 10 Jul 2023 14:33:42 +0000 Subject: [PATCH 007/280] fieldservice_stage_server_action 14.0.1.0.2 --- fieldservice_stage_server_action/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fieldservice_stage_server_action/__manifest__.py b/fieldservice_stage_server_action/__manifest__.py index 7bab6b6224..48f0fac694 100644 --- a/fieldservice_stage_server_action/__manifest__.py +++ b/fieldservice_stage_server_action/__manifest__.py @@ -3,7 +3,7 @@ { "name": "FSM Stage Server Action", "summary": "Execute server actions when reaching a Field Service stage", - "version": "14.0.1.0.1", + "version": "14.0.1.0.2", "category": "Field Service", "author": "Open Source Integrators, Odoo Community Association (OCA)", "website": "https://github.com/OCA/field-service", From 6a20dfcaa7d22d46182c199486c1a7cfbb845019 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Mon, 10 Jul 2023 14:33:47 +0000 Subject: [PATCH 008/280] [UPD] addons table in README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c11754fe22..8f055a460a 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ addon | version | maintainers | summary [fieldservice_distribution](fieldservice_distribution/) | 14.0.1.0.1 | [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) | Manage your distribution structure [fieldservice_equipment_stock](fieldservice_equipment_stock/) | 14.0.1.1.0 | [![brian10048](https://github.com/brian10048.png?size=30px)](https://github.com/brian10048) [![wolfhall](https://github.com/wolfhall.png?size=30px)](https://github.com/wolfhall) [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) [![smangukiya](https://github.com/smangukiya.png?size=30px)](https://github.com/smangukiya) | Integrate stock operations with your field service equipments [fieldservice_fleet](fieldservice_fleet/) | 14.0.1.0.0 | [![wolfhall](https://github.com/wolfhall.png?size=30px)](https://github.com/wolfhall) [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) [![brian10048](https://github.com/brian10048.png?size=30px)](https://github.com/brian10048) | Link Field Service vehicles with Odoo Fleet -[fieldservice_geoengine](fieldservice_geoengine/) | 14.0.1.2.1 | [![wolfhall](https://github.com/wolfhall.png?size=30px)](https://github.com/wolfhall) [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) | Display Field Service locations on a map with Open Street Map +[fieldservice_geoengine](fieldservice_geoengine/) | 14.0.1.2.2 | [![wolfhall](https://github.com/wolfhall.png?size=30px)](https://github.com/wolfhall) [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) | Display Field Service locations on a map with Open Street Map [fieldservice_google_map](fieldservice_google_map/) | 14.0.1.1.0 | [![wolfhall](https://github.com/wolfhall.png?size=30px)](https://github.com/wolfhall) [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) | This module displays map views on the order and location using Google Map View module. [fieldservice_google_marker_icon_picker](fieldservice_google_marker_icon_picker/) | 14.0.1.1.0 | [![wolfhall](https://github.com/wolfhall.png?size=30px)](https://github.com/wolfhall) [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) | This module displays google marker icon picker based on apply widget on field [fieldservice_isp_account](fieldservice_isp_account/) | 14.0.1.0.1 | [![osimallen](https://github.com/osimallen.png?size=30px)](https://github.com/osimallen) [![brian10048](https://github.com/brian10048.png?size=30px)](https://github.com/brian10048) [![bodedra](https://github.com/bodedra.png?size=30px)](https://github.com/bodedra) | Invoice Field Service orders based on employee time or contractor costs @@ -53,7 +53,7 @@ addon | version | maintainers | summary [fieldservice_sale_stock](fieldservice_sale_stock/) | 14.0.1.0.0 | [![wolfhall](https://github.com/wolfhall.png?size=30px)](https://github.com/wolfhall) [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) [![brian10048](https://github.com/brian10048.png?size=30px)](https://github.com/brian10048) | Sell stockable items linked to field service orders. [fieldservice_size](fieldservice_size/) | 14.0.1.0.1 | [![brian10048](https://github.com/brian10048.png?size=30px)](https://github.com/brian10048) | Manage Sizes for Field Service Locations and Orders [fieldservice_skill](fieldservice_skill/) | 14.0.1.0.0 | [![osi-scampbell](https://github.com/osi-scampbell.png?size=30px)](https://github.com/osi-scampbell) [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) | Manage your Field Service workers skills -[fieldservice_stage_server_action](fieldservice_stage_server_action/) | 14.0.1.0.1 | [![wolfhall](https://github.com/wolfhall.png?size=30px)](https://github.com/wolfhall) [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) [![osi-scampbell](https://github.com/osi-scampbell.png?size=30px)](https://github.com/osi-scampbell) | Execute server actions when reaching a Field Service stage +[fieldservice_stage_server_action](fieldservice_stage_server_action/) | 14.0.1.0.2 | [![wolfhall](https://github.com/wolfhall.png?size=30px)](https://github.com/wolfhall) [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) [![osi-scampbell](https://github.com/osi-scampbell.png?size=30px)](https://github.com/osi-scampbell) | Execute server actions when reaching a Field Service stage [fieldservice_stage_validation](fieldservice_stage_validation/) | 14.0.1.1.0 | [![brian10048](https://github.com/brian10048.png?size=30px)](https://github.com/brian10048) [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) | Validate input data when reaching a Field Service stage [fieldservice_stock](fieldservice_stock/) | 14.0.1.2.1 | [![brian10048](https://github.com/brian10048.png?size=30px)](https://github.com/brian10048) [![wolfhall](https://github.com/wolfhall.png?size=30px)](https://github.com/wolfhall) [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) [![smangukiya](https://github.com/smangukiya.png?size=30px)](https://github.com/smangukiya) | Integrate the logistics operations with Field Service [fieldservice_stock_account](fieldservice_stock_account/) | 14.0.1.0.0 | [![bodedra](https://github.com/bodedra.png?size=30px)](https://github.com/bodedra) [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) | Invoice inventory items delivered with Field Service orders From e4f32782a1738adb82349e6bc0727578d36ac09c Mon Sep 17 00:00:00 2001 From: Francesco Foresti Date: Wed, 12 Jul 2023 09:40:50 +0000 Subject: [PATCH 009/280] Translated using Weblate (Italian) Currently translated at 100.0% (23 of 23 strings) Translation: field-service-14.0/field-service-14.0-fieldservice_stock_request Translate-URL: https://translation.odoo-community.org/projects/field-service-14-0/field-service-14-0-fieldservice_stock_request/it/ --- fieldservice_stock_request/i18n/it.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fieldservice_stock_request/i18n/it.po b/fieldservice_stock_request/i18n/it.po index b9c5c226e2..ae511e342c 100644 --- a/fieldservice_stock_request/i18n/it.po +++ b/fieldservice_stock_request/i18n/it.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2023-06-14 12:09+0000\n" -"Last-Translator: mymage \n" +"PO-Revision-Date: 2023-07-12 12:11+0000\n" +"Last-Translator: Francesco Foresti \n" "Language-Team: none\n" "Language: it\n" "MIME-Version: 1.0\n" @@ -97,7 +97,7 @@ msgstr "Creare una richiesta di magazzino." #. module: fieldservice_stock_request #: model:ir.model,name:fieldservice_stock_request.model_stock_move_line msgid "Product Moves (Stock Move Line)" -msgstr "Movimenti prodotto (riga movimento magazzino)" +msgstr "Movimenti prodotto (riga movimento di magazzino)" #. module: fieldservice_stock_request #: model:ir.model.fields,field_description:fieldservice_stock_request.field_fsm_order__request_stage From ce403f7d4fe8ce507e085959aa97f335cf5666bc Mon Sep 17 00:00:00 2001 From: Francesco Foresti Date: Wed, 12 Jul 2023 09:35:05 +0000 Subject: [PATCH 010/280] Translated using Weblate (Italian) Currently translated at 100.0% (89 of 89 strings) Translation: field-service-14.0/field-service-14.0-fieldservice_change_management Translate-URL: https://translation.odoo-community.org/projects/field-service-14-0/field-service-14-0-fieldservice_change_management/it/ --- fieldservice_change_management/i18n/it.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fieldservice_change_management/i18n/it.po b/fieldservice_change_management/i18n/it.po index 246f1a128e..cd9d221a7c 100644 --- a/fieldservice_change_management/i18n/it.po +++ b/fieldservice_change_management/i18n/it.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2023-05-24 18:12+0000\n" +"PO-Revision-Date: 2023-07-12 12:11+0000\n" "Last-Translator: Francesco Foresti \n" "Language-Team: none\n" "Language: it\n" @@ -29,7 +29,7 @@ msgstr "Azione richiesta" #. module: fieldservice_change_management #: model:ir.model.fields,field_description:fieldservice_change_management.field_change_log__active msgid "Active" -msgstr "Attiva" +msgstr "Attivo" #. module: fieldservice_change_management #: model:ir.model.fields,field_description:fieldservice_change_management.field_change_log__activity_ids From ee36bbae91997ca73a2fa90e1f717aa02533be89 Mon Sep 17 00:00:00 2001 From: Francesco Foresti Date: Wed, 12 Jul 2023 13:00:15 +0000 Subject: [PATCH 011/280] Translated using Weblate (Italian) Currently translated at 100.0% (588 of 588 strings) Translation: field-service-14.0/field-service-14.0-fieldservice Translate-URL: https://translation.odoo-community.org/projects/field-service-14-0/field-service-14-0-fieldservice/it/ --- fieldservice/i18n/it.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fieldservice/i18n/it.po b/fieldservice/i18n/it.po index 96fb9619d5..e7e79a55f7 100644 --- a/fieldservice/i18n/it.po +++ b/fieldservice/i18n/it.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2023-06-16 17:10+0000\n" -"Last-Translator: mymage \n" +"PO-Revision-Date: 2023-07-12 15:13+0000\n" +"Last-Translator: Francesco Foresti \n" "Language-Team: none\n" "Language: it\n" "MIME-Version: 1.0\n" @@ -335,7 +335,7 @@ msgstr "Consenti vista web cronologia assistenza sul campo" #: model_terms:ir.ui.view,arch_db:fieldservice.fsm_stage_form_view #: model_terms:ir.ui.view,arch_db:fieldservice.fsm_stage_search_view msgid "Archived" -msgstr "Archiviato" +msgstr "In archivio" #. module: fieldservice #: model:ir.model.fields,field_description:fieldservice.field_fsm_equipment__location_id From ceacf940d3467b93c51d2dfb3ffa8ca333e90fe9 Mon Sep 17 00:00:00 2001 From: mymage Date: Thu, 13 Jul 2023 08:22:29 +0000 Subject: [PATCH 012/280] Translated using Weblate (Italian) Currently translated at 100.0% (588 of 588 strings) Translation: field-service-14.0/field-service-14.0-fieldservice Translate-URL: https://translation.odoo-community.org/projects/field-service-14-0/field-service-14-0-fieldservice/it/ --- fieldservice/i18n/it.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fieldservice/i18n/it.po b/fieldservice/i18n/it.po index e7e79a55f7..d19317d2bb 100644 --- a/fieldservice/i18n/it.po +++ b/fieldservice/i18n/it.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2023-07-12 15:13+0000\n" -"Last-Translator: Francesco Foresti \n" +"PO-Revision-Date: 2023-07-13 11:11+0000\n" +"Last-Translator: mymage \n" "Language-Team: none\n" "Language: it\n" "MIME-Version: 1.0\n" @@ -757,7 +757,7 @@ msgstr "Contatti" #. module: fieldservice #: model:ir.model.fields,field_description:fieldservice.field_fsm_location__contact_count msgid "Contacts Count" -msgstr "Numero contatti" +msgstr "Conteggio contatti" #. module: fieldservice #: model_terms:ir.ui.view,arch_db:fieldservice.partner_wizard_view @@ -2681,7 +2681,7 @@ msgstr "Telefoni in lista nera" #: model:ir.model.fields,field_description:fieldservice.field_fsm_location__plan_to_change_car #: model:ir.model.fields,field_description:fieldservice.field_fsm_person__plan_to_change_car msgid "Plan To Change Car" -msgstr "Pianifica sostituziona auto" +msgstr "Pianifica sostituzione auto" #. module: fieldservice #: model_terms:ir.ui.view,arch_db:fieldservice.fsm_order_form From 74de95a18a8774be7ee503ae87393525202c3fc1 Mon Sep 17 00:00:00 2001 From: Francesco Foresti Date: Mon, 17 Jul 2023 14:11:50 +0000 Subject: [PATCH 013/280] Translated using Weblate (Italian) Currently translated at 100.0% (16 of 16 strings) Translation: field-service-14.0/field-service-14.0-fieldservice_equipment_stock Translate-URL: https://translation.odoo-community.org/projects/field-service-14-0/field-service-14-0-fieldservice_equipment_stock/it/ --- fieldservice_equipment_stock/i18n/it.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fieldservice_equipment_stock/i18n/it.po b/fieldservice_equipment_stock/i18n/it.po index 63b7127a31..572ee7c24c 100644 --- a/fieldservice_equipment_stock/i18n/it.po +++ b/fieldservice_equipment_stock/i18n/it.po @@ -6,15 +6,15 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2023-04-17 09:51+0000\n" -"Last-Translator: mymage \n" +"PO-Revision-Date: 2023-07-17 17:09+0000\n" +"Last-Translator: Francesco Foresti \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.14.1\n" +"X-Generator: Weblate 4.17\n" #. module: fieldservice_equipment_stock #: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_stock_picking_type__create_fsm_equipment @@ -82,7 +82,7 @@ msgstr "Lotto/Seriale" #. module: fieldservice_equipment_stock #: model:ir.model,name:fieldservice_equipment_stock.model_stock_picking_type msgid "Picking Type" -msgstr "Tipo prelievo" +msgstr "Tipologia prelievo" #. module: fieldservice_equipment_stock #: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_fsm_equipment__product_id From 02c2900a54663446e2f3c44357a1ebbe940a5a17 Mon Sep 17 00:00:00 2001 From: mymage Date: Tue, 18 Jul 2023 11:00:33 +0000 Subject: [PATCH 014/280] Translated using Weblate (Italian) Currently translated at 100.0% (18 of 18 strings) Translation: field-service-14.0/field-service-14.0-fieldservice_isp_flow Translate-URL: https://translation.odoo-community.org/projects/field-service-14-0/field-service-14-0-fieldservice_isp_flow/it/ --- fieldservice_isp_flow/i18n/it.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fieldservice_isp_flow/i18n/it.po b/fieldservice_isp_flow/i18n/it.po index bb6c709191..854702930f 100644 --- a/fieldservice_isp_flow/i18n/it.po +++ b/fieldservice_isp_flow/i18n/it.po @@ -6,15 +6,15 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2023-02-01 18:46+0000\n" -"Last-Translator: Francesco Foresti \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.14.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 @@ -110,7 +110,7 @@ msgstr "Richiesta" #. module: fieldservice_isp_flow #: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form msgid "Schedule" -msgstr "Pianifica" +msgstr "Schedula" #. module: fieldservice_isp_flow #: model_terms:ir.ui.view,arch_db:fieldservice_isp_flow.fsm_order_form From dc675218d8e6442449c7de0eed69dfc5b2910e74 Mon Sep 17 00:00:00 2001 From: Ivorra78 Date: Tue, 18 Jul 2023 14:05:23 +0000 Subject: [PATCH 015/280] Translated using Weblate (Spanish) Currently translated at 85.9% (128 of 149 strings) Translation: field-service-14.0/field-service-14.0-fieldservice_recurring Translate-URL: https://translation.odoo-community.org/projects/field-service-14-0/field-service-14-0-fieldservice_recurring/es/ --- fieldservice_recurring/i18n/es.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fieldservice_recurring/i18n/es.po b/fieldservice_recurring/i18n/es.po index daafee0b60..7d7f1b83f0 100644 --- a/fieldservice_recurring/i18n/es.po +++ b/fieldservice_recurring/i18n/es.po @@ -6,15 +6,15 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2020-07-14 18:19+0000\n" -"Last-Translator: brian10048 \n" +"PO-Revision-Date: 2023-07-18 16:10+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 3.10\n" +"X-Generator: Weblate 4.17\n" #. module: fieldservice_recurring #: code:addons/fieldservice_recurring/models/fsm_frequency.py:0 @@ -553,7 +553,7 @@ msgstr "Nuevo" #. module: fieldservice_recurring #: model:ir.model.fields,field_description:fieldservice_recurring.field_fsm_recurring__activity_date_deadline msgid "Next Activity Deadline" -msgstr "Fecha L??mite de Actividad Siguiente" +msgstr "Fecha límite de la siguiente actividad" #. module: fieldservice_recurring #: model:ir.model.fields,field_description:fieldservice_recurring.field_fsm_recurring__activity_summary From 74c838c6d6c8666cbb3a4e50c998dec589137ade Mon Sep 17 00:00:00 2001 From: Ivorra78 Date: Thu, 20 Jul 2023 08:24:33 +0000 Subject: [PATCH 016/280] Translated using Weblate (Spanish) Currently translated at 70.3% (19 of 27 strings) Translation: field-service-14.0/field-service-14.0-fieldservice_skill Translate-URL: https://translation.odoo-community.org/projects/field-service-14-0/field-service-14-0-fieldservice_skill/es/ --- fieldservice_skill/i18n/es.po | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fieldservice_skill/i18n/es.po b/fieldservice_skill/i18n/es.po index c95c07b46a..25ddc78cca 100644 --- a/fieldservice_skill/i18n/es.po +++ b/fieldservice_skill/i18n/es.po @@ -6,15 +6,15 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2020-01-15 06:13+0000\n" -"Last-Translator: Nelson Ram??rez S??nchez \n" +"PO-Revision-Date: 2023-07-20 11:10+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 3.10\n" +"X-Generator: Weblate 4.17\n" #. module: fieldservice_skill #: model:ir.model.fields,help:fieldservice_skill.field_fsm_order__skill_worker_ids @@ -80,22 +80,22 @@ msgstr "??ltima modificaci??n el" #. module: fieldservice_skill #: model:ir.model.fields,field_description:fieldservice_skill.field_fsm_person_skill__write_uid msgid "Last Updated by" -msgstr "??ltima modificaci??n por" +msgstr "actualizado por última vez por" #. module: fieldservice_skill #: model:ir.model.fields,field_description:fieldservice_skill.field_fsm_person_skill__write_date msgid "Last Updated on" -msgstr "Ultima actualizaci??n en" +msgstr "actualizado por última vez el" #. module: fieldservice_skill #: model:ir.model.fields,field_description:fieldservice_skill.field_fsm_person_skill__level_progress msgid "Progress" -msgstr "" +msgstr "Preogreso" #. module: fieldservice_skill #: model:ir.model.fields,help:fieldservice_skill.field_fsm_person_skill__level_progress msgid "Progress from zero knowledge (0%) to fully mastered (100%)." -msgstr "" +msgstr "Progresar de un conocimiento nulo (0%) a un dominio total (100%)." #. module: fieldservice_skill #: model:ir.model.fields,field_description:fieldservice_skill.field_fsm_category__skill_ids From 00e0c4968b9b3076fd19160d33bc1f88d345554e Mon Sep 17 00:00:00 2001 From: Ivorra78 Date: Thu, 20 Jul 2023 08:20:06 +0000 Subject: [PATCH 017/280] Translated using Weblate (Spanish) Currently translated at 100.0% (20 of 20 strings) Translation: field-service-14.0/field-service-14.0-fieldservice_vehicle Translate-URL: https://translation.odoo-community.org/projects/field-service-14-0/field-service-14-0-fieldservice_vehicle/es/ --- fieldservice_vehicle/i18n/es.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fieldservice_vehicle/i18n/es.po b/fieldservice_vehicle/i18n/es.po index 01ada7faeb..0a95fa66cd 100644 --- a/fieldservice_vehicle/i18n/es.po +++ b/fieldservice_vehicle/i18n/es.po @@ -6,15 +6,15 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2020-03-25 17:13+0000\n" -"Last-Translator: Nelson Ram??rez S??nchez \n" +"PO-Revision-Date: 2023-07-20 11:10+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 3.10\n" +"X-Generator: Weblate 4.17\n" #. module: fieldservice_vehicle #: model_terms:ir.actions.act_window,help:fieldservice_vehicle.action_fsm_vehicle @@ -79,17 +79,17 @@ msgstr "??ltima Modificaci??n en" #. module: fieldservice_vehicle #: model:ir.model.fields,field_description:fieldservice_vehicle.field_fsm_vehicle__write_uid msgid "Last Updated by" -msgstr "??ltima Actualizaci??n por" +msgstr "actualizado por última vez por" #. module: fieldservice_vehicle #: model:ir.model.fields,field_description:fieldservice_vehicle.field_fsm_vehicle__write_date msgid "Last Updated on" -msgstr "??ltima Actualizaci??n el" +msgstr "actualizado por última vez el" #. module: fieldservice_vehicle #: model:res.groups,name:fieldservice_vehicle.group_fsm_vehicle msgid "Manage Vehicles" -msgstr "Gestionar Veh??culos" +msgstr "Gestionar Vehículos" #. module: fieldservice_vehicle #: model:ir.model.fields,field_description:fieldservice_vehicle.field_fsm_vehicle__name From 84eedddbc400c80640a19b12bea5f3cf411b05a2 Mon Sep 17 00:00:00 2001 From: Ivorra78 Date: Thu, 20 Jul 2023 07:35:33 +0000 Subject: [PATCH 018/280] Translated using Weblate (Spanish) Currently translated at 85.9% (128 of 149 strings) Translation: field-service-14.0/field-service-14.0-fieldservice_recurring Translate-URL: https://translation.odoo-community.org/projects/field-service-14-0/field-service-14-0-fieldservice_recurring/es/ --- fieldservice_recurring/i18n/es.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fieldservice_recurring/i18n/es.po b/fieldservice_recurring/i18n/es.po index 7d7f1b83f0..80efdac2f9 100644 --- a/fieldservice_recurring/i18n/es.po +++ b/fieldservice_recurring/i18n/es.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2023-07-18 16:10+0000\n" +"PO-Revision-Date: 2023-07-20 11:10+0000\n" "Last-Translator: Ivorra78 \n" "Language-Team: none\n" "Language: es\n" @@ -122,7 +122,7 @@ msgstr "Cerrado" #: model:ir.model.fields,field_description:fieldservice_recurring.field_fsm_recurring__company_id #: model:ir.model.fields,field_description:fieldservice_recurring.field_fsm_recurring_template__company_id msgid "Company" -msgstr "Campa????a" +msgstr "Compañía" #. module: fieldservice_recurring #: model:ir.model.fields,field_description:fieldservice_recurring.field_fsm_frequency__create_uid @@ -449,7 +449,7 @@ msgstr "??ltima Modificaci??n en" #: model:ir.model.fields,field_description:fieldservice_recurring.field_fsm_recurring__write_uid #: model:ir.model.fields,field_description:fieldservice_recurring.field_fsm_recurring_template__write_uid msgid "Last Updated by" -msgstr "??ltima Actualizaci??n por" +msgstr "actualizado por última vez por" #. module: fieldservice_recurring #: model:ir.model.fields,field_description:fieldservice_recurring.field_fsm_frequency__write_date @@ -457,7 +457,7 @@ msgstr "??ltima Actualizaci??n por" #: model:ir.model.fields,field_description:fieldservice_recurring.field_fsm_recurring__write_date #: model:ir.model.fields,field_description:fieldservice_recurring.field_fsm_recurring_template__write_date msgid "Last Updated on" -msgstr "??ltima Actualizaci??n en" +msgstr "actualizado por última vez el" #. module: fieldservice_recurring #: model:ir.model.fields,field_description:fieldservice_recurring.field_fsm_frequency_set__buffer_late From 256d570e5cef8ee25b7a85fd46d0edd39e1dce2c Mon Sep 17 00:00:00 2001 From: Ivorra78 Date: Thu, 20 Jul 2023 14:43:21 +0000 Subject: [PATCH 019/280] Translated using Weblate (Spanish) Currently translated at 85.9% (128 of 149 strings) Translation: field-service-14.0/field-service-14.0-fieldservice_recurring Translate-URL: https://translation.odoo-community.org/projects/field-service-14-0/field-service-14-0-fieldservice_recurring/es/ --- fieldservice_recurring/i18n/es.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fieldservice_recurring/i18n/es.po b/fieldservice_recurring/i18n/es.po index 80efdac2f9..2356cd5274 100644 --- a/fieldservice_recurring/i18n/es.po +++ b/fieldservice_recurring/i18n/es.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2023-07-20 11:10+0000\n" +"PO-Revision-Date: 2023-07-20 17:11+0000\n" "Last-Translator: Ivorra78 \n" "Language-Team: none\n" "Language: es\n" @@ -33,7 +33,7 @@ msgstr "Pedido Recurrente" #: model:ir.model.fields,field_description:fieldservice_recurring.field_fsm_recurring__message_needaction #: model:ir.model.fields,field_description:fieldservice_recurring.field_fsm_recurring_template__message_needaction msgid "Action Needed" -msgstr "Acci??n Requerida" +msgstr "Acción Necesaria" #. module: fieldservice_recurring #: model:ir.model.fields,field_description:fieldservice_recurring.field_fsm_frequency__active From 71783602ebf0586c0615ed8f65c0d981235bf5d1 Mon Sep 17 00:00:00 2001 From: Alessandro Uffreduzzi Date: Wed, 4 Jan 2023 14:30:29 +0100 Subject: [PATCH 020/280] [14.0][IMP]fieldservice_activity: duplicate fsm.order activities --- fieldservice_activity/models/fsm_activity.py | 1 + fieldservice_activity/models/fsm_order.py | 40 ++++++++++--------- .../tests/test_fsm_activity.py | 14 +++++++ 3 files changed, 36 insertions(+), 19 deletions(-) diff --git a/fieldservice_activity/models/fsm_activity.py b/fieldservice_activity/models/fsm_activity.py index 1b50332d92..49544b6762 100644 --- a/fieldservice_activity/models/fsm_activity.py +++ b/fieldservice_activity/models/fsm_activity.py @@ -31,6 +31,7 @@ class FSMActivity(models.Model): [("todo", "To Do"), ("done", "Completed"), ("cancel", "Cancelled")], "State", readonly=True, + copy=False, default="todo", ) diff --git a/fieldservice_activity/models/fsm_order.py b/fieldservice_activity/models/fsm_order.py index ace9f84ede..df3acf25e1 100644 --- a/fieldservice_activity/models/fsm_order.py +++ b/fieldservice_activity/models/fsm_order.py @@ -9,38 +9,40 @@ class FSMOrder(models.Model): _inherit = "fsm.order" order_activity_ids = fields.One2many( - "fsm.activity", "fsm_order_id", "Order Activities" + comodel_name="fsm.activity", + inverse_name="fsm_order_id", + string="Activities", + copy=True, ) @api.onchange("template_id") def _onchange_template_id(self): res = super()._onchange_template_id() - for rec in self: + for rec in self.filtered("template_id"): # Clear existing activities - rec.order_activity_ids = [(5, 0, 0)] - if rec.template_id: - activity_list = [] - for temp_activity in rec.template_id.temp_activity_ids: - activity_list.append( - ( - 0, - 0, - { - "name": temp_activity.name, - "required": temp_activity.required, - "ref": temp_activity.ref, - "state": temp_activity.state, - }, - ) + activity_list = [(5, 0, 0)] + for temp_activity in rec.template_id.temp_activity_ids: + activity_list.append( + ( + 0, + 0, + { + "name": temp_activity.name, + "required": temp_activity.required, + "ref": temp_activity.ref, + "state": temp_activity.state, + }, ) - rec.order_activity_ids = activity_list + ) + rec.order_activity_ids = activity_list return res @api.model def create(self, vals): """Update Activities for FSM orders that are generate from SO""" order = super(FSMOrder, self).create(vals) - order._onchange_template_id() + if not order.order_activity_ids: + order._onchange_template_id() return order def action_complete(self): diff --git a/fieldservice_activity/tests/test_fsm_activity.py b/fieldservice_activity/tests/test_fsm_activity.py index a5a89774c0..7ad1b20748 100644 --- a/fieldservice_activity/tests/test_fsm_activity.py +++ b/fieldservice_activity/tests/test_fsm_activity.py @@ -98,3 +98,17 @@ def test_onchange_template_id(self): self.assertNotEquals( self.fso.order_activity_ids.ids, self.fso.template_id.temp_activity_ids.ids ) + # making sure that activities are correctly copied when assigning a template + test_order = self.Order.create( + { + "location_id": self.test_location.id, + "template_id": self.template.id, + "order_activity_ids": False, + } + ) + self.assertNotEquals( + test_order.order_activity_ids.id, self.template.temp_activity_ids.id + ) + self.assertEqual( + test_order.order_activity_ids.name, self.template.temp_activity_ids.name + ) From 13d281a5232c505344d511b7b87efe07ff8036e8 Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Thu, 15 Jun 2023 17:32:54 -0300 Subject: [PATCH 021/280] [IMP] fieldservice: add field is_closed on fsm.order --- fieldservice/models/fsm_order.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fieldservice/models/fsm_order.py b/fieldservice/models/fsm_order.py index 29eee65172..9465a3a146 100644 --- a/fieldservice/models/fsm_order.py +++ b/fieldservice/models/fsm_order.py @@ -74,6 +74,10 @@ def _track_subtype(self, init_values): group_expand="_read_group_stage_ids", default=lambda self: self._default_stage_id(), ) + is_closed = fields.Boolean( + "Is closed", + related="stage_id.is_closed", + ) priority = fields.Selection( fsm_stage.AVAILABLE_PRIORITIES, string="Priority", From c6b30f2a08b07eca8c0ec335a6ac0210fb74e06e Mon Sep 17 00:00:00 2001 From: oca-ci Date: Mon, 7 Aug 2023 21:18:02 +0000 Subject: [PATCH 022/280] [UPD] Update fieldservice.pot --- fieldservice/i18n/fieldservice.pot | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fieldservice/i18n/fieldservice.pot b/fieldservice/i18n/fieldservice.pot index bb5f396d0f..c76e8113a9 100644 --- a/fieldservice/i18n/fieldservice.pot +++ b/fieldservice/i18n/fieldservice.pot @@ -1692,6 +1692,11 @@ msgstr "" msgid "Is a default stage" msgstr "" +#. module: fieldservice +#: model:ir.model.fields,field_description:fieldservice.field_fsm_order__is_closed +msgid "Is closed" +msgstr "" + #. module: fieldservice #: model:ir.model.fields,field_description:fieldservice.field_fsm_location__function #: model:ir.model.fields,field_description:fieldservice.field_fsm_person__function @@ -3015,6 +3020,7 @@ msgid "Service Orders" msgstr "" #. module: fieldservice +#: model:ir.model.fields,help:fieldservice.field_fsm_order__is_closed #: model:ir.model.fields,help:fieldservice.field_fsm_stage__is_closed msgid "Services in this stage are considered as closed." msgstr "" From cf35e945337f3a945a2502dd43f9b16d3774562a Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Mon, 7 Aug 2023 21:26:16 +0000 Subject: [PATCH 023/280] fieldservice 14.0.1.29.0 --- fieldservice/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fieldservice/__manifest__.py b/fieldservice/__manifest__.py index 9ffeaaf92f..69436f8a9a 100644 --- a/fieldservice/__manifest__.py +++ b/fieldservice/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Field Service", "summary": "Manage Field Service Locations, Workers and Orders", - "version": "14.0.1.28.0", + "version": "14.0.1.29.0", "license": "AGPL-3", "category": "Field Service", "author": "Open Source Integrators, Odoo Community Association (OCA)", From 2df32e00e87828e290615c05a66c4c3d6dd570dd Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Mon, 7 Aug 2023 21:26:21 +0000 Subject: [PATCH 024/280] [UPD] addons table in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8f055a460a..b06676890c 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Available addons addon | version | maintainers | summary --- | --- | --- | --- [base_territory](base_territory/) | 14.0.1.0.0 | [![wolfhall](https://github.com/wolfhall.png?size=30px)](https://github.com/wolfhall) [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) | This module allows you to define territories, branches, districts and regions to be used for Field Service operations or Sales. -[fieldservice](fieldservice/) | 14.0.1.28.0 | [![wolfhall](https://github.com/wolfhall.png?size=30px)](https://github.com/wolfhall) [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) | Manage Field Service Locations, Workers and Orders +[fieldservice](fieldservice/) | 14.0.1.29.0 | [![wolfhall](https://github.com/wolfhall.png?size=30px)](https://github.com/wolfhall) [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) | Manage Field Service Locations, Workers and Orders [fieldservice_account](fieldservice_account/) | 14.0.1.3.0 | [![osimallen](https://github.com/osimallen.png?size=30px)](https://github.com/osimallen) [![brian10048](https://github.com/brian10048.png?size=30px)](https://github.com/brian10048) [![bodedra](https://github.com/bodedra.png?size=30px)](https://github.com/bodedra) | Track invoices linked to Field Service orders [fieldservice_account_analytic](fieldservice_account_analytic/) | 14.0.1.0.0 | [![osimallen](https://github.com/osimallen.png?size=30px)](https://github.com/osimallen) [![brian10048](https://github.com/brian10048.png?size=30px)](https://github.com/brian10048) [![bodedra](https://github.com/bodedra.png?size=30px)](https://github.com/bodedra) | Track analytic accounts on Field Service locations and orders [fieldservice_account_payment](fieldservice_account_payment/) | 14.0.1.0.1 | [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) | Allow workers to collect payments from the order. From 4650e13a389292168fc2c793bb58d22066693c00 Mon Sep 17 00:00:00 2001 From: Weblate Date: Mon, 7 Aug 2023 21:26:34 +0000 Subject: [PATCH 025/280] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: field-service-14.0/field-service-14.0-fieldservice Translate-URL: https://translation.odoo-community.org/projects/field-service-14-0/field-service-14-0-fieldservice/ --- fieldservice/i18n/de.po | 6 ++++++ fieldservice/i18n/es.po | 6 ++++++ fieldservice/i18n/es_AR.po | 6 ++++++ fieldservice/i18n/es_CL.po | 6 ++++++ fieldservice/i18n/fr.po | 6 ++++++ fieldservice/i18n/fr_FR.po | 6 ++++++ fieldservice/i18n/it.po | 6 ++++++ fieldservice/i18n/pt_BR.po | 6 ++++++ fieldservice/i18n/pt_PT.po | 6 ++++++ fieldservice/i18n/tr.po | 6 ++++++ 10 files changed, 60 insertions(+) diff --git a/fieldservice/i18n/de.po b/fieldservice/i18n/de.po index 2d2ebfb30a..de31f2059a 100644 --- a/fieldservice/i18n/de.po +++ b/fieldservice/i18n/de.po @@ -1698,6 +1698,11 @@ msgstr "" msgid "Is a default stage" msgstr "" +#. module: fieldservice +#: model:ir.model.fields,field_description:fieldservice.field_fsm_order__is_closed +msgid "Is closed" +msgstr "" + #. module: fieldservice #: model:ir.model.fields,field_description:fieldservice.field_fsm_location__function #: model:ir.model.fields,field_description:fieldservice.field_fsm_person__function @@ -3027,6 +3032,7 @@ msgid "Service Orders" msgstr "Service-Aufträge" #. module: fieldservice +#: model:ir.model.fields,help:fieldservice.field_fsm_order__is_closed #: model:ir.model.fields,help:fieldservice.field_fsm_stage__is_closed msgid "Services in this stage are considered as closed." msgstr "" diff --git a/fieldservice/i18n/es.po b/fieldservice/i18n/es.po index 7658ac28b9..6fc6a14d63 100644 --- a/fieldservice/i18n/es.po +++ b/fieldservice/i18n/es.po @@ -1726,6 +1726,11 @@ msgstr "Es una etapa cerrada" msgid "Is a default stage" msgstr "Es una etapa predeterminada" +#. module: fieldservice +#: model:ir.model.fields,field_description:fieldservice.field_fsm_order__is_closed +msgid "Is closed" +msgstr "" + #. module: fieldservice #: model:ir.model.fields,field_description:fieldservice.field_fsm_location__function #: model:ir.model.fields,field_description:fieldservice.field_fsm_person__function @@ -3067,6 +3072,7 @@ msgid "Service Orders" msgstr "Ordenes de Servicio" #. module: fieldservice +#: model:ir.model.fields,help:fieldservice.field_fsm_order__is_closed #: model:ir.model.fields,help:fieldservice.field_fsm_stage__is_closed msgid "Services in this stage are considered as closed." msgstr "Los servicios en esta etapa se consideran cerrados." diff --git a/fieldservice/i18n/es_AR.po b/fieldservice/i18n/es_AR.po index 9278591c22..e309103342 100644 --- a/fieldservice/i18n/es_AR.po +++ b/fieldservice/i18n/es_AR.po @@ -1744,6 +1744,11 @@ msgstr "Es una etapa cerrada" msgid "Is a default stage" msgstr "Es una etapa predeterminada" +#. module: fieldservice +#: model:ir.model.fields,field_description:fieldservice.field_fsm_order__is_closed +msgid "Is closed" +msgstr "" + #. module: fieldservice #: model:ir.model.fields,field_description:fieldservice.field_fsm_location__function #: model:ir.model.fields,field_description:fieldservice.field_fsm_person__function @@ -3086,6 +3091,7 @@ msgid "Service Orders" msgstr "Órdenes de Servicio" #. module: fieldservice +#: model:ir.model.fields,help:fieldservice.field_fsm_order__is_closed #: model:ir.model.fields,help:fieldservice.field_fsm_stage__is_closed msgid "Services in this stage are considered as closed." msgstr "Los servicios en esta etapa se consideran cerrados." diff --git a/fieldservice/i18n/es_CL.po b/fieldservice/i18n/es_CL.po index 110947d73d..56eebcbe97 100644 --- a/fieldservice/i18n/es_CL.po +++ b/fieldservice/i18n/es_CL.po @@ -1726,6 +1726,11 @@ msgstr "Es una etapa cerrada" msgid "Is a default stage" msgstr "Es una etapa predeterminada" +#. module: fieldservice +#: model:ir.model.fields,field_description:fieldservice.field_fsm_order__is_closed +msgid "Is closed" +msgstr "" + #. module: fieldservice #: model:ir.model.fields,field_description:fieldservice.field_fsm_location__function #: model:ir.model.fields,field_description:fieldservice.field_fsm_person__function @@ -3067,6 +3072,7 @@ msgid "Service Orders" msgstr "Ordenes de Servicio" #. module: fieldservice +#: model:ir.model.fields,help:fieldservice.field_fsm_order__is_closed #: model:ir.model.fields,help:fieldservice.field_fsm_stage__is_closed msgid "Services in this stage are considered as closed." msgstr "Los servicios en esta etapa se consideran cerrados." diff --git a/fieldservice/i18n/fr.po b/fieldservice/i18n/fr.po index 4acda15c24..747d350b8c 100644 --- a/fieldservice/i18n/fr.po +++ b/fieldservice/i18n/fr.po @@ -1740,6 +1740,11 @@ msgstr "Est une étape proche" msgid "Is a default stage" msgstr "Est une étape par défaut" +#. module: fieldservice +#: model:ir.model.fields,field_description:fieldservice.field_fsm_order__is_closed +msgid "Is closed" +msgstr "" + #. module: fieldservice #: model:ir.model.fields,field_description:fieldservice.field_fsm_location__function #: model:ir.model.fields,field_description:fieldservice.field_fsm_person__function @@ -3083,6 +3088,7 @@ msgid "Service Orders" msgstr "Commandes de service" #. module: fieldservice +#: model:ir.model.fields,help:fieldservice.field_fsm_order__is_closed #: model:ir.model.fields,help:fieldservice.field_fsm_stage__is_closed msgid "Services in this stage are considered as closed." msgstr "Les services à ce stade sont considérés comme terminés." diff --git a/fieldservice/i18n/fr_FR.po b/fieldservice/i18n/fr_FR.po index ee9137ee58..8a85dcefae 100644 --- a/fieldservice/i18n/fr_FR.po +++ b/fieldservice/i18n/fr_FR.po @@ -1742,6 +1742,11 @@ msgstr "Est une étape proche" msgid "Is a default stage" msgstr "Est une étape par défaut" +#. module: fieldservice +#: model:ir.model.fields,field_description:fieldservice.field_fsm_order__is_closed +msgid "Is closed" +msgstr "" + #. module: fieldservice #: model:ir.model.fields,field_description:fieldservice.field_fsm_location__function #: model:ir.model.fields,field_description:fieldservice.field_fsm_person__function @@ -3076,6 +3081,7 @@ msgid "Service Orders" msgstr "Commandes de service" #. module: fieldservice +#: model:ir.model.fields,help:fieldservice.field_fsm_order__is_closed #: model:ir.model.fields,help:fieldservice.field_fsm_stage__is_closed msgid "Services in this stage are considered as closed." msgstr "Les services à ce stade sont considérés comme terminés." diff --git a/fieldservice/i18n/it.po b/fieldservice/i18n/it.po index d19317d2bb..4d15b18d1c 100644 --- a/fieldservice/i18n/it.po +++ b/fieldservice/i18n/it.po @@ -1736,6 +1736,11 @@ msgstr "È una fase chiusa" msgid "Is a default stage" msgstr "È una fase predefinita" +#. module: fieldservice +#: model:ir.model.fields,field_description:fieldservice.field_fsm_order__is_closed +msgid "Is closed" +msgstr "" + #. module: fieldservice #: model:ir.model.fields,field_description:fieldservice.field_fsm_location__function #: model:ir.model.fields,field_description:fieldservice.field_fsm_person__function @@ -3076,6 +3081,7 @@ msgid "Service Orders" msgstr "Ordini assistenza" #. module: fieldservice +#: model:ir.model.fields,help:fieldservice.field_fsm_order__is_closed #: model:ir.model.fields,help:fieldservice.field_fsm_stage__is_closed msgid "Services in this stage are considered as closed." msgstr "Le assistenze in questa fase sono considerate chiuse." diff --git a/fieldservice/i18n/pt_BR.po b/fieldservice/i18n/pt_BR.po index 90912e820f..19483ac637 100644 --- a/fieldservice/i18n/pt_BR.po +++ b/fieldservice/i18n/pt_BR.po @@ -1734,6 +1734,11 @@ msgstr "É uma etapa encerrada" msgid "Is a default stage" msgstr "É uma etapa padrão" +#. module: fieldservice +#: model:ir.model.fields,field_description:fieldservice.field_fsm_order__is_closed +msgid "Is closed" +msgstr "" + #. module: fieldservice #: model:ir.model.fields,field_description:fieldservice.field_fsm_location__function #: model:ir.model.fields,field_description:fieldservice.field_fsm_person__function @@ -3075,6 +3080,7 @@ msgid "Service Orders" msgstr "Ordens de Serviço" #. module: fieldservice +#: model:ir.model.fields,help:fieldservice.field_fsm_order__is_closed #: model:ir.model.fields,help:fieldservice.field_fsm_stage__is_closed msgid "Services in this stage are considered as closed." msgstr "Os serviços neste estágio são considerados fechados." diff --git a/fieldservice/i18n/pt_PT.po b/fieldservice/i18n/pt_PT.po index 65592eb3b2..e2c4d0a29a 100644 --- a/fieldservice/i18n/pt_PT.po +++ b/fieldservice/i18n/pt_PT.po @@ -1692,6 +1692,11 @@ msgstr "" msgid "Is a default stage" msgstr "" +#. module: fieldservice +#: model:ir.model.fields,field_description:fieldservice.field_fsm_order__is_closed +msgid "Is closed" +msgstr "" + #. module: fieldservice #: model:ir.model.fields,field_description:fieldservice.field_fsm_location__function #: model:ir.model.fields,field_description:fieldservice.field_fsm_person__function @@ -3013,6 +3018,7 @@ msgid "Service Orders" msgstr "" #. module: fieldservice +#: model:ir.model.fields,help:fieldservice.field_fsm_order__is_closed #: model:ir.model.fields,help:fieldservice.field_fsm_stage__is_closed msgid "Services in this stage are considered as closed." msgstr "" diff --git a/fieldservice/i18n/tr.po b/fieldservice/i18n/tr.po index 2606dfeca7..d46bc4efd2 100644 --- a/fieldservice/i18n/tr.po +++ b/fieldservice/i18n/tr.po @@ -1701,6 +1701,11 @@ msgstr "" msgid "Is a default stage" msgstr "" +#. module: fieldservice +#: model:ir.model.fields,field_description:fieldservice.field_fsm_order__is_closed +msgid "Is closed" +msgstr "" + #. module: fieldservice #: model:ir.model.fields,field_description:fieldservice.field_fsm_location__function #: model:ir.model.fields,field_description:fieldservice.field_fsm_person__function @@ -3024,6 +3029,7 @@ msgid "Service Orders" msgstr "Servis Siparişleri" #. module: fieldservice +#: model:ir.model.fields,help:fieldservice.field_fsm_order__is_closed #: model:ir.model.fields,help:fieldservice.field_fsm_stage__is_closed msgid "Services in this stage are considered as closed." msgstr "" From a5f3522b443e8c6941ab27ffbe92e0ff15426159 Mon Sep 17 00:00:00 2001 From: mymage Date: Thu, 10 Aug 2023 07:51:17 +0000 Subject: [PATCH 026/280] Translated using Weblate (Italian) Currently translated at 99.8% (588 of 589 strings) Translation: field-service-14.0/field-service-14.0-fieldservice Translate-URL: https://translation.odoo-community.org/projects/field-service-14-0/field-service-14-0-fieldservice/it/ --- fieldservice/i18n/it.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fieldservice/i18n/it.po b/fieldservice/i18n/it.po index 4d15b18d1c..a6dd8e4f27 100644 --- a/fieldservice/i18n/it.po +++ b/fieldservice/i18n/it.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2023-07-13 11:11+0000\n" +"PO-Revision-Date: 2023-08-10 10:12+0000\n" "Last-Translator: mymage \n" "Language-Team: none\n" "Language: it\n" @@ -1671,8 +1671,8 @@ msgid "" "Invoice & Delivery addresses are used in sales orders. Private addresses are " "only visible by authorized users." msgstr "" -"Fattura e indirizzo di consegna vengono utilizzati negli ordini di vendita. " -"Gli indirizzi privati sono visibili solo a utenti autorizzati." +"Gli indirizzi di fatturazione e consegna sono usati negli ordini di vendita. " +"Gli indirizzi privati sono visibili solo agli utenti autorizzati." #. module: fieldservice #: model:ir.model.fields,field_description:fieldservice.field_res_config_settings__module_fieldservice_account From 279af54fc7b860fcd6370cea18d67d33ad7bf0ae Mon Sep 17 00:00:00 2001 From: mymage Date: Mon, 14 Aug 2023 05:52:23 +0000 Subject: [PATCH 027/280] Translated using Weblate (Italian) Currently translated at 100.0% (589 of 589 strings) Translation: field-service-14.0/field-service-14.0-fieldservice Translate-URL: https://translation.odoo-community.org/projects/field-service-14-0/field-service-14-0-fieldservice/it/ --- fieldservice/i18n/it.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fieldservice/i18n/it.po b/fieldservice/i18n/it.po index a6dd8e4f27..af0f40a217 100644 --- a/fieldservice/i18n/it.po +++ b/fieldservice/i18n/it.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2023-08-10 10:12+0000\n" +"PO-Revision-Date: 2023-08-14 08:11+0000\n" "Last-Translator: mymage \n" "Language-Team: none\n" "Language: it\n" @@ -1739,7 +1739,7 @@ msgstr "È una fase predefinita" #. module: fieldservice #: model:ir.model.fields,field_description:fieldservice.field_fsm_order__is_closed msgid "Is closed" -msgstr "" +msgstr "È chiuso" #. module: fieldservice #: model:ir.model.fields,field_description:fieldservice.field_fsm_location__function From f038d170a72d45d5a5d69f67dc56ee3447be0861 Mon Sep 17 00:00:00 2001 From: Brian McMaster Date: Fri, 18 Aug 2023 12:05:21 -0400 Subject: [PATCH 028/280] [FIX] fieldservice_crm: order smart button --- fieldservice_crm/views/crm_lead.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fieldservice_crm/views/crm_lead.xml b/fieldservice_crm/views/crm_lead.xml index fd04613a2f..4f7e71d661 100644 --- a/fieldservice_crm/views/crm_lead.xml +++ b/fieldservice_crm/views/crm_lead.xml @@ -16,7 +16,7 @@ name="%(fieldservice.action_fsm_dash_order)d" icon="fa-truck" groups="fieldservice.group_fsm_user" - context="{'search_default_opportunity_id': active_id, + context="{'search_default_opportunity_id': id, 'default_location_id': fsm_location_id}" > Date: Fri, 18 Aug 2023 17:15:12 +0000 Subject: [PATCH 029/280] fieldservice_crm 14.0.1.2.0 --- fieldservice_crm/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fieldservice_crm/__manifest__.py b/fieldservice_crm/__manifest__.py index c3509d7d11..3f7f87a07f 100644 --- a/fieldservice_crm/__manifest__.py +++ b/fieldservice_crm/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Field Service - CRM", - "version": "14.0.1.1.0", + "version": "14.0.1.2.0", "summary": "Create Field Service orders from the CRM", "category": "Field Service", "author": "Patrick Wilson, Odoo Community Association (OCA)", From 5758b51b56f9ea79a93a182ae071a7fcd04ea12e Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Fri, 18 Aug 2023 17:15:16 +0000 Subject: [PATCH 030/280] [UPD] addons table in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b06676890c..b60f15234d 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ addon | version | maintainers | summary [fieldservice_agreement](fieldservice_agreement/) | 14.0.1.1.1 | [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) [![bodedra](https://github.com/bodedra.png?size=30px)](https://github.com/bodedra) [![smangukiya](https://github.com/smangukiya.png?size=30px)](https://github.com/smangukiya) [![osi-scampbell](https://github.com/osi-scampbell.png?size=30px)](https://github.com/osi-scampbell) [![patrickrwilson](https://github.com/patrickrwilson.png?size=30px)](https://github.com/patrickrwilson) | Manage Field Service agreements and contracts [fieldservice_calendar](fieldservice_calendar/) | 14.0.1.1.0 | [![hparfr](https://github.com/hparfr.png?size=30px)](https://github.com/hparfr) | Add calendar to FSM Orders [fieldservice_change_management](fieldservice_change_management/) | 14.0.1.0.0 | [![patrickrwilson](https://github.com/patrickrwilson.png?size=30px)](https://github.com/patrickrwilson) | Manage Change Logs on Locations -[fieldservice_crm](fieldservice_crm/) | 14.0.1.1.0 | [![patrickrwilson](https://github.com/patrickrwilson.png?size=30px)](https://github.com/patrickrwilson) | Create Field Service orders from the CRM +[fieldservice_crm](fieldservice_crm/) | 14.0.1.2.0 | [![patrickrwilson](https://github.com/patrickrwilson.png?size=30px)](https://github.com/patrickrwilson) | Create Field Service orders from the CRM [fieldservice_delivery](fieldservice_delivery/) | 14.0.1.0.0 | [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) | Select delivery methods and carriers on Field Service orders [fieldservice_distribution](fieldservice_distribution/) | 14.0.1.0.1 | [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) | Manage your distribution structure [fieldservice_equipment_stock](fieldservice_equipment_stock/) | 14.0.1.1.0 | [![brian10048](https://github.com/brian10048.png?size=30px)](https://github.com/brian10048) [![wolfhall](https://github.com/wolfhall.png?size=30px)](https://github.com/wolfhall) [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) [![smangukiya](https://github.com/smangukiya.png?size=30px)](https://github.com/smangukiya) | Integrate stock operations with your field service equipments From 30f3adddb0f0c86df4af9950124c73db6e7d3ba7 Mon Sep 17 00:00:00 2001 From: hparfr Date: Thu, 24 Aug 2023 11:52:13 +0200 Subject: [PATCH 031/280] fieldservice_recurring: fix default team support multicompany --- fieldservice_recurring/models/fsm_recurring.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fieldservice_recurring/models/fsm_recurring.py b/fieldservice_recurring/models/fsm_recurring.py index 52339b0b5e..da9bdd8e0f 100644 --- a/fieldservice_recurring/models/fsm_recurring.py +++ b/fieldservice_recurring/models/fsm_recurring.py @@ -15,7 +15,11 @@ class FSMRecurringOrder(models.Model): _inherit = ["mail.thread", "mail.activity.mixin"] def _default_team_id(self): - return self.env.ref("fieldservice.fsm_team_default") + return self.env["fsm.team"].search( + [["company_id", "in", (self.env.company.id, False)]], + limit=1, + order="sequence", + ) name = fields.Char( string="Name", From d862a5427add862ac17038c199cf4209b38d5e19 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Fri, 25 Aug 2023 07:38:58 +0000 Subject: [PATCH 032/280] fieldservice_recurring 14.0.3.3.0 --- fieldservice_recurring/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fieldservice_recurring/__manifest__.py b/fieldservice_recurring/__manifest__.py index 37e1502281..c4c4814fd9 100644 --- a/fieldservice_recurring/__manifest__.py +++ b/fieldservice_recurring/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Field Service Recurring Work Orders", "summary": "Manage recurring Field Service orders", - "version": "14.0.3.2.0", + "version": "14.0.3.3.0", "category": "Field Service", "author": "Brian McMaster, " "Open Source Integrators, " From fe62042f0c015df2cd74e3d5c9f6cbaa3af3068f Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Fri, 25 Aug 2023 07:39:03 +0000 Subject: [PATCH 033/280] [UPD] addons table in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b60f15234d..88bbd254ce 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ addon | version | maintainers | summary [fieldservice_partner_multi_relation](fieldservice_partner_multi_relation/) | 14.0.1.0.1 | [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) | Manage relations between contacts, companies and locations [fieldservice_project](fieldservice_project/) | 14.0.1.0.1 | | Create field service orders from a project or project task [fieldservice_purchase](fieldservice_purchase/) | 14.0.1.0.1 | [![osi-scampbell](https://github.com/osi-scampbell.png?size=30px)](https://github.com/osi-scampbell) | Manage FSM Purchases -[fieldservice_recurring](fieldservice_recurring/) | 14.0.3.2.0 | [![wolfhall](https://github.com/wolfhall.png?size=30px)](https://github.com/wolfhall) [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) [![brian10048](https://github.com/brian10048.png?size=30px)](https://github.com/brian10048) | Manage recurring Field Service orders +[fieldservice_recurring](fieldservice_recurring/) | 14.0.3.3.0 | [![wolfhall](https://github.com/wolfhall.png?size=30px)](https://github.com/wolfhall) [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) [![brian10048](https://github.com/brian10048.png?size=30px)](https://github.com/brian10048) | Manage recurring Field Service orders [fieldservice_repair](fieldservice_repair/) | 14.0.1.0.0 | [![smangukiya](https://github.com/smangukiya.png?size=30px)](https://github.com/smangukiya) [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) | Integrate Field Service orders with MRP repair orders [fieldservice_route](fieldservice_route/) | 14.0.1.1.0 | [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) | Organize the routes of each day. [fieldservice_sale](fieldservice_sale/) | 14.0.2.1.0 | [![wolfhall](https://github.com/wolfhall.png?size=30px)](https://github.com/wolfhall) [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) [![brian10048](https://github.com/brian10048.png?size=30px)](https://github.com/brian10048) | Sell field services. From 00ba838db69f5f3fe14e56a916d24ed469114858 Mon Sep 17 00:00:00 2001 From: tafaRU Date: Tue, 29 Aug 2023 15:25:47 +0200 Subject: [PATCH 034/280] [FIX] fieldservice: prevent KeyError: 'stage_type' Steps to reproduce it: * open dashboard Field Service Orders * click "Add a Column" in the kanban view * type a new stage name --- fieldservice/models/fsm_stage.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fieldservice/models/fsm_stage.py b/fieldservice/models/fsm_stage.py index 3c09a1c169..28687a3a68 100644 --- a/fieldservice/models/fsm_stage.py +++ b/fieldservice/models/fsm_stage.py @@ -84,10 +84,9 @@ def get_color_information(self): def create(self, vals): stages = self.env["fsm.stage"].search([]) for stage in stages: - if ( - stage.stage_type == vals["stage_type"] - and stage.sequence == vals["sequence"] - ): + if stage.stage_type == vals.get( + "stage_type" + ) and stage.sequence == vals.get("sequence"): raise ValidationError( _( "Cannot create FSM Stage because " From 8c6894dcafcee8c509d2eb62c13eb3c73e83508b Mon Sep 17 00:00:00 2001 From: tafaRU Date: Tue, 29 Aug 2023 15:33:49 +0200 Subject: [PATCH 035/280] [FIX] fieldservice: allow to quick create a fsm.stage Steps to reproduce the behavior: 1. open dashboard Field Service Orders 2. click "Add a Column" in the kanban view 3. type a new stage name Current behavior: ``` 2023-08-29 10:48:02,995 73200 ERROR test-fieldservice odoo.sql_db: bad query: INSERT INTO "fsm_stage" ("id", "create_uid", "create_date", "write_uid", "write_date", "active", "custom_color", "name", "sequence") VALUES (nextval('fsm_stage_id_seq'), 2, (now() at time zone 'UTC'), 2, (now() at time zone 'UTC'), true, '#FFFFFF', 'test', 1) RETURNING id ERROR: null value in column "stage_type" violates not-null constraint DETAIL: Failing row contains (13, t, test, 1, null, null, null, null, #FFFFFF, null, null, null, 2, 2023-08-29 10:48:02.988337, 2, 2023-08-29 10:48:02.988337). 2023-08-29 10:48:03,000 73200 WARNING test-fieldservice odoo.http: The operation cannot be completed: - Create/update: a mandatory field is not set. - Delete: another model requires the record being deleted. If possible, archive it instead. Model: Field Service Stage (fsm.stage), Field: Type (stage_type) ``` Expected behavior: the fsm.stage is created with type 'order' by default. --- fieldservice/models/fsm_stage.py | 1 + fieldservice/readme/CONTRIBUTORS.rst | 1 + 2 files changed, 2 insertions(+) diff --git a/fieldservice/models/fsm_stage.py b/fieldservice/models/fsm_stage.py index 28687a3a68..2da11b1fdd 100644 --- a/fieldservice/models/fsm_stage.py +++ b/fieldservice/models/fsm_stage.py @@ -51,6 +51,7 @@ def _default_team_ids(self): ], "Type", required=True, + default="order", ) company_id = fields.Many2one( "res.company", diff --git a/fieldservice/readme/CONTRIBUTORS.rst b/fieldservice/readme/CONTRIBUTORS.rst index c868bf6e72..259711e604 100644 --- a/fieldservice/readme/CONTRIBUTORS.rst +++ b/fieldservice/readme/CONTRIBUTORS.rst @@ -9,3 +9,4 @@ * Raphaël Reverdy * Ammar Officewala * Yves Goldberg +* Alex Comba From 44889945fc000a7fb966b0b1f6c9b6a78ab6af4a Mon Sep 17 00:00:00 2001 From: Alberto Re Date: Thu, 31 Aug 2023 10:31:30 +0200 Subject: [PATCH 036/280] Decouple move vals preparation from actual records creation --- fieldservice_isp_account/models/fsm_order.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/fieldservice_isp_account/models/fsm_order.py b/fieldservice_isp_account/models/fsm_order.py index b12a442cae..9ef778fbf4 100644 --- a/fieldservice_isp_account/models/fsm_order.py +++ b/fieldservice_isp_account/models/fsm_order.py @@ -83,7 +83,7 @@ def action_complete(self): ) return super(FSMOrder, self).action_complete() - def create_bills(self): + def prepare_bills(self): jrnl = self.env["account.journal"].search( [ ("company_id", "=", self.env.company.id), @@ -125,6 +125,10 @@ def create_bills(self): "company_id": self.env.company.id, "invoice_line_ids": invoice_line_vals, } + return vals + + def create_bills(self): + vals = self.prepare_bills() bill = self.env["account.move"].sudo().create(vals) bill._recompute_tax_lines() @@ -142,7 +146,7 @@ def account_confirm(self): if order.employee_timesheet_ids: order.account_stage = "confirmed" - def account_create_invoice(self): + def account_prepare_invoice(self): jrnl = self.env["account.journal"].search( [ ("company_id", "=", self.env.company.id), @@ -235,8 +239,11 @@ def account_create_invoice(self): }, ) ) - invoice_vals.update({"invoice_line_ids": invoice_line_vals}) + return invoice_vals + + def account_create_invoice(self): + invoice_vals = self.account_prepare_invoice() invoice = self.env["account.move"].sudo().create(invoice_vals) invoice._recompute_tax_lines() From 8748c3e2ea1320c97c4fb951854d17c5ca9583b1 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sun, 3 Sep 2023 12:53:16 +0000 Subject: [PATCH 037/280] [UPD] README.rst --- base_territory/README.rst | 15 +-- base_territory/static/description/index.html | 44 ++++---- fieldservice/README.rst | 15 +-- fieldservice/static/description/index.html | 100 +++++++++--------- fieldservice_account/README.rst | 15 +-- .../static/description/index.html | 52 ++++----- fieldservice_account_analytic/README.rst | 15 +-- .../static/description/index.html | 48 +++++---- fieldservice_account_payment/README.rst | 15 +-- .../static/description/index.html | 52 ++++----- fieldservice_activity/README.rst | 15 +-- .../static/description/index.html | 48 +++++---- fieldservice_agreement/README.rst | 15 +-- .../static/description/index.html | 44 ++++---- fieldservice_calendar/README.rst | 15 +-- .../static/description/index.html | 40 +++---- fieldservice_change_management/README.rst | 15 +-- .../static/description/index.html | 52 ++++----- fieldservice_crm/README.rst | 15 +-- .../static/description/index.html | 56 +++++----- fieldservice_delivery/README.rst | 15 +-- .../static/description/index.html | 56 +++++----- fieldservice_distribution/README.rst | 15 +-- .../static/description/index.html | 48 +++++---- fieldservice_equipment_stock/README.rst | 15 +-- .../static/description/index.html | 52 ++++----- fieldservice_fleet/README.rst | 15 +-- .../static/description/index.html | 56 +++++----- fieldservice_geoengine/README.rst | 15 +-- .../static/description/index.html | 56 +++++----- fieldservice_google_map/README.rst | 15 +-- .../static/description/index.html | 52 ++++----- .../README.rst | 15 +-- .../static/description/index.html | 52 ++++----- fieldservice_isp_account/README.rst | 15 +-- .../static/description/index.html | 52 ++++----- fieldservice_isp_flow/README.rst | 15 +-- .../static/description/index.html | 52 ++++----- fieldservice_location_builder/README.rst | 15 +-- .../static/description/index.html | 44 ++++---- fieldservice_maintenance/README.rst | 15 +-- .../static/description/index.html | 56 +++++----- .../README.rst | 15 +-- .../static/description/index.html | 56 +++++----- fieldservice_project/README.rst | 15 +-- .../static/description/index.html | 46 ++++---- fieldservice_purchase/README.rst | 15 +-- .../static/description/index.html | 48 +++++---- fieldservice_recurring/README.rst | 15 +-- .../static/description/index.html | 56 +++++----- fieldservice_repair/README.rst | 15 +-- .../static/description/index.html | 56 +++++----- fieldservice_route/README.rst | 15 +-- .../static/description/index.html | 48 +++++---- fieldservice_sale/README.rst | 15 +-- .../static/description/index.html | 52 ++++----- fieldservice_sale_recurring/README.rst | 15 +-- .../static/description/index.html | 52 ++++----- fieldservice_sale_stock/README.rst | 15 +-- .../static/description/index.html | 52 ++++----- fieldservice_size/README.rst | 15 +-- .../static/description/index.html | 48 +++++---- fieldservice_skill/README.rst | 15 +-- .../static/description/index.html | 56 +++++----- fieldservice_stage_server_action/README.rst | 15 +-- .../static/description/index.html | 44 ++++---- fieldservice_stage_validation/README.rst | 15 +-- .../static/description/index.html | 48 +++++---- fieldservice_stock/README.rst | 15 +-- .../static/description/index.html | 56 +++++----- fieldservice_stock_account/README.rst | 15 +-- .../static/description/index.html | 44 ++++---- .../README.rst | 15 +-- .../static/description/index.html | 60 ++++++----- fieldservice_stock_request/README.rst | 15 +-- .../static/description/index.html | 52 ++++----- fieldservice_substatus/README.rst | 15 +-- .../static/description/index.html | 56 +++++----- fieldservice_timeline/README.rst | 15 +-- .../static/description/index.html | 52 ++++----- fieldservice_vehicle/README.rst | 15 +-- .../static/description/index.html | 56 +++++----- fieldservice_vehicle_stock/README.rst | 15 +-- .../static/description/index.html | 48 +++++---- fieldservice_vehicle_stock_request/README.rst | 15 +-- .../static/description/index.html | 44 ++++---- 86 files changed, 1551 insertions(+), 1336 deletions(-) diff --git a/base_territory/README.rst b/base_territory/README.rst index 0ea9dfa789..bd1f7dd96f 100644 --- a/base_territory/README.rst +++ b/base_territory/README.rst @@ -2,10 +2,13 @@ Base Territory ============== -.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:f470de310997bba4ca520f8bfa58418883c17c6b696d88227de57ebd7526504b + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png :target: https://odoo-community.org/page/development-status @@ -19,11 +22,11 @@ Base Territory .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png :target: https://translation.odoo-community.org/projects/field-service-14-0/field-service-14-0-base_territory :alt: Translate me on Weblate -.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/264/14.0 - :alt: Try me on Runbot +.. |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=14.0 + :alt: Try me on Runboat -|badge1| |badge2| |badge3| |badge4| |badge5| +|badge1| |badge2| |badge3| |badge4| |badge5| This module allows you to define territories, branches, districts and regions to be used for Field Service operations or Sales. @@ -45,7 +48,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed +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. diff --git a/base_territory/static/description/index.html b/base_territory/static/description/index.html index cb4498ef17..29c81b7253 100644 --- a/base_territory/static/description/index.html +++ b/base_territory/static/description/index.html @@ -1,20 +1,20 @@ - + - + Base Territory + + +
+

Fieldservice Survey

+ + +

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

+

This module introduces enhanced survey functionalities in the Field Service module, streamlining the process of collecting and analyzing feedback for service orders. Users can seamlessly navigate to Field Service, access settings, and select a customized FSM Order Survey Template. When generating a new order, the system prompts users to submit a survey, facilitating efficient data collection.

+

The module further extends capabilities by incorporating an intuitive “Survey Answer” button within the order interface. This button provides users with the flexibility to either view comprehensive statistics derived from survey responses or directly edit the survey for any necessary adjustments.

+

With the Field Service Survey Enhancements module, businesses can effortlessly manage and optimize their survey processes, gaining valuable insights into service performance and customer satisfaction.

+

Table of contents

+ +
+

Usage

+
    +
  • Navigate to Field Service
  • +
  • Go to Settings
  • +
  • Choose a FSM Order Survey Template
  • +
  • Generate a new order
  • +
  • Submit Survey
  • +
  • Access the “Survey Answer” button in the order to either view the statistics or edit the survey.
  • +
+
+
+

Known issues / Roadmap

+
    +
  • Improve survey data integrity by updating the fsm_order_person_id field in response to changes in the field service order’s person_id.
  • +
+
+
+

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

+
    +
  • Escodoo
  • +
+
+
+

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/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_survey/tests/__init__.py b/fieldservice_survey/tests/__init__.py new file mode 100644 index 0000000000..a10d48a708 --- /dev/null +++ b/fieldservice_survey/tests/__init__.py @@ -0,0 +1,2 @@ +from . import test_fsm_order +from . import test_fsm_order_survey_submit diff --git a/fieldservice_survey/tests/test_fsm_order.py b/fieldservice_survey/tests/test_fsm_order.py new file mode 100644 index 0000000000..ee9c325be8 --- /dev/null +++ b/fieldservice_survey/tests/test_fsm_order.py @@ -0,0 +1,47 @@ +# Copyright 2023 - TODAY, Kaynnan Lemes +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from datetime import datetime, timedelta + +from odoo.tests.common import TransactionCase + + +class TestFsmOrderSurveySubmit(TransactionCase): + def setUp(self): + super(TestFsmOrderSurveySubmit, self).setUp() + self.test_loc_partner = self.env["res.partner"].create( + {"name": "Test Loc Partner", "phone": "ABC", "email": "tlp@email.com"} + ) + self.test_location = self.env["fsm.location"].create( + { + "name": "Test Location", + "phone": "123", + "email": "tp@email.com", + "partner_id": self.test_loc_partner.id, + "owner_id": self.test_loc_partner.id, + } + ) + self.fsm_order = self.env["fsm.order"].create( + { + "location_id": self.test_location.id, + "date_start": datetime.today(), + "date_end": datetime.today() + timedelta(hours=2), + "request_early": datetime.today(), + } + ) + + def test_action_submit_fsm_order_survey(self): + result = self.fsm_order.action_submit_fsm_order_survey() + self.assertEqual(result["type"], "ir.actions.act_window") + self.assertEqual(result["view_mode"], "form") + self.assertEqual(result["res_model"], "fsm.order.survey.submit") + self.assertEqual(result["target"], "new") + self.assertEqual(result["name"], "Submit Survey ") + + def test_action_open_survey_inputs(self): + result = self.fsm_order.action_open_survey_inputs() + expected_url = "/fsm_order/{}/results/".format(self.fsm_order.id) + self.assertEqual(result["type"], "ir.actions.act_url") + self.assertEqual(result["name"], "Survey Answer") + self.assertEqual(result["target"], "self") + self.assertEqual(result["url"], expected_url) diff --git a/fieldservice_survey/tests/test_fsm_order_survey_submit.py b/fieldservice_survey/tests/test_fsm_order_survey_submit.py new file mode 100644 index 0000000000..1bc529d34f --- /dev/null +++ b/fieldservice_survey/tests/test_fsm_order_survey_submit.py @@ -0,0 +1,180 @@ +# Copyright 2023 - TODAY, Kaynnan Lemes +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from datetime import datetime, timedelta + +from dateutil.relativedelta import relativedelta + +from odoo import fields +from odoo.tests.common import TransactionCase + + +class TestFsmOrder(TransactionCase): + def setUp(self): + super(TestFsmOrder, self).setUp() + self.test_loc_partner = self.env["res.partner"].create( + {"name": "Test Loc Partner", "phone": "ABC", "email": "tlp@email.com"} + ) + self.test_location = self.env["fsm.location"].create( + { + "name": "Test Location", + "phone": "123", + "email": "tp@email.com", + "partner_id": self.test_loc_partner.id, + "owner_id": self.test_loc_partner.id, + } + ) + self.fsm_order = self.env["fsm.order"].create( + { + "location_id": self.test_location.id, + "date_start": datetime.today(), + "date_end": datetime.today() + timedelta(hours=2), + "request_early": datetime.today(), + } + ) + self.survey_template = self.env.ref( + "fieldservice_survey.customer_satisfaction_survey" + ) + self.template = self.env.ref( + "fieldservice_survey.mail_template_fsm_order_survey_submit" + ) + self.survey_submit_wizard = self.env["fsm.order.survey.submit"].create( + { + "fsm_order_id": self.fsm_order.id, + "fsm_order_person_id": self.fsm_order.person_id.id, + "email_from": "test@example.com", + "author_id": self.test_loc_partner.id, + "template_id": self.template.id, + "survey_template_id": self.survey_template.id, + "recipient_ids": [(6, 0, [self.fsm_order.location_id.partner_id.id])], + "deadline": fields.Date.today() + relativedelta(months=1), + } + ) + + def test_get_default_deadline(self): + default_deadline = self.survey_submit_wizard._get_default_deadline() + expected_deadline = fields.Date.today() + relativedelta(months=1) + self.assertEqual(default_deadline, expected_deadline) + + def test_default_get(self): + fields_list = ["survey_template_id"] + self.env.context = {"active_id": self.fsm_order.id} + self.survey_submit_wizard.env.user.email = "test@example.com" + result = self.survey_submit_wizard.default_get(fields_list) + expected_survey_template_id = ( + self.fsm_order.company_id.fsm_order_survey_template_id.id + ) + self.assertEqual(result.get("survey_template_id"), expected_survey_template_id) + + def test_compute_recipients(self): + self.survey_submit_wizard._compute_recipients() + expected_recipients = ( + self.survey_submit_wizard.fsm_order_id.location_id.partner_id + ) + self.assertEqual(self.survey_submit_wizard.recipient_ids, expected_recipients) + + def test_compute_subject(self): + self.survey_submit_wizard._compute_subject() + expected_subject = self.template.subject + self.assertEqual(self.survey_submit_wizard.subject, expected_subject) + + def test_prepare_survey_answers(self): + recipients = self.survey_submit_wizard.recipient_ids + existing_answers = self.env["survey.user_input"].search( + [ + ("survey_id", "=", self.survey_submit_wizard.survey_template_id.id), + ("fsm_order_id", "=", self.survey_submit_wizard.fsm_order_id.id), + ("partner_id", "in", recipients.ids), + ] + ) + partners_done = existing_answers.mapped("partner_id") + answers = self.survey_submit_wizard._prepare_survey_answers(recipients) + + missing_answers = recipients - partners_done + + self.assertTrue( + all( + any(answer.partner_id == new_partner for answer in answers) + for new_partner in missing_answers + ), + "Survey answer not created for partner", + ) + + self.assertTrue( + all( + any(answer.partner_id == partner_done for answer in answers) + for partner_done in partners_done + ), + "Existing survey answer not included for partner", + ) + + def test_send_mail(self): + self.maxDiff = None + answer = self.env["survey.user_input"].create( + { + "survey_id": self.survey_template.id, + "email": "recipient@example.com", + "partner_id": self.test_loc_partner.id, + } + ) + ctx = {"fsm_order_name": self.fsm_order.name} + RenderMixin = self.env["mail.render.mixin"].with_context(**ctx) + subject = RenderMixin._render_template( + self.survey_submit_wizard.subject, + "survey.user_input", + answer.ids, + post_process=True, + )[answer.id] + + self.env.ref("mail.mail_notification_light") + mail = self.survey_submit_wizard._send_mail(answer) + self.env.ref("mail.mail_notification_light").unlink() + + self.assertTrue(mail) + self.assertEqual(mail.email_from, self.survey_submit_wizard.email_from) + self.assertEqual(mail.author_id.id, self.survey_submit_wizard.author_id.id) + self.assertEqual(mail.subject, subject) + self.assertEqual(mail.attachment_ids, self.survey_submit_wizard.attachment_ids) + self.assertEqual(mail.recipient_ids.ids, [answer.partner_id.id]) + + def test_send_mail_no_partner(self): + self.maxDiff = None + + answer = self.env["survey.user_input"].create( + { + "survey_id": self.survey_template.id, + "email": "recipient@example.com", + } + ) + ctx = {"fsm_order_name": self.fsm_order.name} + RenderMixin = self.env["mail.render.mixin"].with_context(**ctx) + subject = RenderMixin._render_template( + self.survey_submit_wizard.subject, + "survey.user_input", + answer.ids, + post_process=True, + )[answer.id] + mail = self.survey_submit_wizard._send_mail(answer) + + self.assertTrue(mail) + self.assertEqual(mail.email_from, self.survey_submit_wizard.email_from) + self.assertEqual(mail.author_id.id, self.survey_submit_wizard.author_id.id) + self.assertEqual(mail.subject, subject) + self.assertEqual(mail.attachment_ids, self.survey_submit_wizard.attachment_ids) + self.assertEqual(mail.email_to, answer.email) + + def test_action_send(self): + recipients = self.survey_submit_wizard.recipient_ids + answers = self.survey_submit_wizard._prepare_survey_answers(recipients) + + self.survey_submit_wizard._send_mail(answers) + self.survey_submit_wizard.fsm_order_id = self.fsm_order + + result = self.survey_submit_wizard.action_send() + + self.assertTrue(result["type"], "ir.actions.act_window_close") + self.assertEqual( + self.fsm_order.partner_submitted_answer_survey_ids, + self.survey_submit_wizard.recipient_ids, + ) + self.assertEqual(len(answers), len(self.survey_submit_wizard.recipient_ids)) diff --git a/fieldservice_survey/views/fsm_order.xml b/fieldservice_survey/views/fsm_order.xml new file mode 100644 index 0000000000..b21b33f2e6 --- /dev/null +++ b/fieldservice_survey/views/fsm_order.xml @@ -0,0 +1,59 @@ + + + + + + fsm.order.form (in fieldservice_survey) + fsm.order + + + + + + + + + + + + + + + +