diff --git a/fieldservice_order_property/README.rst b/fieldservice_order_property/README.rst new file mode 100644 index 0000000000..75917e9eb0 --- /dev/null +++ b/fieldservice_order_property/README.rst @@ -0,0 +1,97 @@ +============================ +Field Service Order_Property +============================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:4313d0f9c2af696a8028514e9abef93e599ee85dbbda8d999e06c7af67053942 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Ffield--service-lightgray.png?logo=github + :target: https://github.com/OCA/field-service/tree/17.0/fieldservice_order_property + :alt: OCA/field-service +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/field-service-17-0/field-service-17-0-fieldservice_order_property + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/field-service&target_branch=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module enables property management in field service orders. +Properties are shared across all field service orders within the same +field service team. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +Add property fields: + +1. Go to Field Service and create or edit a record. +2. Click ⚙ **Add Properties** → select a **Field Type**, and optionally + add a default value. Check **View in Kanban** to display the fields + in kanban views. Click anywhere to validate and close the dialog. +3. The displayed properties automatically adjust based on the team + associated with the record. + +Delete property fields: + +1. Click the pencil icon next to the targeted property, then click + Delete. + +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 +------- + +* Binhex + +Contributors +------------ + +- `Binhex `__: + + - Rolando Pérez + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/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_order_property/__init__.py b/fieldservice_order_property/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/fieldservice_order_property/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/fieldservice_order_property/__manifest__.py b/fieldservice_order_property/__manifest__.py new file mode 100644 index 0000000000..9594ff2fa6 --- /dev/null +++ b/fieldservice_order_property/__manifest__.py @@ -0,0 +1,13 @@ +{ + "name": "Field Service Order_Property", + "summary": "Manage custom properties for Field Service Orders", + "author": "Binhex, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/field-service", + "category": "Field Service", + "version": "18.0.1.0.0", + "depends": ["fieldservice"], + "data": [ + "views/fsm_order_views.xml", + ], + "license": "AGPL-3", +} diff --git a/fieldservice_order_property/models/__init__.py b/fieldservice_order_property/models/__init__.py new file mode 100644 index 0000000000..3c6f82f0b8 --- /dev/null +++ b/fieldservice_order_property/models/__init__.py @@ -0,0 +1,2 @@ +from . import fsm_team +from . import fsm_order diff --git a/fieldservice_order_property/models/fsm_order.py b/fieldservice_order_property/models/fsm_order.py new file mode 100644 index 0000000000..8105787d18 --- /dev/null +++ b/fieldservice_order_property/models/fsm_order.py @@ -0,0 +1,14 @@ +# Copyright 2026 Binhex - Rolando Pérez +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class FSMOrder(models.Model): + _inherit = "fsm.order" + + fsm_order_properties = fields.Properties( + "Properties", + definition="team_id.fsm_order_properties_definition", + copy=True, + ) diff --git a/fieldservice_order_property/models/fsm_team.py b/fieldservice_order_property/models/fsm_team.py new file mode 100644 index 0000000000..b8032466d0 --- /dev/null +++ b/fieldservice_order_property/models/fsm_team.py @@ -0,0 +1,12 @@ +# Copyright 2026 Binhex - Rolando Pérez +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class FSMTeam(models.Model): + _inherit = "fsm.team" + + fsm_order_properties_definition = fields.PropertiesDefinition( + "FSM Order Properties" + ) diff --git a/fieldservice_order_property/pyproject.toml b/fieldservice_order_property/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/fieldservice_order_property/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/fieldservice_order_property/readme/CONTRIBUTORS.md b/fieldservice_order_property/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..cb9586f0d6 --- /dev/null +++ b/fieldservice_order_property/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- [Binhex](https://binhex.cloud): + - Rolando Pérez diff --git a/fieldservice_order_property/readme/DESCRIPTION.md b/fieldservice_order_property/readme/DESCRIPTION.md new file mode 100644 index 0000000000..da7ca5f816 --- /dev/null +++ b/fieldservice_order_property/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module enables property management in field service orders. Properties are shared across all field service orders within the same field service team. diff --git a/fieldservice_order_property/readme/USAGE.md b/fieldservice_order_property/readme/USAGE.md new file mode 100644 index 0000000000..56eff5360c --- /dev/null +++ b/fieldservice_order_property/readme/USAGE.md @@ -0,0 +1,9 @@ +Add property fields: + +1. Go to Field Service and create or edit a record. +2. Click ⚙ **Add Properties** → select a **Field Type**, and optionally add a default value. Check **View in Kanban** to display the fields in kanban views. Click anywhere to validate and close the dialog. +3. The displayed properties automatically adjust based on the team associated with the record. + +Delete property fields: + +1. Click the pencil icon next to the targeted property, then click Delete. diff --git a/fieldservice_order_property/static/description/icon.png b/fieldservice_order_property/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/fieldservice_order_property/static/description/icon.png differ diff --git a/fieldservice_order_property/static/description/index.html b/fieldservice_order_property/static/description/index.html new file mode 100644 index 0000000000..ccd048d2b1 --- /dev/null +++ b/fieldservice_order_property/static/description/index.html @@ -0,0 +1,446 @@ + + + + + +Field Service Order_Property + + + +
+

