From ff29f477017718980a865213f19156db1ab995c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Todorovich?= Date: Thu, 21 Nov 2024 12:12:07 -0300 Subject: [PATCH 1/2] [FIX] fieldservice_stage_validation: missing rights to read validate_field_ids --- fieldservice_stage_validation/__manifest__.py | 5 ++++- fieldservice_stage_validation/models/fsm_stage.py | 1 - fieldservice_stage_validation/models/validate_utils.py | 2 +- fieldservice_stage_validation/security/ir.model.access.csv | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 fieldservice_stage_validation/security/ir.model.access.csv diff --git a/fieldservice_stage_validation/__manifest__.py b/fieldservice_stage_validation/__manifest__.py index a4414d775a..ce51d91068 100644 --- a/fieldservice_stage_validation/__manifest__.py +++ b/fieldservice_stage_validation/__manifest__.py @@ -8,7 +8,10 @@ "author": "Brian McMaster, Odoo Community Association (OCA)", "website": "https://github.com/OCA/field-service", "depends": ["fieldservice"], - "data": ["views/fsm_stage.xml"], + "data": [ + "security/ir.model.access.csv", + "views/fsm_stage.xml", + ], "license": "AGPL-3", "development_status": "Beta", "maintainers": ["brian10048", "max3903"], diff --git a/fieldservice_stage_validation/models/fsm_stage.py b/fieldservice_stage_validation/models/fsm_stage.py index 5063f41880..915afe0610 100644 --- a/fieldservice_stage_validation/models/fsm_stage.py +++ b/fieldservice_stage_validation/models/fsm_stage.py @@ -11,7 +11,6 @@ class FSMStage(models.Model): string="Fields to Validate", help="Select fields which must be set on the document in this stage", ) - stage_type_model_id = fields.Many2one( "ir.model", compute="_compute_stage_model", diff --git a/fieldservice_stage_validation/models/validate_utils.py b/fieldservice_stage_validation/models/validate_utils.py index 04894793e2..309fed806c 100644 --- a/fieldservice_stage_validation/models/validate_utils.py +++ b/fieldservice_stage_validation/models/validate_utils.py @@ -8,7 +8,7 @@ def validate_stage_fields(records): for rec in records: stage = rec.stage_id - field_ids = stage.validate_field_ids + field_ids = stage.sudo().validate_field_ids field_names = [x.name for x in field_ids] values = rec.read(field_names) diff --git a/fieldservice_stage_validation/security/ir.model.access.csv b/fieldservice_stage_validation/security/ir.model.access.csv new file mode 100644 index 0000000000..dcd7291bb9 --- /dev/null +++ b/fieldservice_stage_validation/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_ir_model_field,ir_model_fields fsm,base.model_ir_model_fields,fieldservice.group_fsm_user_own,1,0,0,0 From 78d47ef4a08fd103a77d425e7e4725a4a08376c4 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Tue, 26 Nov 2024 15:40:50 +0000 Subject: [PATCH 2/2] [BOT] post-merge updates --- README.md | 2 +- fieldservice_stage_validation/README.rst | 20 +++++++++---------- fieldservice_stage_validation/__manifest__.py | 2 +- .../static/description/index.html | 13 +++++++----- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index da3d17f862..71bfdd378c 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ addon | version | maintainers | summary [fieldservice_sale_stock](fieldservice_sale_stock/) | 17.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/) | 17.0.1.0.0 | [![brian10048](https://github.com/brian10048.png?size=30px)](https://github.com/brian10048) | Manage Sizes for Field Service Locations and Orders [fieldservice_stage_server_action](fieldservice_stage_server_action/) | 17.0.1.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) [![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/) | 17.0.1.0.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_stage_validation](fieldservice_stage_validation/) | 17.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/) | 17.0.1.0.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 the logistics operations with Field Service [fieldservice_stock_request](fieldservice_stock_request/) | 17.0.1.0.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 Requests with Field Service Orders [fieldservice_vehicle](fieldservice_vehicle/) | 17.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) | Manage Field Service vehicles and assign drivers diff --git a/fieldservice_stage_validation/README.rst b/fieldservice_stage_validation/README.rst index 5d03a71cc1..6922f6970a 100644 --- a/fieldservice_stage_validation/README.rst +++ b/fieldservice_stage_validation/README.rst @@ -7,7 +7,7 @@ FSM Stage Validation !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:1ced40d5e26a6495ac55732e9d6ba749aa76729869fa24363ba8b7d8ccaa03b1 + !! source digest: sha256:7fa9a31f4e7c1c88e82c034446dde98d5561190967fd4b8274010856ad8fcc46 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png @@ -47,16 +47,16 @@ is available to be applied to each document type. Configuration ============= -- Go to Field Service > Configuration > Stages -- Create or select a stage -- Select one or more fields to be validated +- Go to Field Service > Configuration > Stages +- Create or select a stage +- Select one or more fields to be validated Usage ===== -- Follow steps outlined in Configuration. -- User will receive validation error if a field is not set when - attempting to move to a new stage. +- Follow steps outlined in Configuration. +- User will receive validation error if a field is not set when + attempting to move to a new stage. Known issues / Roadmap ====================== @@ -85,10 +85,10 @@ Authors Contributors ------------ -- Brian McMaster -- `APSL `__: +- Brian McMaster +- `APSL `__: - - Antoni Marroig + - Antoni Marroig Maintainers ----------- diff --git a/fieldservice_stage_validation/__manifest__.py b/fieldservice_stage_validation/__manifest__.py index ce51d91068..4d5dbc75e4 100644 --- a/fieldservice_stage_validation/__manifest__.py +++ b/fieldservice_stage_validation/__manifest__.py @@ -3,7 +3,7 @@ { "name": "FSM Stage Validation", "summary": "Validate input data when reaching a Field Service stage", - "version": "17.0.1.0.0", + "version": "17.0.1.1.0", "category": "Field Service", "author": "Brian McMaster, Odoo Community Association (OCA)", "website": "https://github.com/OCA/field-service", diff --git a/fieldservice_stage_validation/static/description/index.html b/fieldservice_stage_validation/static/description/index.html index 9a7ff5ae10..825447f8b8 100644 --- a/fieldservice_stage_validation/static/description/index.html +++ b/fieldservice_stage_validation/static/description/index.html @@ -8,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -274,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -300,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -366,7 +367,7 @@

FSM Stage Validation

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:1ced40d5e26a6495ac55732e9d6ba749aa76729869fa24363ba8b7d8ccaa03b1 +!! source digest: sha256:7fa9a31f4e7c1c88e82c034446dde98d5561190967fd4b8274010856ad8fcc46 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

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

As the stage of a field service document progresses, it may be important @@ -442,7 +443,9 @@

Contributors

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +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.