Field Service Order_Property

+ + +

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

+

This module enables property management in field service orders. +Properties are shared across all field service orders within the same +field service team.

+

Table of contents

+ +
+

Usage

+

Add property fields:

+
    +
  1. Go to Field Service and create or edit a record.
  2. +
  3. Click ⚙ Add Properties → select a Field Type, and optionally +add a default value. Check View in Kanban to display the fields +in kanban views. Click anywhere to validate and close the dialog.
  4. +
  5. The displayed properties automatically adjust based on the team +associated with the record.
  6. +
+

Delete property fields:

+
    +
  1. Click the pencil icon next to the targeted property, then click +Delete.
  2. +
+
+
+

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

+
    +
  • Binhex
  • +
+
+
+

Contributors

+
    +
  • Binhex:
      +
    • Rolando Pérez
    • +
    +
  • +
+
+
+

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_order_property/tests/__init__.py b/fieldservice_order_property/tests/__init__.py new file mode 100644 index 0000000000..b27da9a119 --- /dev/null +++ b/fieldservice_order_property/tests/__init__.py @@ -0,0 +1 @@ +from . import test_fsm_order diff --git a/fieldservice_order_property/tests/test_fsm_order.py b/fieldservice_order_property/tests/test_fsm_order.py new file mode 100644 index 0000000000..e9dd3feb28 --- /dev/null +++ b/fieldservice_order_property/tests/test_fsm_order.py @@ -0,0 +1,40 @@ +# Copyright 2024 Tecnativa - Pilar Vargas +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.addons.base.tests.common import BaseCommon + + +class TestFSMOrder(BaseCommon): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.team_a = cls.env.ref("fieldservice.fsm_team_default") + properties_def = [ + {"name": "date", "type": "date", "string": "Date", "default": "2026-01-01"}, + { + "name": "integer", + "type": "integer", + "string": "ID", + "default": 1, + }, + ] + cls.team_a.fsm_order_properties_definition = properties_def + cls.team_b = cls.env["fsm.team"].create({"name": "Team B"}) + cls.test_location = cls.env.ref("fieldservice.test_location") + cls.fsm_order_team_a = cls.env["fsm.order"].create( + { + "name": "Test Order Team A", + "team_id": cls.team_a.id, + "location_id": cls.test_location.id, + } + ) + + def test_fsm_order_properties_within_team(self): + self.fsm_order_team_a.fsm_order_properties = { + "date": "2026-01-03", + "integer": 5, + } + + properties = self.fsm_order_team_a.fsm_order_properties + self.assertEqual(len(properties), 2) + self.assertFalse(self.team_b.fsm_order_properties_definition) diff --git a/fieldservice_order_property/views/fsm_order_views.xml b/fieldservice_order_property/views/fsm_order_views.xml new file mode 100644 index 0000000000..2ff9181cca --- /dev/null +++ b/fieldservice_order_property/views/fsm_order_views.xml @@ -0,0 +1,41 @@ + + + + fsm.order + + + + + + + + + + + fsm.order + + + + + + +
+ +
+
+
+
+ + fsm.order + + + + + + + +