From a014e44268fde78f042be557b43b944a5a979187 Mon Sep 17 00:00:00 2001 From: brian10048 Date: Fri, 17 Apr 2020 10:54:06 -0400 Subject: [PATCH 01/37] [ADD] fieldservice_stage_validation --- fieldservice_stage_validation/README.rst | 0 fieldservice_stage_validation/__init__.py | 2 ++ fieldservice_stage_validation/__manifest__.py | 22 +++++++++++++ .../models/__init__.py | 9 +++++ .../models/fsm_equipment.py | 22 +++++++++++++ .../models/fsm_location.py | 22 +++++++++++++ .../models/fsm_order.py | 22 +++++++++++++ .../models/fsm_person.py | 22 +++++++++++++ .../models/fsm_stage.py | 31 ++++++++++++++++++ .../readme/CONFIGURE.rst | 3 ++ .../readme/CONTRIBUTORS.rst | 1 + .../readme/DESCRIPTION.rst | 10 ++++++ .../readme/ROADMAP.rst | 2 ++ .../readme/USAGE.rst | 3 ++ .../static/description/icon.png | Bin 0 -> 17808 bytes .../static/description/index.html | 0 .../views/fsm_stage.xml | 17 ++++++++++ 17 files changed, 188 insertions(+) create mode 100644 fieldservice_stage_validation/README.rst create mode 100644 fieldservice_stage_validation/__init__.py create mode 100644 fieldservice_stage_validation/__manifest__.py create mode 100644 fieldservice_stage_validation/models/__init__.py create mode 100644 fieldservice_stage_validation/models/fsm_equipment.py create mode 100644 fieldservice_stage_validation/models/fsm_location.py create mode 100644 fieldservice_stage_validation/models/fsm_order.py create mode 100644 fieldservice_stage_validation/models/fsm_person.py create mode 100644 fieldservice_stage_validation/models/fsm_stage.py create mode 100644 fieldservice_stage_validation/readme/CONFIGURE.rst create mode 100644 fieldservice_stage_validation/readme/CONTRIBUTORS.rst create mode 100644 fieldservice_stage_validation/readme/DESCRIPTION.rst create mode 100644 fieldservice_stage_validation/readme/ROADMAP.rst create mode 100644 fieldservice_stage_validation/readme/USAGE.rst create mode 100644 fieldservice_stage_validation/static/description/icon.png create mode 100644 fieldservice_stage_validation/static/description/index.html create mode 100644 fieldservice_stage_validation/views/fsm_stage.xml diff --git a/fieldservice_stage_validation/README.rst b/fieldservice_stage_validation/README.rst new file mode 100644 index 0000000000..e69de29bb2 diff --git a/fieldservice_stage_validation/__init__.py b/fieldservice_stage_validation/__init__.py new file mode 100644 index 0000000000..2acc0e96c4 --- /dev/null +++ b/fieldservice_stage_validation/__init__.py @@ -0,0 +1,2 @@ +# Copyright (C) 2020 Brian McMaster +from . import models diff --git a/fieldservice_stage_validation/__manifest__.py b/fieldservice_stage_validation/__manifest__.py new file mode 100644 index 0000000000..469fe6f0ce --- /dev/null +++ b/fieldservice_stage_validation/__manifest__.py @@ -0,0 +1,22 @@ +# Copyright (C) 2020 Brian McMaster +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +{ + 'name': 'FSM Stage Validation', + 'summary': 'Validate input data when reaching a Field Service stage', + 'version': '12.0.0.1.0', + 'category': 'Field Service', + 'author': 'Brian McMaster, Odoo Community Association (OCA)', + 'website': 'https://github.com/OCA/field-service', + 'depends': [ + 'fieldservice', + ], + 'data': [ + 'views/fsm_stage.xml', + ], + 'license': 'AGPL-3', + 'development_status': 'Beta', + 'maintainers': [ + 'brian10048', + 'max3903', + ], +} diff --git a/fieldservice_stage_validation/models/__init__.py b/fieldservice_stage_validation/models/__init__.py new file mode 100644 index 0000000000..3afd424292 --- /dev/null +++ b/fieldservice_stage_validation/models/__init__.py @@ -0,0 +1,9 @@ +# Copyright (C) 2020 Brian McMaster +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from . import ( + fsm_stage, + fsm_order, + fsm_equipment, + fsm_location, + fsm_person, +) diff --git a/fieldservice_stage_validation/models/fsm_equipment.py b/fieldservice_stage_validation/models/fsm_equipment.py new file mode 100644 index 0000000000..14beb0b8fc --- /dev/null +++ b/fieldservice_stage_validation/models/fsm_equipment.py @@ -0,0 +1,22 @@ +# Copyright (C) 2020 Brian McMaster +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import _, api, models +from odoo.exceptions import ValidationError + + +class FSMEquipment(models.Model): + _inherit = 'fsm.equipment' + + @api.constrains('stage_id') + def _validate_stage_fields(self): + for rec in self: + stage = rec.stage_id + field_ids = stage.validate_field_ids + field_names = [x.name for x in field_ids] + values = rec.read(field_names) + + for name in field_names: + if values[0][name] == False: + raise ValidationError(_('Cannot move to stage "%s" ' \ + 'until the "%s" field is set.' + % (stage.name, name))) diff --git a/fieldservice_stage_validation/models/fsm_location.py b/fieldservice_stage_validation/models/fsm_location.py new file mode 100644 index 0000000000..208f0cfc5f --- /dev/null +++ b/fieldservice_stage_validation/models/fsm_location.py @@ -0,0 +1,22 @@ +# Copyright (C) 2020 Brian McMaster +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import _, api, models +from odoo.exceptions import ValidationError + + +class FSMLocation(models.Model): + _inherit = 'fsm.location' + + @api.constrains('stage_id') + def _validate_stage_fields(self): + for rec in self: + stage = rec.stage_id + field_ids = stage.validate_field_ids + field_names = [x.name for x in field_ids] + values = rec.read(field_names) + + for name in field_names: + if values[0][name] == False: + raise ValidationError(_('Cannot move to stage "%s" ' \ + 'until the "%s" field is set.' + % (stage.name, name))) diff --git a/fieldservice_stage_validation/models/fsm_order.py b/fieldservice_stage_validation/models/fsm_order.py new file mode 100644 index 0000000000..4b2861789a --- /dev/null +++ b/fieldservice_stage_validation/models/fsm_order.py @@ -0,0 +1,22 @@ +# Copyright (C) 2020 Brian McMaster +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import _, api, models +from odoo.exceptions import ValidationError + + +class FSMOrder(models.Model): + _inherit = 'fsm.order' + + @api.constrains('stage_id') + def _validate_stage_fields(self): + for rec in self: + stage = rec.stage_id + field_ids = stage.validate_field_ids + field_names = [x.name for x in field_ids] + values = rec.read(field_names) + + for name in field_names: + if values[0][name] == False: + raise ValidationError(_('Cannot move to stage "%s" ' \ + 'until the "%s" field is set.' + % (stage.name, name))) diff --git a/fieldservice_stage_validation/models/fsm_person.py b/fieldservice_stage_validation/models/fsm_person.py new file mode 100644 index 0000000000..12565ee542 --- /dev/null +++ b/fieldservice_stage_validation/models/fsm_person.py @@ -0,0 +1,22 @@ +# Copyright (C) 2020 Brian McMaster +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import _, api, models +from odoo.exceptions import ValidationError + + +class FSMPerson(models.Model): + _inherit = 'fsm.person' + + @api.constrains('stage_id') + def _validate_stage_fields(self): + for rec in self: + stage = rec.stage_id + field_ids = stage.validate_field_ids + field_names = [x.name for x in field_ids] + values = rec.read(field_names) + + for name in field_names: + if values[0][name] == False: + raise ValidationError(_('Cannot move to stage "%s" ' \ + 'until the "%s" field is set.' + % (stage.name, name))) diff --git a/fieldservice_stage_validation/models/fsm_stage.py b/fieldservice_stage_validation/models/fsm_stage.py new file mode 100644 index 0000000000..7f0ba54d60 --- /dev/null +++ b/fieldservice_stage_validation/models/fsm_stage.py @@ -0,0 +1,31 @@ +# Copyright (C) 2020 Brian McMaster +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import api, fields, models + + +class FSMStage(models.Model): + _inherit = 'fsm.stage' + + @api.depends('stage_type') + def _compute_stage_model(self): + model_id = False + Model = self.env['ir.model'] + for rec in self: + if rec.stage_type: + model_string = 'fsm.' + rec.stage_type + model_id = Model.search( + [('model', '=', model_string)], limit=1).id + rec.stage_type_model_id = model_id + + validate_field_ids = fields.Many2many( + 'ir.model.fields', + 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, + string='Model for Stage', + help='Technical field to hold model type', + ) diff --git a/fieldservice_stage_validation/readme/CONFIGURE.rst b/fieldservice_stage_validation/readme/CONFIGURE.rst new file mode 100644 index 0000000000..6a65fe20d3 --- /dev/null +++ b/fieldservice_stage_validation/readme/CONFIGURE.rst @@ -0,0 +1,3 @@ +* Go to Field Service > Configuration > Stages +* Create or select a stage +* Select one or more fields to be validated diff --git a/fieldservice_stage_validation/readme/CONTRIBUTORS.rst b/fieldservice_stage_validation/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..39ef3fa3d7 --- /dev/null +++ b/fieldservice_stage_validation/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Brian McMaster diff --git a/fieldservice_stage_validation/readme/DESCRIPTION.rst b/fieldservice_stage_validation/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..b1b881b644 --- /dev/null +++ b/fieldservice_stage_validation/readme/DESCRIPTION.rst @@ -0,0 +1,10 @@ +As the stage of a field service document progresses, it may be important for +specific fields of the document be completed. + +For example, when a field service order enters the 'Complete' stage, the +fields for 'Actual End Date' and/or 'Resolution Notes' should be set. + +This module allows you to raise a Validation Error if the designated fields +are not set when moving to a new stage. Since stages can be used for field +service orders, workers, locations, or equipments, this logic is available +to be applied to each document type. diff --git a/fieldservice_stage_validation/readme/ROADMAP.rst b/fieldservice_stage_validation/readme/ROADMAP.rst new file mode 100644 index 0000000000..f607015959 --- /dev/null +++ b/fieldservice_stage_validation/readme/ROADMAP.rst @@ -0,0 +1,2 @@ +The roadmap of the Field Service application is documented on +`Github `_. diff --git a/fieldservice_stage_validation/readme/USAGE.rst b/fieldservice_stage_validation/readme/USAGE.rst new file mode 100644 index 0000000000..68abde94a1 --- /dev/null +++ b/fieldservice_stage_validation/readme/USAGE.rst @@ -0,0 +1,3 @@ +*Follow steps outlined in Configuration. +*User will receive validation error if a field is not set when +attempting to move to a new stage. diff --git a/fieldservice_stage_validation/static/description/icon.png b/fieldservice_stage_validation/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..955674d8f0b8c47de3ffa9db25cb109fbe4a1091 GIT binary patch literal 17808 zcmeHvc;{H3sucZElF-G)hC-+rdy@|cVP3o7ETY&& zJl-5>)T;P#Y>Z2k74p9gK&J2CJC5%@{WsV@`$(=#w|Cf>44L@opuIqTY_XMpYif9< zJEhZ)*(Ciawd2E4g!g{`tf-6DV*W@FZ!b&?uih_mMpBM%8|x61r3D=Pkjl)*LT52YNq;hIj5|udFA)RjvAIV zR;k3*$i5qSsi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PTs)6LjtvE4+oq zO>t&E^fTM;A=cV%8JzPn3PB&kAXl2KhW?Nd85wzJlx#0ijShXJW?6qNFT5WHgX*`4 znAw6(otBnuX*CHI7J32YAFrpeFe*%n?tiX`q=R&agxqy8y^(5Q$_ZB`XM!tI*GZbX z(X#_0LZp6h^6*3~mEHhT0b`4Yup6AXVlpn+Q7tknyZpxvuEohyH{$F=!8mZnEQAjI zQ46(s-Yaz;wNUgv&W5ThKB{W3(9dUm{iObJMRL?`A=vQt%jg)l{#&O4GI+#Kwjew0nySosF+@T>xBYngWHD;bxF;7b-%>cT74(~!j za)0gM!|>0eyS75X+B()YfAk)l$Phu_s10UQ8K<;`o;##M&SgtTuC$&4T{~TLYh~dK zLm$LxbZ^z;{Wl*6GW5?iFeeetYLG-nRdM6TR)K?1<#+hD&;m{|(ME|BrHBci#pV0oF(@prIFR=LEDdC|` z$6e@>ZBk~p1x{c}1ap=W1^2W?Z=AMy=;mO76+#5-nyl4XmK<5P7YCL|M_(NIF>`>^ z*RLK*lO8nwDMbFyjM$-Z6Jc-2q&bOb^^g1dhQG`X-*=g!K5kpSk08tH`uba$AEu(3 gUHh>HCdQ7*k1fAW1vhU(MTsEtw^U^Fq)ngxAO8EYHUIzs literal 0 HcmV?d00001 diff --git a/fieldservice_stage_validation/static/description/index.html b/fieldservice_stage_validation/static/description/index.html new file mode 100644 index 0000000000..e69de29bb2 diff --git a/fieldservice_stage_validation/views/fsm_stage.xml b/fieldservice_stage_validation/views/fsm_stage.xml new file mode 100644 index 0000000000..c8e69148ba --- /dev/null +++ b/fieldservice_stage_validation/views/fsm_stage.xml @@ -0,0 +1,17 @@ + + + + fsm.stage.validation.form + fsm.stage + + + + + + + + + + From be9822158abfe25f841444e8ca214357b2fcb06f Mon Sep 17 00:00:00 2001 From: brian10048 Date: Fri, 19 Jun 2020 15:29:38 -0400 Subject: [PATCH 02/37] [FIX] fieldservice_stage_validation Travis and miscellaneous errors --- fieldservice_stage_validation/README.rst | 113 +++++ .../i18n/fieldservice_stage_validation.pot | 69 +++ .../models/fsm_equipment.py | 4 +- .../models/fsm_location.py | 4 +- .../models/fsm_order.py | 4 +- .../models/fsm_person.py | 4 +- .../readme/USAGE.rst | 6 +- .../static/description/index.html | 452 ++++++++++++++++++ 8 files changed, 645 insertions(+), 11 deletions(-) create mode 100644 fieldservice_stage_validation/i18n/fieldservice_stage_validation.pot diff --git a/fieldservice_stage_validation/README.rst b/fieldservice_stage_validation/README.rst index e69de29bb2..e1deec3161 100644 --- a/fieldservice_stage_validation/README.rst +++ b/fieldservice_stage_validation/README.rst @@ -0,0 +1,113 @@ +==================== +FSM Stage Validation +==================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/12.0/fieldservice_stage_validation + :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-12-0/field-service-12-0-fieldservice_stage_validation + :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/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +As the stage of a field service document progresses, it may be important for +specific fields of the document be completed. + +For example, when a field service order enters the 'Complete' stage, the +fields for 'Actual End Date' and/or 'Resolution Notes' should be set. + +This module allows you to raise a Validation Error if the designated fields +are not set when moving to a new stage. Since stages can be used for field +service orders, workers, locations, or equipments, this logic is available +to be applied to each document type. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +* 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. + +Known issues / Roadmap +====================== + +The roadmap of the Field Service application is documented on +`Github `_. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Brian McMaster + +Contributors +~~~~~~~~~~~~ + +* Brian McMaster + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-brian10048| image:: https://github.com/brian10048.png?size=40px + :target: https://github.com/brian10048 + :alt: brian10048 +.. |maintainer-max3903| image:: https://github.com/max3903.png?size=40px + :target: https://github.com/max3903 + :alt: max3903 + +Current `maintainers `__: + +|maintainer-brian10048| |maintainer-max3903| + +This module is part of the `OCA/field-service `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/fieldservice_stage_validation/i18n/fieldservice_stage_validation.pot b/fieldservice_stage_validation/i18n/fieldservice_stage_validation.pot new file mode 100644 index 0000000000..441bcba59b --- /dev/null +++ b/fieldservice_stage_validation/i18n/fieldservice_stage_validation.pot @@ -0,0 +1,69 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_stage_validation +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: fieldservice_stage_validation +#: code:addons/fieldservice_stage_validation/models/fsm_equipment.py:22 +#: code:addons/fieldservice_stage_validation/models/fsm_location.py:22 +#: code:addons/fieldservice_stage_validation/models/fsm_order.py:22 +#: code:addons/fieldservice_stage_validation/models/fsm_person.py:22 +#, python-format +msgid "Cannot move to stage \"%s\" until the \"%s\" field is set." +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_equipment +msgid "Field Service Equipment" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_location +msgid "Field Service Location" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_order +msgid "Field Service Order" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_stage +msgid "Field Service Stage" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_person +msgid "Field Service Worker" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__validate_field_ids +msgid "Fields to Validate" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id +msgid "Model for Stage" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__validate_field_ids +msgid "Select fields which must be set on the document in this stage" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id +msgid "Technical field to hold model type" +msgstr "" + diff --git a/fieldservice_stage_validation/models/fsm_equipment.py b/fieldservice_stage_validation/models/fsm_equipment.py index 14beb0b8fc..87be00f34c 100644 --- a/fieldservice_stage_validation/models/fsm_equipment.py +++ b/fieldservice_stage_validation/models/fsm_equipment.py @@ -16,7 +16,7 @@ def _validate_stage_fields(self): values = rec.read(field_names) for name in field_names: - if values[0][name] == False: - raise ValidationError(_('Cannot move to stage "%s" ' \ + if not values[0][name]: + raise ValidationError(_('Cannot move to stage "%s" ' 'until the "%s" field is set.' % (stage.name, name))) diff --git a/fieldservice_stage_validation/models/fsm_location.py b/fieldservice_stage_validation/models/fsm_location.py index 208f0cfc5f..6d55316ef2 100644 --- a/fieldservice_stage_validation/models/fsm_location.py +++ b/fieldservice_stage_validation/models/fsm_location.py @@ -16,7 +16,7 @@ def _validate_stage_fields(self): values = rec.read(field_names) for name in field_names: - if values[0][name] == False: - raise ValidationError(_('Cannot move to stage "%s" ' \ + if not values[0][name]: + raise ValidationError(_('Cannot move to stage "%s" ' 'until the "%s" field is set.' % (stage.name, name))) diff --git a/fieldservice_stage_validation/models/fsm_order.py b/fieldservice_stage_validation/models/fsm_order.py index 4b2861789a..6aea0ee4ae 100644 --- a/fieldservice_stage_validation/models/fsm_order.py +++ b/fieldservice_stage_validation/models/fsm_order.py @@ -16,7 +16,7 @@ def _validate_stage_fields(self): values = rec.read(field_names) for name in field_names: - if values[0][name] == False: - raise ValidationError(_('Cannot move to stage "%s" ' \ + if not values[0][name]: + raise ValidationError(_('Cannot move to stage "%s" ' 'until the "%s" field is set.' % (stage.name, name))) diff --git a/fieldservice_stage_validation/models/fsm_person.py b/fieldservice_stage_validation/models/fsm_person.py index 12565ee542..8d369cffe0 100644 --- a/fieldservice_stage_validation/models/fsm_person.py +++ b/fieldservice_stage_validation/models/fsm_person.py @@ -16,7 +16,7 @@ def _validate_stage_fields(self): values = rec.read(field_names) for name in field_names: - if values[0][name] == False: - raise ValidationError(_('Cannot move to stage "%s" ' \ + if not values[0][name]: + raise ValidationError(_('Cannot move to stage "%s" ' 'until the "%s" field is set.' % (stage.name, name))) diff --git a/fieldservice_stage_validation/readme/USAGE.rst b/fieldservice_stage_validation/readme/USAGE.rst index 68abde94a1..19d952495a 100644 --- a/fieldservice_stage_validation/readme/USAGE.rst +++ b/fieldservice_stage_validation/readme/USAGE.rst @@ -1,3 +1,3 @@ -*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. diff --git a/fieldservice_stage_validation/static/description/index.html b/fieldservice_stage_validation/static/description/index.html index e69de29bb2..70f7a4451f 100644 --- a/fieldservice_stage_validation/static/description/index.html +++ b/fieldservice_stage_validation/static/description/index.html @@ -0,0 +1,452 @@ + + + + + + +FSM Stage Validation + + + +
+

FSM Stage Validation

+ + +

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

+

As the stage of a field service document progresses, it may be important for +specific fields of the document be completed.

+

For example, when a field service order enters the ???Complete??? stage, the +fields for ???Actual End Date??? and/or ???Resolution Notes??? should be set.

+

This module allows you to raise a Validation Error if the designated fields +are not set when moving to a new stage. Since stages can be used for field +service orders, workers, locations, or equipments, this logic is available +to be applied to each document type.

+

Table of contents

+ +
+

Configuration

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

Known issues / Roadmap

+

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

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Brian McMaster
  • +
+
+
+

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.

+

Current maintainers:

+

brian10048 max3903

+

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

+

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

+
+
+
+ + From 475ce56fb1cfd42f3a7d20915c2ff7a8026676ab Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sun, 28 Jun 2020 21:29:36 +0000 Subject: [PATCH 03/37] fieldservice_stage_validation 12.0.0.2.0 --- fieldservice_stage_validation/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fieldservice_stage_validation/__manifest__.py b/fieldservice_stage_validation/__manifest__.py index 469fe6f0ce..d609c59b79 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': '12.0.0.1.0', + 'version': '12.0.0.2.0', 'category': 'Field Service', 'author': 'Brian McMaster, Odoo Community Association (OCA)', 'website': 'https://github.com/OCA/field-service', From e544bc37e8a044449998e396021289ffd95992e5 Mon Sep 17 00:00:00 2001 From: Daniel Reis Date: Wed, 1 Jul 2020 22:06:27 +0000 Subject: [PATCH 04/37] Added translation using Weblate (Portuguese (Portugal)) --- fieldservice_stage_validation/i18n/pt_PT.po | 69 +++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 fieldservice_stage_validation/i18n/pt_PT.po diff --git a/fieldservice_stage_validation/i18n/pt_PT.po b/fieldservice_stage_validation/i18n/pt_PT.po new file mode 100644 index 0000000000..c9e7ff18a6 --- /dev/null +++ b/fieldservice_stage_validation/i18n/pt_PT.po @@ -0,0 +1,69 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_stage_validation +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: pt_PT\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" + +#. module: fieldservice_stage_validation +#: code:addons/fieldservice_stage_validation/models/fsm_equipment.py:22 +#: code:addons/fieldservice_stage_validation/models/fsm_location.py:22 +#: code:addons/fieldservice_stage_validation/models/fsm_order.py:22 +#: code:addons/fieldservice_stage_validation/models/fsm_person.py:22 +#, python-format +msgid "Cannot move to stage \"%s\" until the \"%s\" field is set." +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_equipment +msgid "Field Service Equipment" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_location +msgid "Field Service Location" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_order +msgid "Field Service Order" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_stage +msgid "Field Service Stage" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_person +msgid "Field Service Worker" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__validate_field_ids +msgid "Fields to Validate" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id +msgid "Model for Stage" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__validate_field_ids +msgid "Select fields which must be set on the document in this stage" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id +msgid "Technical field to hold model type" +msgstr "" From 6b102fd30095ac2c6c333f820749f9c316fe3de1 Mon Sep 17 00:00:00 2001 From: Daniel Reis Date: Wed, 1 Jul 2020 22:07:18 +0000 Subject: [PATCH 05/37] Translated using Weblate (Portuguese (Portugal)) Currently translated at 100.0% (10 of 10 strings) Translation: field-service-12.0/field-service-12.0-fieldservice_stage_validation Translate-URL: https://translation.odoo-community.org/projects/field-service-12-0/field-service-12-0-fieldservice_stage_validation/pt_PT/ --- fieldservice_stage_validation/i18n/pt_PT.po | 22 ++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/fieldservice_stage_validation/i18n/pt_PT.po b/fieldservice_stage_validation/i18n/pt_PT.po index c9e7ff18a6..822124843a 100644 --- a/fieldservice_stage_validation/i18n/pt_PT.po +++ b/fieldservice_stage_validation/i18n/pt_PT.po @@ -6,13 +6,15 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2020-07-02 00:19+0000\n" +"Last-Translator: Daniel Reis \n" "Language-Team: none\n" "Language: pt_PT\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 3.10\n" #. module: fieldservice_stage_validation #: code:addons/fieldservice_stage_validation/models/fsm_equipment.py:22 @@ -22,48 +24,50 @@ msgstr "" #, python-format msgid "Cannot move to stage \"%s\" until the \"%s\" field is set." msgstr "" +"N??o pode mudar para etapa \"%s\" enquanto o campo \"%s\" n??o for definido." #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_equipment msgid "Field Service Equipment" -msgstr "" +msgstr "Equipamento de Servi??o de Campo" #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_location msgid "Field Service Location" -msgstr "" +msgstr "Localiza????o de Servi??o de Campo" #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_order msgid "Field Service Order" -msgstr "" +msgstr "Ordem de Servi??o de Campo" #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_stage msgid "Field Service Stage" -msgstr "" +msgstr "Etapa de Servi??o de Campo" #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_person msgid "Field Service Worker" -msgstr "" +msgstr "Trabalhador de Servi??o de Campo" #. module: fieldservice_stage_validation #: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__validate_field_ids msgid "Fields to Validate" -msgstr "" +msgstr "Campos a Validar" #. module: fieldservice_stage_validation #: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id msgid "Model for Stage" -msgstr "" +msgstr "Modelo para Etapa" #. module: fieldservice_stage_validation #: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__validate_field_ids msgid "Select fields which must be set on the document in this stage" msgstr "" +"Selecione os campos que devem estar preenchidos no documento nesta Etapa" #. module: fieldservice_stage_validation #: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id msgid "Technical field to hold model type" -msgstr "" +msgstr "Campo t??cnico para o tipo de modelo" From 2450e21f964fe80c510f1eacd3e950d99b74edf9 Mon Sep 17 00:00:00 2001 From: brian10048 Date: Tue, 21 Jul 2020 00:32:06 -0400 Subject: [PATCH 06/37] [IMP] fieldservice_stage_validation: black, isort, prettier --- fieldservice_stage_validation/__manifest__.py | 29 +- .../models/fsm_equipment.py | 13 +- .../models/fsm_location.py | 13 +- .../models/fsm_order.py | 13 +- .../models/fsm_person.py | 13 +- .../models/fsm_stage.py | 23 +- .../static/description/index.html | 1108 ++++++++++------- .../views/fsm_stage.xml | 14 +- 8 files changed, 748 insertions(+), 478 deletions(-) diff --git a/fieldservice_stage_validation/__manifest__.py b/fieldservice_stage_validation/__manifest__.py index d609c59b79..52322e6920 100644 --- a/fieldservice_stage_validation/__manifest__.py +++ b/fieldservice_stage_validation/__manifest__.py @@ -1,22 +1,15 @@ # Copyright (C) 2020 Brian McMaster # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { - 'name': 'FSM Stage Validation', - 'summary': 'Validate input data when reaching a Field Service stage', - 'version': '12.0.0.2.0', - 'category': 'Field Service', - 'author': 'Brian McMaster, Odoo Community Association (OCA)', - 'website': 'https://github.com/OCA/field-service', - 'depends': [ - 'fieldservice', - ], - 'data': [ - 'views/fsm_stage.xml', - ], - 'license': 'AGPL-3', - 'development_status': 'Beta', - 'maintainers': [ - 'brian10048', - 'max3903', - ], + "name": "FSM Stage Validation", + "summary": "Validate input data when reaching a Field Service stage", + "version": "12.0.0.2.0", + "category": "Field Service", + "author": "Brian McMaster, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/field-service", + "depends": ["fieldservice"], + "data": ["views/fsm_stage.xml"], + "license": "AGPL-3", + "development_status": "Beta", + "maintainers": ["brian10048", "max3903"], } diff --git a/fieldservice_stage_validation/models/fsm_equipment.py b/fieldservice_stage_validation/models/fsm_equipment.py index 87be00f34c..ee7d4d7cf1 100644 --- a/fieldservice_stage_validation/models/fsm_equipment.py +++ b/fieldservice_stage_validation/models/fsm_equipment.py @@ -5,9 +5,9 @@ class FSMEquipment(models.Model): - _inherit = 'fsm.equipment' + _inherit = "fsm.equipment" - @api.constrains('stage_id') + @api.constrains("stage_id") def _validate_stage_fields(self): for rec in self: stage = rec.stage_id @@ -17,6 +17,9 @@ def _validate_stage_fields(self): for name in field_names: if not values[0][name]: - raise ValidationError(_('Cannot move to stage "%s" ' - 'until the "%s" field is set.' - % (stage.name, name))) + raise ValidationError( + _( + 'Cannot move to stage "%s" ' + 'until the "%s" field is set.' % (stage.name, name) + ) + ) diff --git a/fieldservice_stage_validation/models/fsm_location.py b/fieldservice_stage_validation/models/fsm_location.py index 6d55316ef2..08112702b4 100644 --- a/fieldservice_stage_validation/models/fsm_location.py +++ b/fieldservice_stage_validation/models/fsm_location.py @@ -5,9 +5,9 @@ class FSMLocation(models.Model): - _inherit = 'fsm.location' + _inherit = "fsm.location" - @api.constrains('stage_id') + @api.constrains("stage_id") def _validate_stage_fields(self): for rec in self: stage = rec.stage_id @@ -17,6 +17,9 @@ def _validate_stage_fields(self): for name in field_names: if not values[0][name]: - raise ValidationError(_('Cannot move to stage "%s" ' - 'until the "%s" field is set.' - % (stage.name, name))) + raise ValidationError( + _( + 'Cannot move to stage "%s" ' + 'until the "%s" field is set.' % (stage.name, name) + ) + ) diff --git a/fieldservice_stage_validation/models/fsm_order.py b/fieldservice_stage_validation/models/fsm_order.py index 6aea0ee4ae..812babdb5c 100644 --- a/fieldservice_stage_validation/models/fsm_order.py +++ b/fieldservice_stage_validation/models/fsm_order.py @@ -5,9 +5,9 @@ class FSMOrder(models.Model): - _inherit = 'fsm.order' + _inherit = "fsm.order" - @api.constrains('stage_id') + @api.constrains("stage_id") def _validate_stage_fields(self): for rec in self: stage = rec.stage_id @@ -17,6 +17,9 @@ def _validate_stage_fields(self): for name in field_names: if not values[0][name]: - raise ValidationError(_('Cannot move to stage "%s" ' - 'until the "%s" field is set.' - % (stage.name, name))) + raise ValidationError( + _( + 'Cannot move to stage "%s" ' + 'until the "%s" field is set.' % (stage.name, name) + ) + ) diff --git a/fieldservice_stage_validation/models/fsm_person.py b/fieldservice_stage_validation/models/fsm_person.py index 8d369cffe0..91ba573374 100644 --- a/fieldservice_stage_validation/models/fsm_person.py +++ b/fieldservice_stage_validation/models/fsm_person.py @@ -5,9 +5,9 @@ class FSMPerson(models.Model): - _inherit = 'fsm.person' + _inherit = "fsm.person" - @api.constrains('stage_id') + @api.constrains("stage_id") def _validate_stage_fields(self): for rec in self: stage = rec.stage_id @@ -17,6 +17,9 @@ def _validate_stage_fields(self): for name in field_names: if not values[0][name]: - raise ValidationError(_('Cannot move to stage "%s" ' - 'until the "%s" field is set.' - % (stage.name, name))) + raise ValidationError( + _( + 'Cannot move to stage "%s" ' + 'until the "%s" field is set.' % (stage.name, name) + ) + ) diff --git a/fieldservice_stage_validation/models/fsm_stage.py b/fieldservice_stage_validation/models/fsm_stage.py index 7f0ba54d60..a59b6e9a47 100644 --- a/fieldservice_stage_validation/models/fsm_stage.py +++ b/fieldservice_stage_validation/models/fsm_stage.py @@ -4,28 +4,27 @@ class FSMStage(models.Model): - _inherit = 'fsm.stage' + _inherit = "fsm.stage" - @api.depends('stage_type') + @api.depends("stage_type") def _compute_stage_model(self): model_id = False - Model = self.env['ir.model'] + Model = self.env["ir.model"] for rec in self: if rec.stage_type: - model_string = 'fsm.' + rec.stage_type - model_id = Model.search( - [('model', '=', model_string)], limit=1).id + model_string = "fsm." + rec.stage_type + model_id = Model.search([("model", "=", model_string)], limit=1).id rec.stage_type_model_id = model_id validate_field_ids = fields.Many2many( - 'ir.model.fields', - string='Fields to Validate', - help='Select fields which must be set on the document in this stage', + "ir.model.fields", + 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', + "ir.model", compute=_compute_stage_model, - string='Model for Stage', - help='Technical field to hold model type', + string="Model for Stage", + help="Technical field to hold model type", ) diff --git a/fieldservice_stage_validation/static/description/index.html b/fieldservice_stage_validation/static/description/index.html index 70f7a4451f..bc74aeefac 100644 --- a/fieldservice_stage_validation/static/description/index.html +++ b/fieldservice_stage_validation/static/description/index.html @@ -1,13 +1,15 @@ - - - -FSM Stage Validation - - - -
-

FSM Stage Validation

- - -

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

-

As the stage of a field service document progresses, it may be important for -specific fields of the document be completed.

-

For example, when a field service order enters the ???Complete??? stage, the -fields for ???Actual End Date??? and/or ???Resolution Notes??? should be set.

-

This module allows you to raise a Validation Error if the designated fields -are not set when moving to a new stage. Since stages can be used for field -service orders, workers, locations, or equipments, this logic is available -to be applied to each document type.

-

Table of contents

- -
-

Configuration

-
    -
  • 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.
  • -
-
-
-

Known issues / Roadmap

-

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

-
-
-

Bug Tracker

-

Bugs are tracked on GitHub Issues. -In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed -feedback.

-

Do not contact contributors directly about support or help with technical issues.

-
-
-

Credits

-
-

Authors

-
    -
  • Brian McMaster
  • -
-
-
-

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.

-

Current maintainers:

-

brian10048 max3903

-

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

-

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

-
-
-
- +

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

+

+ As the stage of a field service document progresses, it may be important for + specific fields of the document be completed. +

+

+ For example, when a field service order enters the ???Complete??? stage, the + fields for ???Actual End Date??? and/or ???Resolution Notes??? should be set. +

+

+ This module allows you to raise a Validation Error if the designated fields are + not set when moving to a new stage. Since stages can be used for field service + orders, workers, locations, or equipments, this logic is available to be applied + to each document type. +

+

Table of contents

+
+ +
+
+

Configuration

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

Known issues / Roadmap

+

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

+
+
+

Bug Tracker

+

+ Bugs are tracked on + GitHub Issues. In case of trouble, please check there if your issue has already been + reported. If you spotted it first, help us smashing it by providing a detailed + and welcomed + feedback. +

+

+ Do not contact contributors directly about support or help with technical + issues. +

+
+
+

Credits

+
+

Authors

+
    +
  • Brian McMaster
  • +
+
+
+

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. +

+

+ Current + maintainers: +

+

+ brian10048 + max3903 +

+

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

+

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

+
+
+ + diff --git a/fieldservice_stage_validation/views/fsm_stage.xml b/fieldservice_stage_validation/views/fsm_stage.xml index c8e69148ba..b29c51bba3 100644 --- a/fieldservice_stage_validation/views/fsm_stage.xml +++ b/fieldservice_stage_validation/views/fsm_stage.xml @@ -1,17 +1,17 @@ - fsm.stage.validation.form fsm.stage - + - - + + - From ecd6f3db49bb1c3a95e181571b38485292b94ef2 Mon Sep 17 00:00:00 2001 From: brian10048 Date: Tue, 21 Jul 2020 00:33:16 -0400 Subject: [PATCH 07/37] [MIG] fieldservice_stage_validation: Migration to 13.0 --- fieldservice_stage_validation/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fieldservice_stage_validation/__manifest__.py b/fieldservice_stage_validation/__manifest__.py index 52322e6920..7f4e5181cd 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": "12.0.0.2.0", + "version": "13.0.1.0.0", "category": "Field Service", "author": "Brian McMaster, Odoo Community Association (OCA)", "website": "https://github.com/OCA/field-service", From 2688ea25cb042e2e602f80ed79cf0bca75f46f83 Mon Sep 17 00:00:00 2001 From: Brian McMaster Date: Tue, 27 Oct 2020 11:04:07 -0400 Subject: [PATCH 08/37] [IMP] fieldservice_stage_validation: Add test --- fieldservice_stage_validation/README.rst | 10 +- .../i18n/fieldservice_stage_validation.pot | 15 +- .../static/description/index.html | 1108 +++++++---------- .../tests/__init__.py | 4 + .../tests/test_fsm_stage_validation.py | 195 +++ 5 files changed, 632 insertions(+), 700 deletions(-) create mode 100644 fieldservice_stage_validation/tests/__init__.py create mode 100644 fieldservice_stage_validation/tests/test_fsm_stage_validation.py diff --git a/fieldservice_stage_validation/README.rst b/fieldservice_stage_validation/README.rst index e1deec3161..8f4139e186 100644 --- a/fieldservice_stage_validation/README.rst +++ b/fieldservice_stage_validation/README.rst @@ -14,13 +14,13 @@ FSM Stage Validation :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/12.0/fieldservice_stage_validation + :target: https://github.com/OCA/field-service/tree/13.0/fieldservice_stage_validation :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-12-0/field-service-12-0-fieldservice_stage_validation + :target: https://translation.odoo-community.org/projects/field-service-13-0/field-service-13-0-fieldservice_stage_validation :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/12.0 + :target: https://runbot.odoo-community.org/runbot/264/13.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -67,7 +67,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 -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -108,6 +108,6 @@ Current `maintainers `__: |maintainer-brian10048| |maintainer-max3903| -This module is part of the `OCA/field-service `_ project on GitHub. +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_stage_validation/i18n/fieldservice_stage_validation.pot b/fieldservice_stage_validation/i18n/fieldservice_stage_validation.pot index 441bcba59b..6ae43967b2 100644 --- a/fieldservice_stage_validation/i18n/fieldservice_stage_validation.pot +++ b/fieldservice_stage_validation/i18n/fieldservice_stage_validation.pot @@ -1,12 +1,12 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * fieldservice_stage_validation +# * fieldservice_stage_validation # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 12.0\n" +"Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: <>\n" +"Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -14,10 +14,10 @@ msgstr "" "Plural-Forms: \n" #. module: fieldservice_stage_validation -#: code:addons/fieldservice_stage_validation/models/fsm_equipment.py:22 -#: code:addons/fieldservice_stage_validation/models/fsm_location.py:22 -#: code:addons/fieldservice_stage_validation/models/fsm_order.py:22 -#: code:addons/fieldservice_stage_validation/models/fsm_person.py:22 +#: code:addons/fieldservice_stage_validation/models/fsm_equipment.py:0 +#: code:addons/fieldservice_stage_validation/models/fsm_location.py:0 +#: code:addons/fieldservice_stage_validation/models/fsm_order.py:0 +#: code:addons/fieldservice_stage_validation/models/fsm_person.py:0 #, python-format msgid "Cannot move to stage \"%s\" until the \"%s\" field is set." msgstr "" @@ -66,4 +66,3 @@ msgstr "" #: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id msgid "Technical field to hold model type" msgstr "" - diff --git a/fieldservice_stage_validation/static/description/index.html b/fieldservice_stage_validation/static/description/index.html index bc74aeefac..2fca707d18 100644 --- a/fieldservice_stage_validation/static/description/index.html +++ b/fieldservice_stage_validation/static/description/index.html @@ -1,15 +1,13 @@ - - - - FSM Stage Validation - - - -
-

FSM Stage Validation

- - -

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

-

- As the stage of a field service document progresses, it may be important for - specific fields of the document be completed. -

-

- For example, when a field service order enters the ???Complete??? stage, the - fields for ???Actual End Date??? and/or ???Resolution Notes??? should be set. -

-

- This module allows you to raise a Validation Error if the designated fields are - not set when moving to a new stage. Since stages can be used for field service - orders, workers, locations, or equipments, this logic is available to be applied - to each document type. -

-

Table of contents

-
- -
-
-

Configuration

-
    -
  • 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. -
  • -
-
-
-

Known issues / Roadmap

-

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

-
-
-

Bug Tracker

-

- Bugs are tracked on - GitHub Issues. In case of trouble, please check there if your issue has already been - reported. If you spotted it first, help us smashing it by providing a detailed - and welcomed - feedback. -

-

- Do not contact contributors directly about support or help with technical - issues. -

-
-
-

Credits

-
-

Authors

-
    -
  • Brian McMaster
  • -
-
-
-

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. -

-

- Current - maintainers: -

-

- brian10048 - max3903 -

-

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

-

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

-
-
-
- +

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

+

As the stage of a field service document progresses, it may be important for +specific fields of the document be completed.

+

For example, when a field service order enters the ‘Complete’ stage, the +fields for ‘Actual End Date’ and/or ‘Resolution Notes’ should be set.

+

This module allows you to raise a Validation Error if the designated fields +are not set when moving to a new stage. Since stages can be used for field +service orders, workers, locations, or equipments, this logic is available +to be applied to each document type.

+

Table of contents

+ +
+

Configuration

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

Known issues / Roadmap

+

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

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Brian McMaster
  • +
+
+
+

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.

+

Current maintainers:

+

brian10048 max3903

+

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

+

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

+
+
+ + diff --git a/fieldservice_stage_validation/tests/__init__.py b/fieldservice_stage_validation/tests/__init__.py new file mode 100644 index 0000000000..7586a16155 --- /dev/null +++ b/fieldservice_stage_validation/tests/__init__.py @@ -0,0 +1,4 @@ +# Copyright (C) 2020, Brian McMaster +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import test_fsm_stage_validation diff --git a/fieldservice_stage_validation/tests/test_fsm_stage_validation.py b/fieldservice_stage_validation/tests/test_fsm_stage_validation.py new file mode 100644 index 0000000000..bdc44da914 --- /dev/null +++ b/fieldservice_stage_validation/tests/test_fsm_stage_validation.py @@ -0,0 +1,195 @@ +# Copyright 2020, Brian McMaster +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) + +from odoo.exceptions import ValidationError +from odoo.tests import SavepointCase + + +class TestFSMStageValidation(SavepointCase): + @classmethod + def setUpClass(cls): + super(TestFSMStageValidation, cls).setUpClass() + + cls.stage = cls.env["fsm.stage"] + cls.fsm_order = cls.env["fsm.order"] + cls.fsm_person = cls.env["fsm.person"] + cls.fsm_location = cls.env["fsm.location"] + cls.fsm_equipment = cls.env["fsm.equipment"] + cls.ir_model_fields = cls.env["ir.model.fields"] + + # Get some fields to use in the stages + cls.order_field = cls.ir_model_fields.search( + [("model", "=", "fsm.order"), ("name", "=", "description")] + ) + cls.person_field = cls.ir_model_fields.search( + [("model", "=", "fsm.person"), ("name", "=", "mobile")] + ) + cls.location_field = cls.ir_model_fields.search( + [("model", "=", "fsm.location"), ("name", "=", "direction")] + ) + cls.equipment_field = cls.ir_model_fields.search( + [("model", "=", "fsm.equipment"), ("name", "=", "notes")] + ) + + # For each model type, create a default stage and a stage + # which will apply field validation + # Order Stages + cls.stage_order_default = cls.stage.create( + { + "name": "Order Stage Default", + "stage_type": "order", + "is_default": True, + "sequence": "10", + } + ) + cls.stage_order = cls.stage.create( + { + "name": "Order Stage Validate", + "stage_type": "order", + "validate_field_ids": [(6, 0, [cls.order_field.id])], + "sequence": "11", + } + ) + # Person Stages + cls.stage_person_default = cls.stage.create( + { + "name": "Person Stage Default", + "stage_type": "worker", + "is_default": True, + "sequence": "10", + } + ) + cls.stage_person = cls.stage.create( + { + "name": "Person Stage Validate", + "stage_type": "worker", + "validate_field_ids": [(6, 0, [cls.person_field.id])], + "sequence": "11", + } + ) + # Location Stages + cls.stage_location_default = cls.stage.create( + { + "name": "Location Stage Default", + "stage_type": "location", + "is_default": True, + "sequence": "10", + } + ) + cls.stage_location = cls.stage.create( + { + "name": "Location Stage Validate", + "stage_type": "location", + "validate_field_ids": [(6, 0, [cls.location_field.id])], + "sequence": "11", + } + ) + # Equipment Stages + cls.stage_equipment_default = cls.stage.create( + { + "name": "Equipment Stage Default", + "stage_type": "equipment", + "is_default": True, + "sequence": "10", + } + ) + cls.stage_equipment = cls.stage.create( + { + "name": "Equipment Stage Validate", + "stage_type": "equipment", + "validate_field_ids": [(6, 0, [cls.equipment_field.id])], + "sequence": "11", + } + ) + + # Create a person + cls.person_01 = cls.fsm_person.create( + { + "name": "FSM Worker 01", + "partner_id": cls.env["res.partner"] + .create({"name": "Worker 01 Partner"}) + .id, + "stage_id": cls.stage_person_default.id, + } + ) + # Create a location + cls.location_01 = cls.fsm_location.create( + { + "name": "Location 01", + "owner_id": cls.env["res.partner"] + .create({"name": "Location 01 Partner"}) + .id, + "stage_id": cls.stage_location_default.id, + } + ) + # Create an Equipment + cls.equipment_01 = cls.fsm_equipment.create( + { + "name": "Equipment 01", + "current_location_id": cls.location_01.id, + "stage_id": cls.stage_equipment_default.id, + } + ) + # Create an Order + cls.order_01 = cls.fsm_order.create({"location_id": cls.location_01.id}) + + def test_fsm_stage_validation(self): + + # Validate the stage computes the correct model type + self.assertEqual( + self.stage_order.stage_type_model_id, + self.env["ir.model"].search([("model", "=", "fsm.order")]), + "FSM Stage model is not computed correctly", + ) + + # Validate the Equipment cannot move to next stage + with self.assertRaises(ValidationError): + self.equipment_01.next_stage() + + # Update the Equipment notes field and validate it goes to next stage + self.equipment_01.notes = "Equipment service note" + self.equipment_01.next_stage() + self.assertEqual( + self.equipment_01.stage_id, + self.stage_equipment, + "FSM Equipment did not progress to correct stage", + ) + + # Validate the Location cannot move to next stage + with self.assertRaises(ValidationError): + self.location_01.next_stage() + + # Update the Location directions field and validate it goes to next stage + self.location_01.direction = "Location direction note" + self.location_01.next_stage() + self.assertEqual( + self.location_01.stage_id, + self.stage_location, + "FSM Location did not progress to correct stage", + ) + + # Validate the Person cannot move to next stage + with self.assertRaises(ValidationError): + self.person_01.next_stage() + + # Update the Person mobile field and validate it goes to next stage + self.person_01.mobile = "1-888-888-8888" + self.person_01.next_stage() + self.assertEqual( + self.person_01.stage_id, + self.stage_person, + "FSM Person did not progress to correct stage", + ) + + # Validate the Order cannot move to stage which requires validation + with self.assertRaises(ValidationError): + self.order_01.write({"stage_id": self.stage_order.id}) + + # Update the Order description field and validate it goes to next stage + self.order_01.description = "Complete the work order" + self.order_01.write({"stage_id": self.stage_order.id}) + self.assertEqual( + self.order_01.stage_id, + self.stage_order, + "FSM Order did not progress to correct stage", + ) From 11b57085d752b45b38f516331698330f6de68a3f Mon Sep 17 00:00:00 2001 From: Ignacio Buioli Date: Tue, 27 Apr 2021 17:58:53 +0000 Subject: [PATCH 09/37] Added translation using Weblate (Spanish (Argentina)) --- fieldservice_stage_validation/i18n/es_AR.po | 69 +++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 fieldservice_stage_validation/i18n/es_AR.po diff --git a/fieldservice_stage_validation/i18n/es_AR.po b/fieldservice_stage_validation/i18n/es_AR.po new file mode 100644 index 0000000000..db29269460 --- /dev/null +++ b/fieldservice_stage_validation/i18n/es_AR.po @@ -0,0 +1,69 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_stage_validation +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: es_AR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" + +#. module: fieldservice_stage_validation +#: code:addons/fieldservice_stage_validation/models/fsm_equipment.py:0 +#: code:addons/fieldservice_stage_validation/models/fsm_location.py:0 +#: code:addons/fieldservice_stage_validation/models/fsm_order.py:0 +#: code:addons/fieldservice_stage_validation/models/fsm_person.py:0 +#, python-format +msgid "Cannot move to stage \"%s\" until the \"%s\" field is set." +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_equipment +msgid "Field Service Equipment" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_location +msgid "Field Service Location" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_order +msgid "Field Service Order" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_stage +msgid "Field Service Stage" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_person +msgid "Field Service Worker" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__validate_field_ids +msgid "Fields to Validate" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id +msgid "Model for Stage" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__validate_field_ids +msgid "Select fields which must be set on the document in this stage" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id +msgid "Technical field to hold model type" +msgstr "" From eac58912dcfbaf959b75c463f0f1c7b39d5c2e27 Mon Sep 17 00:00:00 2001 From: Ignacio Buioli Date: Wed, 28 Apr 2021 01:40:09 +0000 Subject: [PATCH 10/37] Translated using Weblate (Spanish (Argentina)) Currently translated at 100.0% (10 of 10 strings) Translation: field-service-13.0/field-service-13.0-fieldservice_stage_validation Translate-URL: https://translation.odoo-community.org/projects/field-service-13-0/field-service-13-0-fieldservice_stage_validation/es_AR/ --- fieldservice_stage_validation/i18n/es_AR.po | 22 ++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/fieldservice_stage_validation/i18n/es_AR.po b/fieldservice_stage_validation/i18n/es_AR.po index db29269460..d7d73f52fb 100644 --- a/fieldservice_stage_validation/i18n/es_AR.po +++ b/fieldservice_stage_validation/i18n/es_AR.po @@ -6,13 +6,15 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2021-04-28 03:47+0000\n" +"Last-Translator: Ignacio Buioli \n" "Language-Team: none\n" "Language: es_AR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.3.2\n" #. module: fieldservice_stage_validation #: code:addons/fieldservice_stage_validation/models/fsm_equipment.py:0 @@ -22,48 +24,50 @@ msgstr "" #, python-format msgid "Cannot move to stage \"%s\" until the \"%s\" field is set." msgstr "" +"No se puede mover a la etapa \"%s\" hasta que se establezca el campo \"%s\"." #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_equipment msgid "Field Service Equipment" -msgstr "" +msgstr "Equipo de Servicio de Campo" #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_location msgid "Field Service Location" -msgstr "" +msgstr "Ubicación del Servicio de Campo" #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_order msgid "Field Service Order" -msgstr "" +msgstr "Pedido de Servicio de Campo" #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_stage msgid "Field Service Stage" -msgstr "" +msgstr "Etapa de Servicio de Campo" #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_person msgid "Field Service Worker" -msgstr "" +msgstr "Trabajador de Servicio de Campo" #. module: fieldservice_stage_validation #: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__validate_field_ids msgid "Fields to Validate" -msgstr "" +msgstr "Campos a Validar" #. module: fieldservice_stage_validation #: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id msgid "Model for Stage" -msgstr "" +msgstr "Modelo para la Etapa" #. module: fieldservice_stage_validation #: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__validate_field_ids msgid "Select fields which must be set on the document in this stage" msgstr "" +"Seleccione los campos que se deben establecer en el documento en esta etapa" #. module: fieldservice_stage_validation #: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id msgid "Technical field to hold model type" -msgstr "" +msgstr "Campo técnico para mantener el tipo del modelo" From c56c97a98ddd0abb1b7fd5be1ea887ec74094e01 Mon Sep 17 00:00:00 2001 From: "Sandrine (ACSONE)" Date: Thu, 20 May 2021 07:57:32 +0000 Subject: [PATCH 11/37] Added translation using Weblate (French (France)) --- fieldservice_stage_validation/i18n/fr_FR.po | 69 +++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 fieldservice_stage_validation/i18n/fr_FR.po diff --git a/fieldservice_stage_validation/i18n/fr_FR.po b/fieldservice_stage_validation/i18n/fr_FR.po new file mode 100644 index 0000000000..07fe291f2b --- /dev/null +++ b/fieldservice_stage_validation/i18n/fr_FR.po @@ -0,0 +1,69 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_stage_validation +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: fr_FR\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" + +#. module: fieldservice_stage_validation +#: code:addons/fieldservice_stage_validation/models/fsm_equipment.py:0 +#: code:addons/fieldservice_stage_validation/models/fsm_location.py:0 +#: code:addons/fieldservice_stage_validation/models/fsm_order.py:0 +#: code:addons/fieldservice_stage_validation/models/fsm_person.py:0 +#, python-format +msgid "Cannot move to stage \"%s\" until the \"%s\" field is set." +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_equipment +msgid "Field Service Equipment" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_location +msgid "Field Service Location" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_order +msgid "Field Service Order" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_stage +msgid "Field Service Stage" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_person +msgid "Field Service Worker" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__validate_field_ids +msgid "Fields to Validate" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id +msgid "Model for Stage" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__validate_field_ids +msgid "Select fields which must be set on the document in this stage" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id +msgid "Technical field to hold model type" +msgstr "" From d84a90c6dde4c6bab40034beaa08c89541400d1e Mon Sep 17 00:00:00 2001 From: "Sandrine (ACSONE)" Date: Thu, 20 May 2021 08:51:50 +0000 Subject: [PATCH 12/37] Translated using Weblate (French (France)) Currently translated at 100.0% (10 of 10 strings) Translation: field-service-13.0/field-service-13.0-fieldservice_stage_validation Translate-URL: https://translation.odoo-community.org/projects/field-service-13-0/field-service-13-0-fieldservice_stage_validation/fr_FR/ --- fieldservice_stage_validation/i18n/fr_FR.po | 24 ++++++++++++--------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/fieldservice_stage_validation/i18n/fr_FR.po b/fieldservice_stage_validation/i18n/fr_FR.po index 07fe291f2b..b6536c23d9 100644 --- a/fieldservice_stage_validation/i18n/fr_FR.po +++ b/fieldservice_stage_validation/i18n/fr_FR.po @@ -6,13 +6,15 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2021-05-20 10:48+0000\n" +"Last-Translator: Sandrine (ACSONE) \n" "Language-Team: none\n" "Language: fr_FR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.3.2\n" #. module: fieldservice_stage_validation #: code:addons/fieldservice_stage_validation/models/fsm_equipment.py:0 @@ -21,49 +23,51 @@ msgstr "" #: code:addons/fieldservice_stage_validation/models/fsm_person.py:0 #, python-format msgid "Cannot move to stage \"%s\" until the \"%s\" field is set." -msgstr "" +msgstr "Le champ \"%s\" doit être rempli pour passer à l'étape \"%s\"." #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_equipment msgid "Field Service Equipment" -msgstr "" +msgstr "Equipement Service sur site" #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_location msgid "Field Service Location" -msgstr "" +msgstr "Lieu du service sur site" #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_order msgid "Field Service Order" -msgstr "" +msgstr "Service sur site" #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_stage msgid "Field Service Stage" -msgstr "" +msgstr "Etape du service sur site" #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_person msgid "Field Service Worker" -msgstr "" +msgstr "Travailleur du service sur site" #. module: fieldservice_stage_validation #: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__validate_field_ids msgid "Fields to Validate" -msgstr "" +msgstr "Champs à valider" #. module: fieldservice_stage_validation #: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id msgid "Model for Stage" -msgstr "" +msgstr "Modèle pour l'étape" #. module: fieldservice_stage_validation #: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__validate_field_ids msgid "Select fields which must be set on the document in this stage" msgstr "" +"Sélectionnez les champs qui doivent être remplis sur le document à cette " +"étape" #. module: fieldservice_stage_validation #: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id msgid "Technical field to hold model type" -msgstr "" +msgstr "Champ technique pour contenir le type de modèle" From eefce2109be3042539f1a7a88f27f01edfcc812a Mon Sep 17 00:00:00 2001 From: Ediz Duman Date: Sat, 10 Jul 2021 11:23:39 +0000 Subject: [PATCH 13/37] Added translation using Weblate (Turkish) --- fieldservice_stage_validation/i18n/tr.po | 69 ++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 fieldservice_stage_validation/i18n/tr.po diff --git a/fieldservice_stage_validation/i18n/tr.po b/fieldservice_stage_validation/i18n/tr.po new file mode 100644 index 0000000000..cb168ff9c1 --- /dev/null +++ b/fieldservice_stage_validation/i18n/tr.po @@ -0,0 +1,69 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_stage_validation +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: tr\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" + +#. module: fieldservice_stage_validation +#: code:addons/fieldservice_stage_validation/models/fsm_equipment.py:0 +#: code:addons/fieldservice_stage_validation/models/fsm_location.py:0 +#: code:addons/fieldservice_stage_validation/models/fsm_order.py:0 +#: code:addons/fieldservice_stage_validation/models/fsm_person.py:0 +#, python-format +msgid "Cannot move to stage \"%s\" until the \"%s\" field is set." +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_equipment +msgid "Field Service Equipment" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_location +msgid "Field Service Location" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_order +msgid "Field Service Order" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_stage +msgid "Field Service Stage" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_person +msgid "Field Service Worker" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__validate_field_ids +msgid "Fields to Validate" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id +msgid "Model for Stage" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__validate_field_ids +msgid "Select fields which must be set on the document in this stage" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id +msgid "Technical field to hold model type" +msgstr "" From 902ad6de1473dde551567788582434e8cbaf8d91 Mon Sep 17 00:00:00 2001 From: mymage Date: Sun, 26 Sep 2021 17:44:25 +0000 Subject: [PATCH 14/37] Added translation using Weblate (Italian) --- fieldservice_stage_validation/i18n/it.po | 69 ++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 fieldservice_stage_validation/i18n/it.po diff --git a/fieldservice_stage_validation/i18n/it.po b/fieldservice_stage_validation/i18n/it.po new file mode 100644 index 0000000000..d4b6a721f2 --- /dev/null +++ b/fieldservice_stage_validation/i18n/it.po @@ -0,0 +1,69 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_stage_validation +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\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" + +#. module: fieldservice_stage_validation +#: code:addons/fieldservice_stage_validation/models/fsm_equipment.py:0 +#: code:addons/fieldservice_stage_validation/models/fsm_location.py:0 +#: code:addons/fieldservice_stage_validation/models/fsm_order.py:0 +#: code:addons/fieldservice_stage_validation/models/fsm_person.py:0 +#, python-format +msgid "Cannot move to stage \"%s\" until the \"%s\" field is set." +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_equipment +msgid "Field Service Equipment" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_location +msgid "Field Service Location" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_order +msgid "Field Service Order" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_stage +msgid "Field Service Stage" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_person +msgid "Field Service Worker" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__validate_field_ids +msgid "Fields to Validate" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id +msgid "Model for Stage" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__validate_field_ids +msgid "Select fields which must be set on the document in this stage" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id +msgid "Technical field to hold model type" +msgstr "" From feb85c4198b6f3c5583cce83345bb9ef05b855a6 Mon Sep 17 00:00:00 2001 From: mymage Date: Mon, 27 Sep 2021 18:29:23 +0000 Subject: [PATCH 15/37] Translated using Weblate (Italian) Currently translated at 100.0% (10 of 10 strings) Translation: field-service-13.0/field-service-13.0-fieldservice_stage_validation Translate-URL: https://translation.odoo-community.org/projects/field-service-13-0/field-service-13-0-fieldservice_stage_validation/it/ --- fieldservice_stage_validation/i18n/it.po | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/fieldservice_stage_validation/i18n/it.po b/fieldservice_stage_validation/i18n/it.po index d4b6a721f2..b3db7763ac 100644 --- a/fieldservice_stage_validation/i18n/it.po +++ b/fieldservice_stage_validation/i18n/it.po @@ -6,13 +6,15 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2021-09-27 20:34+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.3.2\n" #. module: fieldservice_stage_validation #: code:addons/fieldservice_stage_validation/models/fsm_equipment.py:0 @@ -22,48 +24,50 @@ msgstr "" #, python-format msgid "Cannot move to stage \"%s\" until the \"%s\" field is set." msgstr "" +"Non si può passare alla fase \"%s\" finché il campo \"%s\" non è impostato." #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_equipment msgid "Field Service Equipment" -msgstr "" +msgstr "Attrezzatura assistenza sul campo" #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_location msgid "Field Service Location" -msgstr "" +msgstr "Località assistenza sul campo" #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_order msgid "Field Service Order" -msgstr "" +msgstr "Ordine assistenza sul campo" #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_stage msgid "Field Service Stage" -msgstr "" +msgstr "Fase assistenza sul campo" #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_person msgid "Field Service Worker" -msgstr "" +msgstr "Lavoratore assistenza sul campo" #. module: fieldservice_stage_validation #: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__validate_field_ids msgid "Fields to Validate" -msgstr "" +msgstr "Campo da validare" #. module: fieldservice_stage_validation #: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id msgid "Model for Stage" -msgstr "" +msgstr "Modello per fase" #. module: fieldservice_stage_validation #: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__validate_field_ids msgid "Select fields which must be set on the document in this stage" msgstr "" +"Selezionare i campi che devono essere compilati nel documento in questa fase" #. module: fieldservice_stage_validation #: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id msgid "Technical field to hold model type" -msgstr "" +msgstr "Campo tecnico per memorizzare il tipo modello" From 4d41e7bf5808e077447d74c83c55a77b69d1e515 Mon Sep 17 00:00:00 2001 From: Maksym Yankin Date: Thu, 28 Jul 2022 09:21:04 +0300 Subject: [PATCH 16/37] [IMP] fieldservice_stage_validation: black, isort, prettier --- fieldservice_stage_validation/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fieldservice_stage_validation/__manifest__.py b/fieldservice_stage_validation/__manifest__.py index 7f4e5181cd..97386d0bd5 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": "13.0.1.0.0", + "version": "14.0.1.0.0", "category": "Field Service", "author": "Brian McMaster, Odoo Community Association (OCA)", "website": "https://github.com/OCA/field-service", From e57de74ee26815bc4eaacb51a6e30c9bb40305b4 Mon Sep 17 00:00:00 2001 From: Maksym Yankin Date: Thu, 28 Jul 2022 09:48:42 +0300 Subject: [PATCH 17/37] [MIG] fieldservice_stage_validation: Migration to 14.0 --- fieldservice_stage_validation/README.rst | 10 ++--- fieldservice_stage_validation/i18n/es_AR.po | 2 +- .../i18n/fieldservice_stage_validation.pot | 38 ++++++++++++++++--- fieldservice_stage_validation/i18n/fr_FR.po | 2 +- fieldservice_stage_validation/i18n/it.po | 2 +- fieldservice_stage_validation/i18n/tr.po | 2 +- .../models/__init__.py | 1 + .../models/fsm_equipment.py | 20 ++-------- .../models/fsm_location.py | 20 ++-------- .../models/fsm_order.py | 20 ++-------- .../models/fsm_person.py | 20 ++-------- .../models/fsm_stage.py | 22 +++++------ .../models/validate_utils.py | 22 +++++++++++ .../static/description/index.html | 6 +-- .../tests/test_fsm_stage_validation.py | 29 +++++++++----- .../views/fsm_stage.xml | 1 + 16 files changed, 115 insertions(+), 102 deletions(-) create mode 100644 fieldservice_stage_validation/models/validate_utils.py diff --git a/fieldservice_stage_validation/README.rst b/fieldservice_stage_validation/README.rst index 8f4139e186..99dcf816a0 100644 --- a/fieldservice_stage_validation/README.rst +++ b/fieldservice_stage_validation/README.rst @@ -14,13 +14,13 @@ FSM Stage Validation :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/13.0/fieldservice_stage_validation + :target: https://github.com/OCA/field-service/tree/14.0/fieldservice_stage_validation :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-13-0/field-service-13-0-fieldservice_stage_validation + :target: https://translation.odoo-community.org/projects/field-service-14-0/field-service-14-0-fieldservice_stage_validation :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/13.0 + :target: https://runbot.odoo-community.org/runbot/264/14.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -67,7 +67,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 -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -108,6 +108,6 @@ Current `maintainers `__: |maintainer-brian10048| |maintainer-max3903| -This module is part of the `OCA/field-service `_ project on GitHub. +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_stage_validation/i18n/es_AR.po b/fieldservice_stage_validation/i18n/es_AR.po index d7d73f52fb..55f162ef6e 100644 --- a/fieldservice_stage_validation/i18n/es_AR.po +++ b/fieldservice_stage_validation/i18n/es_AR.po @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 13.0\n" +"Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" "PO-Revision-Date: 2021-04-28 03:47+0000\n" "Last-Translator: Ignacio Buioli \n" diff --git a/fieldservice_stage_validation/i18n/fieldservice_stage_validation.pot b/fieldservice_stage_validation/i18n/fieldservice_stage_validation.pot index 6ae43967b2..89d5d13cff 100644 --- a/fieldservice_stage_validation/i18n/fieldservice_stage_validation.pot +++ b/fieldservice_stage_validation/i18n/fieldservice_stage_validation.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 13.0\n" +"Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" @@ -14,14 +14,19 @@ msgstr "" "Plural-Forms: \n" #. module: fieldservice_stage_validation -#: code:addons/fieldservice_stage_validation/models/fsm_equipment.py:0 -#: code:addons/fieldservice_stage_validation/models/fsm_location.py:0 -#: code:addons/fieldservice_stage_validation/models/fsm_order.py:0 -#: code:addons/fieldservice_stage_validation/models/fsm_person.py:0 +#: code:addons/fieldservice_stage_validation/models/validate_utils.py:0 #, python-format msgid "Cannot move to stage \"%s\" until the \"%s\" field is set." msgstr "" +#. module: fieldservice_stage_validation +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_equipment__display_name +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_location__display_name +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_person__display_name +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__display_name +msgid "Display Name" +msgstr "" + #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_equipment msgid "Field Service Equipment" @@ -52,11 +57,34 @@ msgstr "" msgid "Fields to Validate" msgstr "" +#. module: fieldservice_stage_validation +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_equipment__id +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_location__id +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_order__id +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_person__id +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__id +msgid "ID" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_equipment____last_update +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_location____last_update +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_order____last_update +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_person____last_update +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage____last_update +msgid "Last Modified on" +msgstr "" + #. module: fieldservice_stage_validation #: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id msgid "Model for Stage" msgstr "" +#. module: fieldservice_stage_validation +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_order__display_name +msgid "Order" +msgstr "" + #. module: fieldservice_stage_validation #: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__validate_field_ids msgid "Select fields which must be set on the document in this stage" diff --git a/fieldservice_stage_validation/i18n/fr_FR.po b/fieldservice_stage_validation/i18n/fr_FR.po index b6536c23d9..0a67eb1bb3 100644 --- a/fieldservice_stage_validation/i18n/fr_FR.po +++ b/fieldservice_stage_validation/i18n/fr_FR.po @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 13.0\n" +"Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" "PO-Revision-Date: 2021-05-20 10:48+0000\n" "Last-Translator: Sandrine (ACSONE) \n" diff --git a/fieldservice_stage_validation/i18n/it.po b/fieldservice_stage_validation/i18n/it.po index b3db7763ac..073ad5d802 100644 --- a/fieldservice_stage_validation/i18n/it.po +++ b/fieldservice_stage_validation/i18n/it.po @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 13.0\n" +"Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" "PO-Revision-Date: 2021-09-27 20:34+0000\n" "Last-Translator: mymage \n" diff --git a/fieldservice_stage_validation/i18n/tr.po b/fieldservice_stage_validation/i18n/tr.po index cb168ff9c1..1392393395 100644 --- a/fieldservice_stage_validation/i18n/tr.po +++ b/fieldservice_stage_validation/i18n/tr.po @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 13.0\n" +"Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" diff --git a/fieldservice_stage_validation/models/__init__.py b/fieldservice_stage_validation/models/__init__.py index 3afd424292..07646a0e36 100644 --- a/fieldservice_stage_validation/models/__init__.py +++ b/fieldservice_stage_validation/models/__init__.py @@ -6,4 +6,5 @@ fsm_equipment, fsm_location, fsm_person, + validate_utils, ) diff --git a/fieldservice_stage_validation/models/fsm_equipment.py b/fieldservice_stage_validation/models/fsm_equipment.py index ee7d4d7cf1..38a699534a 100644 --- a/fieldservice_stage_validation/models/fsm_equipment.py +++ b/fieldservice_stage_validation/models/fsm_equipment.py @@ -1,7 +1,8 @@ # Copyright (C) 2020 Brian McMaster # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import _, api, models -from odoo.exceptions import ValidationError +from odoo import api, models + +from .validate_utils import validate_stage_fields class FSMEquipment(models.Model): @@ -9,17 +10,4 @@ class FSMEquipment(models.Model): @api.constrains("stage_id") def _validate_stage_fields(self): - for rec in self: - stage = rec.stage_id - field_ids = stage.validate_field_ids - field_names = [x.name for x in field_ids] - values = rec.read(field_names) - - for name in field_names: - if not values[0][name]: - raise ValidationError( - _( - 'Cannot move to stage "%s" ' - 'until the "%s" field is set.' % (stage.name, name) - ) - ) + validate_stage_fields(self) diff --git a/fieldservice_stage_validation/models/fsm_location.py b/fieldservice_stage_validation/models/fsm_location.py index 08112702b4..9e535f1d5a 100644 --- a/fieldservice_stage_validation/models/fsm_location.py +++ b/fieldservice_stage_validation/models/fsm_location.py @@ -1,7 +1,8 @@ # Copyright (C) 2020 Brian McMaster # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import _, api, models -from odoo.exceptions import ValidationError +from odoo import api, models + +from .validate_utils import validate_stage_fields class FSMLocation(models.Model): @@ -9,17 +10,4 @@ class FSMLocation(models.Model): @api.constrains("stage_id") def _validate_stage_fields(self): - for rec in self: - stage = rec.stage_id - field_ids = stage.validate_field_ids - field_names = [x.name for x in field_ids] - values = rec.read(field_names) - - for name in field_names: - if not values[0][name]: - raise ValidationError( - _( - 'Cannot move to stage "%s" ' - 'until the "%s" field is set.' % (stage.name, name) - ) - ) + validate_stage_fields(self) diff --git a/fieldservice_stage_validation/models/fsm_order.py b/fieldservice_stage_validation/models/fsm_order.py index 812babdb5c..34639ed878 100644 --- a/fieldservice_stage_validation/models/fsm_order.py +++ b/fieldservice_stage_validation/models/fsm_order.py @@ -1,7 +1,8 @@ # Copyright (C) 2020 Brian McMaster # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import _, api, models -from odoo.exceptions import ValidationError +from odoo import api, models + +from .validate_utils import validate_stage_fields class FSMOrder(models.Model): @@ -9,17 +10,4 @@ class FSMOrder(models.Model): @api.constrains("stage_id") def _validate_stage_fields(self): - for rec in self: - stage = rec.stage_id - field_ids = stage.validate_field_ids - field_names = [x.name for x in field_ids] - values = rec.read(field_names) - - for name in field_names: - if not values[0][name]: - raise ValidationError( - _( - 'Cannot move to stage "%s" ' - 'until the "%s" field is set.' % (stage.name, name) - ) - ) + validate_stage_fields(self) diff --git a/fieldservice_stage_validation/models/fsm_person.py b/fieldservice_stage_validation/models/fsm_person.py index 91ba573374..893d68e4bf 100644 --- a/fieldservice_stage_validation/models/fsm_person.py +++ b/fieldservice_stage_validation/models/fsm_person.py @@ -1,7 +1,8 @@ # Copyright (C) 2020 Brian McMaster # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import _, api, models -from odoo.exceptions import ValidationError +from odoo import api, models + +from .validate_utils import validate_stage_fields class FSMPerson(models.Model): @@ -9,17 +10,4 @@ class FSMPerson(models.Model): @api.constrains("stage_id") def _validate_stage_fields(self): - for rec in self: - stage = rec.stage_id - field_ids = stage.validate_field_ids - field_names = [x.name for x in field_ids] - values = rec.read(field_names) - - for name in field_names: - if not values[0][name]: - raise ValidationError( - _( - 'Cannot move to stage "%s" ' - 'until the "%s" field is set.' % (stage.name, name) - ) - ) + validate_stage_fields(self) diff --git a/fieldservice_stage_validation/models/fsm_stage.py b/fieldservice_stage_validation/models/fsm_stage.py index a59b6e9a47..0fba9ed516 100644 --- a/fieldservice_stage_validation/models/fsm_stage.py +++ b/fieldservice_stage_validation/models/fsm_stage.py @@ -6,16 +6,6 @@ class FSMStage(models.Model): _inherit = "fsm.stage" - @api.depends("stage_type") - def _compute_stage_model(self): - model_id = False - Model = self.env["ir.model"] - for rec in self: - if rec.stage_type: - model_string = "fsm." + rec.stage_type - model_id = Model.search([("model", "=", model_string)], limit=1).id - rec.stage_type_model_id = model_id - validate_field_ids = fields.Many2many( "ir.model.fields", string="Fields to Validate", @@ -24,7 +14,17 @@ def _compute_stage_model(self): stage_type_model_id = fields.Many2one( "ir.model", - compute=_compute_stage_model, + compute="_compute_stage_model", string="Model for Stage", help="Technical field to hold model type", ) + + @api.depends("stage_type") + def _compute_stage_model(self): + model_id = False + Model = self.env["ir.model"] + for rec in self: + if rec.stage_type: + model_string = "fsm." + rec.stage_type + model_id = Model.search([("model", "=", model_string)], limit=1).id + rec.stage_type_model_id = model_id diff --git a/fieldservice_stage_validation/models/validate_utils.py b/fieldservice_stage_validation/models/validate_utils.py new file mode 100644 index 0000000000..0d2339e899 --- /dev/null +++ b/fieldservice_stage_validation/models/validate_utils.py @@ -0,0 +1,22 @@ +# Copyright 2022 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import _ +from odoo.exceptions import ValidationError + + +def validate_stage_fields(records): + for rec in records: + stage = rec.stage_id + field_ids = stage.validate_field_ids + field_names = [x.name for x in field_ids] + values = rec.read(field_names) + + for name in field_names: + if not values[0][name]: + raise ValidationError( + _( + 'Cannot move to stage "%s" ' + 'until the "%s" field is set.' % (stage.name, name) + ) + ) diff --git a/fieldservice_stage_validation/static/description/index.html b/fieldservice_stage_validation/static/description/index.html index 2fca707d18..d8224aced8 100644 --- a/fieldservice_stage_validation/static/description/index.html +++ b/fieldservice_stage_validation/static/description/index.html @@ -367,7 +367,7 @@

FSM Stage Validation

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

+

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

As the stage of a field service document progresses, it may be important for specific fields of the document be completed.

For example, when a field service order enters the ‘Complete’ stage, the @@ -417,7 +417,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 -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -443,7 +443,7 @@

Maintainers

promote its widespread use.

Current maintainers:

brian10048 max3903

-

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

+

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_stage_validation/tests/test_fsm_stage_validation.py b/fieldservice_stage_validation/tests/test_fsm_stage_validation.py index bdc44da914..f30102f317 100644 --- a/fieldservice_stage_validation/tests/test_fsm_stage_validation.py +++ b/fieldservice_stage_validation/tests/test_fsm_stage_validation.py @@ -1,6 +1,7 @@ # Copyright 2020, Brian McMaster # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) +from odoo import fields from odoo.exceptions import ValidationError from odoo.tests import SavepointCase @@ -8,8 +9,8 @@ class TestFSMStageValidation(SavepointCase): @classmethod def setUpClass(cls): - super(TestFSMStageValidation, cls).setUpClass() - + super().setUpClass() + cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True)) cls.stage = cls.env["fsm.stage"] cls.fsm_order = cls.env["fsm.order"] cls.fsm_person = cls.env["fsm.person"] @@ -133,6 +134,14 @@ def setUpClass(cls): # Create an Order cls.order_01 = cls.fsm_order.create({"location_id": cls.location_01.id}) + def get_validate_message(self, stage): + stage_name = stage.name + field_name = fields.first(stage.validate_field_ids).name + return 'Cannot move to stage "%s" until the "%s" field is set.' % ( + stage_name, + field_name, + ) + def test_fsm_stage_validation(self): # Validate the stage computes the correct model type @@ -141,9 +150,9 @@ def test_fsm_stage_validation(self): self.env["ir.model"].search([("model", "=", "fsm.order")]), "FSM Stage model is not computed correctly", ) - + validate_message = self.get_validate_message(self.stage_equipment) # Validate the Equipment cannot move to next stage - with self.assertRaises(ValidationError): + with self.assertRaisesRegex(ValidationError, validate_message): self.equipment_01.next_stage() # Update the Equipment notes field and validate it goes to next stage @@ -154,9 +163,9 @@ def test_fsm_stage_validation(self): self.stage_equipment, "FSM Equipment did not progress to correct stage", ) - + validate_message = self.get_validate_message(self.stage_location) # Validate the Location cannot move to next stage - with self.assertRaises(ValidationError): + with self.assertRaisesRegex(ValidationError, validate_message): self.location_01.next_stage() # Update the Location directions field and validate it goes to next stage @@ -167,9 +176,9 @@ def test_fsm_stage_validation(self): self.stage_location, "FSM Location did not progress to correct stage", ) - + validate_message = self.get_validate_message(self.stage_person) # Validate the Person cannot move to next stage - with self.assertRaises(ValidationError): + with self.assertRaisesRegex(ValidationError, validate_message): self.person_01.next_stage() # Update the Person mobile field and validate it goes to next stage @@ -180,9 +189,9 @@ def test_fsm_stage_validation(self): self.stage_person, "FSM Person did not progress to correct stage", ) - + validate_message = self.get_validate_message(self.stage_order) # Validate the Order cannot move to stage which requires validation - with self.assertRaises(ValidationError): + with self.assertRaisesRegex(ValidationError, validate_message): self.order_01.write({"stage_id": self.stage_order.id}) # Update the Order description field and validate it goes to next stage diff --git a/fieldservice_stage_validation/views/fsm_stage.xml b/fieldservice_stage_validation/views/fsm_stage.xml index b29c51bba3..adf924b01c 100644 --- a/fieldservice_stage_validation/views/fsm_stage.xml +++ b/fieldservice_stage_validation/views/fsm_stage.xml @@ -1,3 +1,4 @@ + fsm.stage.validation.form From 8aa2f3293922ac3d105af92ea46e302bb731d1a3 Mon Sep 17 00:00:00 2001 From: ShwetaSerpentCS Date: Thu, 3 Nov 2022 16:43:09 +0530 Subject: [PATCH 18/37] [FIX] pre-commit. --- fieldservice_stage_validation/__manifest__.py | 2 +- fieldservice_stage_validation/models/validate_utils.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fieldservice_stage_validation/__manifest__.py b/fieldservice_stage_validation/__manifest__.py index 97386d0bd5..987210ebca 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": "14.0.1.0.0", + "version": "15.0.1.0.0", "category": "Field Service", "author": "Brian McMaster, Odoo Community Association (OCA)", "website": "https://github.com/OCA/field-service", diff --git a/fieldservice_stage_validation/models/validate_utils.py b/fieldservice_stage_validation/models/validate_utils.py index 0d2339e899..e8129d8cc1 100644 --- a/fieldservice_stage_validation/models/validate_utils.py +++ b/fieldservice_stage_validation/models/validate_utils.py @@ -16,7 +16,9 @@ def validate_stage_fields(records): if not values[0][name]: raise ValidationError( _( - 'Cannot move to stage "%s" ' - 'until the "%s" field is set.' % (stage.name, name) + 'Cannot move to stage "%(stage_name)s" ' + 'until the "%(name)s" field is set.', + stage_name=stage.name, + name=name, ) ) From 733583a2cd63336317144bbab2576cd9219c2724 Mon Sep 17 00:00:00 2001 From: ShwetaSerpentCS Date: Mon, 7 Nov 2022 14:52:00 +0530 Subject: [PATCH 19/37] Update pre-commit.yml --- fieldservice_stage_validation/README.rst | 10 +++--- fieldservice_stage_validation/i18n/es_AR.po | 15 ++++---- .../i18n/fieldservice_stage_validation.pot | 35 ++----------------- fieldservice_stage_validation/i18n/fr_FR.po | 14 ++++---- fieldservice_stage_validation/i18n/it.po | 15 ++++---- fieldservice_stage_validation/i18n/pt_PT.po | 17 +++++---- fieldservice_stage_validation/i18n/tr.po | 8 ++--- .../models/fsm_stage.py | 2 +- .../static/description/index.html | 6 ++-- 9 files changed, 50 insertions(+), 72 deletions(-) diff --git a/fieldservice_stage_validation/README.rst b/fieldservice_stage_validation/README.rst index 99dcf816a0..7614749349 100644 --- a/fieldservice_stage_validation/README.rst +++ b/fieldservice_stage_validation/README.rst @@ -14,13 +14,13 @@ FSM Stage Validation :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/14.0/fieldservice_stage_validation + :target: https://github.com/OCA/field-service/tree/15.0/fieldservice_stage_validation :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-14-0/field-service-14-0-fieldservice_stage_validation + :target: https://translation.odoo-community.org/projects/field-service-15-0/field-service-15-0-fieldservice_stage_validation :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 + :target: https://runbot.odoo-community.org/runbot/264/15.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -67,7 +67,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 -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -108,6 +108,6 @@ Current `maintainers `__: |maintainer-brian10048| |maintainer-max3903| -This module is part of the `OCA/field-service `_ project on GitHub. +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_stage_validation/i18n/es_AR.po b/fieldservice_stage_validation/i18n/es_AR.po index 55f162ef6e..9ee5c4dc32 100644 --- a/fieldservice_stage_validation/i18n/es_AR.po +++ b/fieldservice_stage_validation/i18n/es_AR.po @@ -17,14 +17,11 @@ msgstr "" "X-Generator: Weblate 4.3.2\n" #. module: fieldservice_stage_validation -#: code:addons/fieldservice_stage_validation/models/fsm_equipment.py:0 -#: code:addons/fieldservice_stage_validation/models/fsm_location.py:0 -#: code:addons/fieldservice_stage_validation/models/fsm_order.py:0 -#: code:addons/fieldservice_stage_validation/models/fsm_person.py:0 +#: code:addons/fieldservice_stage_validation/models/validate_utils.py:0 #, python-format -msgid "Cannot move to stage \"%s\" until the \"%s\" field is set." +msgid "" +"Cannot move to stage \"%(stage_name)s\" until the \"%(name)s\" field is set." msgstr "" -"No se puede mover a la etapa \"%s\" hasta que se establezca el campo \"%s\"." #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_equipment @@ -71,3 +68,9 @@ msgstr "" #: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id msgid "Technical field to hold model type" msgstr "Campo técnico para mantener el tipo del modelo" + +#, python-format +#~ msgid "Cannot move to stage \"%s\" until the \"%s\" field is set." +#~ msgstr "" +#~ "No se puede mover a la etapa \"%s\" hasta que se establezca el campo \"%s" +#~ "\"." diff --git a/fieldservice_stage_validation/i18n/fieldservice_stage_validation.pot b/fieldservice_stage_validation/i18n/fieldservice_stage_validation.pot index 89d5d13cff..c16da4915a 100644 --- a/fieldservice_stage_validation/i18n/fieldservice_stage_validation.pot +++ b/fieldservice_stage_validation/i18n/fieldservice_stage_validation.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 14.0\n" +"Project-Id-Version: Odoo Server 15.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" @@ -16,15 +16,7 @@ msgstr "" #. module: fieldservice_stage_validation #: code:addons/fieldservice_stage_validation/models/validate_utils.py:0 #, python-format -msgid "Cannot move to stage \"%s\" until the \"%s\" field is set." -msgstr "" - -#. module: fieldservice_stage_validation -#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_equipment__display_name -#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_location__display_name -#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_person__display_name -#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__display_name -msgid "Display Name" +msgid "Cannot move to stage \"%(stage_name)s\" until the \"%(name)s\" field is set." msgstr "" #. module: fieldservice_stage_validation @@ -57,34 +49,11 @@ msgstr "" msgid "Fields to Validate" msgstr "" -#. module: fieldservice_stage_validation -#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_equipment__id -#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_location__id -#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_order__id -#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_person__id -#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__id -msgid "ID" -msgstr "" - -#. module: fieldservice_stage_validation -#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_equipment____last_update -#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_location____last_update -#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_order____last_update -#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_person____last_update -#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage____last_update -msgid "Last Modified on" -msgstr "" - #. module: fieldservice_stage_validation #: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id msgid "Model for Stage" msgstr "" -#. module: fieldservice_stage_validation -#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_order__display_name -msgid "Order" -msgstr "" - #. module: fieldservice_stage_validation #: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__validate_field_ids msgid "Select fields which must be set on the document in this stage" diff --git a/fieldservice_stage_validation/i18n/fr_FR.po b/fieldservice_stage_validation/i18n/fr_FR.po index 0a67eb1bb3..15d44fcd4d 100644 --- a/fieldservice_stage_validation/i18n/fr_FR.po +++ b/fieldservice_stage_validation/i18n/fr_FR.po @@ -17,13 +17,11 @@ msgstr "" "X-Generator: Weblate 4.3.2\n" #. module: fieldservice_stage_validation -#: code:addons/fieldservice_stage_validation/models/fsm_equipment.py:0 -#: code:addons/fieldservice_stage_validation/models/fsm_location.py:0 -#: code:addons/fieldservice_stage_validation/models/fsm_order.py:0 -#: code:addons/fieldservice_stage_validation/models/fsm_person.py:0 +#: code:addons/fieldservice_stage_validation/models/validate_utils.py:0 #, python-format -msgid "Cannot move to stage \"%s\" until the \"%s\" field is set." -msgstr "Le champ \"%s\" doit être rempli pour passer à l'étape \"%s\"." +msgid "" +"Cannot move to stage \"%(stage_name)s\" until the \"%(name)s\" field is set." +msgstr "" #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_equipment @@ -71,3 +69,7 @@ msgstr "" #: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id msgid "Technical field to hold model type" msgstr "Champ technique pour contenir le type de modèle" + +#, python-format +#~ msgid "Cannot move to stage \"%s\" until the \"%s\" field is set." +#~ msgstr "Le champ \"%s\" doit être rempli pour passer à l'étape \"%s\"." diff --git a/fieldservice_stage_validation/i18n/it.po b/fieldservice_stage_validation/i18n/it.po index 073ad5d802..2be9d52480 100644 --- a/fieldservice_stage_validation/i18n/it.po +++ b/fieldservice_stage_validation/i18n/it.po @@ -17,14 +17,11 @@ msgstr "" "X-Generator: Weblate 4.3.2\n" #. module: fieldservice_stage_validation -#: code:addons/fieldservice_stage_validation/models/fsm_equipment.py:0 -#: code:addons/fieldservice_stage_validation/models/fsm_location.py:0 -#: code:addons/fieldservice_stage_validation/models/fsm_order.py:0 -#: code:addons/fieldservice_stage_validation/models/fsm_person.py:0 +#: code:addons/fieldservice_stage_validation/models/validate_utils.py:0 #, python-format -msgid "Cannot move to stage \"%s\" until the \"%s\" field is set." +msgid "" +"Cannot move to stage \"%(stage_name)s\" until the \"%(name)s\" field is set." msgstr "" -"Non si può passare alla fase \"%s\" finché il campo \"%s\" non è impostato." #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_equipment @@ -71,3 +68,9 @@ msgstr "" #: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id msgid "Technical field to hold model type" msgstr "Campo tecnico per memorizzare il tipo modello" + +#, python-format +#~ msgid "Cannot move to stage \"%s\" until the \"%s\" field is set." +#~ msgstr "" +#~ "Non si può passare alla fase \"%s\" finché il campo \"%s\" non è " +#~ "impostato." diff --git a/fieldservice_stage_validation/i18n/pt_PT.po b/fieldservice_stage_validation/i18n/pt_PT.po index 822124843a..b6ecc22c87 100644 --- a/fieldservice_stage_validation/i18n/pt_PT.po +++ b/fieldservice_stage_validation/i18n/pt_PT.po @@ -1,6 +1,6 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * fieldservice_stage_validation +# * fieldservice_stage_validation # msgid "" msgstr "" @@ -17,14 +17,11 @@ msgstr "" "X-Generator: Weblate 3.10\n" #. module: fieldservice_stage_validation -#: code:addons/fieldservice_stage_validation/models/fsm_equipment.py:22 -#: code:addons/fieldservice_stage_validation/models/fsm_location.py:22 -#: code:addons/fieldservice_stage_validation/models/fsm_order.py:22 -#: code:addons/fieldservice_stage_validation/models/fsm_person.py:22 +#: code:addons/fieldservice_stage_validation/models/validate_utils.py:0 #, python-format -msgid "Cannot move to stage \"%s\" until the \"%s\" field is set." +msgid "" +"Cannot move to stage \"%(stage_name)s\" until the \"%(name)s\" field is set." msgstr "" -"N??o pode mudar para etapa \"%s\" enquanto o campo \"%s\" n??o for definido." #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_equipment @@ -71,3 +68,9 @@ msgstr "" #: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id msgid "Technical field to hold model type" msgstr "Campo t??cnico para o tipo de modelo" + +#, python-format +#~ msgid "Cannot move to stage \"%s\" until the \"%s\" field is set." +#~ msgstr "" +#~ "N??o pode mudar para etapa \"%s\" enquanto o campo \"%s\" n??o for " +#~ "definido." diff --git a/fieldservice_stage_validation/i18n/tr.po b/fieldservice_stage_validation/i18n/tr.po index 1392393395..eee036acd8 100644 --- a/fieldservice_stage_validation/i18n/tr.po +++ b/fieldservice_stage_validation/i18n/tr.po @@ -15,12 +15,10 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n != 1;\n" #. module: fieldservice_stage_validation -#: code:addons/fieldservice_stage_validation/models/fsm_equipment.py:0 -#: code:addons/fieldservice_stage_validation/models/fsm_location.py:0 -#: code:addons/fieldservice_stage_validation/models/fsm_order.py:0 -#: code:addons/fieldservice_stage_validation/models/fsm_person.py:0 +#: code:addons/fieldservice_stage_validation/models/validate_utils.py:0 #, python-format -msgid "Cannot move to stage \"%s\" until the \"%s\" field is set." +msgid "" +"Cannot move to stage \"%(stage_name)s\" until the \"%(name)s\" field is set." msgstr "" #. module: fieldservice_stage_validation diff --git a/fieldservice_stage_validation/models/fsm_stage.py b/fieldservice_stage_validation/models/fsm_stage.py index 0fba9ed516..5063f41880 100644 --- a/fieldservice_stage_validation/models/fsm_stage.py +++ b/fieldservice_stage_validation/models/fsm_stage.py @@ -21,9 +21,9 @@ class FSMStage(models.Model): @api.depends("stage_type") def _compute_stage_model(self): - model_id = False Model = self.env["ir.model"] for rec in self: + model_id = False if rec.stage_type: model_string = "fsm." + rec.stage_type model_id = Model.search([("model", "=", model_string)], limit=1).id diff --git a/fieldservice_stage_validation/static/description/index.html b/fieldservice_stage_validation/static/description/index.html index d8224aced8..ce8b2a9fd9 100644 --- a/fieldservice_stage_validation/static/description/index.html +++ b/fieldservice_stage_validation/static/description/index.html @@ -367,7 +367,7 @@

FSM Stage Validation

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

+

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

As the stage of a field service document progresses, it may be important for specific fields of the document be completed.

For example, when a field service order enters the ‘Complete’ stage, the @@ -417,7 +417,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 -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -443,7 +443,7 @@

Maintainers

promote its widespread use.

Current maintainers:

brian10048 max3903

-

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

+

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.

From 45e4580c16f29c20824c03a1076aea3a03c85453 Mon Sep 17 00:00:00 2001 From: ShwetaSerpentCS Date: Tue, 8 Nov 2022 14:30:37 +0530 Subject: [PATCH 20/37] [FIX] fieldservice_stage_validation: test --- .../tests/test_fsm_stage_validation.py | 75 +++++++++---------- 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/fieldservice_stage_validation/tests/test_fsm_stage_validation.py b/fieldservice_stage_validation/tests/test_fsm_stage_validation.py index f30102f317..92f72712ed 100644 --- a/fieldservice_stage_validation/tests/test_fsm_stage_validation.py +++ b/fieldservice_stage_validation/tests/test_fsm_stage_validation.py @@ -3,39 +3,38 @@ from odoo import fields from odoo.exceptions import ValidationError -from odoo.tests import SavepointCase +from odoo.tests.common import TransactionCase -class TestFSMStageValidation(SavepointCase): - @classmethod - def setUpClass(cls): - super().setUpClass() - cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True)) - cls.stage = cls.env["fsm.stage"] - cls.fsm_order = cls.env["fsm.order"] - cls.fsm_person = cls.env["fsm.person"] - cls.fsm_location = cls.env["fsm.location"] - cls.fsm_equipment = cls.env["fsm.equipment"] - cls.ir_model_fields = cls.env["ir.model.fields"] +class TestFSMStageValidation(TransactionCase): + def setUp(self): + super().setUp() + self.env = self.env(context=dict(self.env.context, tracking_disable=True)) + self.stage = self.env["fsm.stage"] + self.fsm_order = self.env["fsm.order"] + self.fsm_person = self.env["fsm.person"] + self.fsm_location = self.env["fsm.location"] + self.fsm_equipment = self.env["fsm.equipment"] + self.ir_model_fields = self.env["ir.model.fields"] # Get some fields to use in the stages - cls.order_field = cls.ir_model_fields.search( + self.order_field = self.ir_model_fields.search( [("model", "=", "fsm.order"), ("name", "=", "description")] ) - cls.person_field = cls.ir_model_fields.search( + self.person_field = self.ir_model_fields.search( [("model", "=", "fsm.person"), ("name", "=", "mobile")] ) - cls.location_field = cls.ir_model_fields.search( + self.location_field = self.ir_model_fields.search( [("model", "=", "fsm.location"), ("name", "=", "direction")] ) - cls.equipment_field = cls.ir_model_fields.search( + self.equipment_field = self.ir_model_fields.search( [("model", "=", "fsm.equipment"), ("name", "=", "notes")] ) # For each model type, create a default stage and a stage # which will apply field validation # Order Stages - cls.stage_order_default = cls.stage.create( + self.stage_order_default = self.stage.create( { "name": "Order Stage Default", "stage_type": "order", @@ -43,16 +42,16 @@ def setUpClass(cls): "sequence": "10", } ) - cls.stage_order = cls.stage.create( + self.stage_order = self.stage.create( { "name": "Order Stage Validate", "stage_type": "order", - "validate_field_ids": [(6, 0, [cls.order_field.id])], + "validate_field_ids": [(6, 0, [self.order_field.id])], "sequence": "11", } ) # Person Stages - cls.stage_person_default = cls.stage.create( + self.stage_person_default = self.stage.create( { "name": "Person Stage Default", "stage_type": "worker", @@ -60,16 +59,16 @@ def setUpClass(cls): "sequence": "10", } ) - cls.stage_person = cls.stage.create( + self.stage_person = self.stage.create( { "name": "Person Stage Validate", "stage_type": "worker", - "validate_field_ids": [(6, 0, [cls.person_field.id])], + "validate_field_ids": [(6, 0, [self.person_field.id])], "sequence": "11", } ) # Location Stages - cls.stage_location_default = cls.stage.create( + self.stage_location_default = self.stage.create( { "name": "Location Stage Default", "stage_type": "location", @@ -77,16 +76,16 @@ def setUpClass(cls): "sequence": "10", } ) - cls.stage_location = cls.stage.create( + self.stage_location = self.stage.create( { "name": "Location Stage Validate", "stage_type": "location", - "validate_field_ids": [(6, 0, [cls.location_field.id])], + "validate_field_ids": [(6, 0, [self.location_field.id])], "sequence": "11", } ) # Equipment Stages - cls.stage_equipment_default = cls.stage.create( + self.stage_equipment_default = self.stage.create( { "name": "Equipment Stage Default", "stage_type": "equipment", @@ -94,45 +93,45 @@ def setUpClass(cls): "sequence": "10", } ) - cls.stage_equipment = cls.stage.create( + self.stage_equipment = self.stage.create( { "name": "Equipment Stage Validate", "stage_type": "equipment", - "validate_field_ids": [(6, 0, [cls.equipment_field.id])], + "validate_field_ids": [(6, 0, [self.equipment_field.id])], "sequence": "11", } ) # Create a person - cls.person_01 = cls.fsm_person.create( + self.person_01 = self.fsm_person.create( { "name": "FSM Worker 01", - "partner_id": cls.env["res.partner"] + "partner_id": self.env["res.partner"] .create({"name": "Worker 01 Partner"}) .id, - "stage_id": cls.stage_person_default.id, + "stage_id": self.stage_person_default.id, } ) # Create a location - cls.location_01 = cls.fsm_location.create( + self.location_01 = self.fsm_location.create( { "name": "Location 01", - "owner_id": cls.env["res.partner"] + "owner_id": self.env["res.partner"] .create({"name": "Location 01 Partner"}) .id, - "stage_id": cls.stage_location_default.id, + "stage_id": self.stage_location_default.id, } ) # Create an Equipment - cls.equipment_01 = cls.fsm_equipment.create( + self.equipment_01 = self.fsm_equipment.create( { "name": "Equipment 01", - "current_location_id": cls.location_01.id, - "stage_id": cls.stage_equipment_default.id, + "current_location_id": self.location_01.id, + "stage_id": self.stage_equipment_default.id, } ) # Create an Order - cls.order_01 = cls.fsm_order.create({"location_id": cls.location_01.id}) + self.order_01 = self.fsm_order.create({"location_id": self.location_01.id}) def get_validate_message(self, stage): stage_name = stage.name From 77742e06d2945795ada3e260ca461db622cf5534 Mon Sep 17 00:00:00 2001 From: Ignacio Buioli Date: Sat, 12 Nov 2022 04:27:01 +0000 Subject: [PATCH 21/37] Translated using Weblate (Spanish (Argentina)) Currently translated at 100.0% (10 of 10 strings) Translation: field-service-15.0/field-service-15.0-fieldservice_stage_validation Translate-URL: https://translation.odoo-community.org/projects/field-service-15-0/field-service-15-0-fieldservice_stage_validation/es_AR/ --- fieldservice_stage_validation/i18n/es_AR.po | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fieldservice_stage_validation/i18n/es_AR.po b/fieldservice_stage_validation/i18n/es_AR.po index 9ee5c4dc32..dad0a61cc9 100644 --- a/fieldservice_stage_validation/i18n/es_AR.po +++ b/fieldservice_stage_validation/i18n/es_AR.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2021-04-28 03:47+0000\n" +"PO-Revision-Date: 2022-11-12 04:46+0000\n" "Last-Translator: Ignacio Buioli \n" "Language-Team: none\n" "Language: es_AR\n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.3.2\n" +"X-Generator: Weblate 4.14.1\n" #. module: fieldservice_stage_validation #: code:addons/fieldservice_stage_validation/models/validate_utils.py:0 @@ -22,6 +22,8 @@ msgstr "" msgid "" "Cannot move to stage \"%(stage_name)s\" until the \"%(name)s\" field is set." msgstr "" +"No se puede mover al escenario \"%(stage_name)s\" hasta que se establezca el " +"campo \"%(name)s\"." #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_equipment From cfc742d6242e56736e7230cdac1b49d833f639e2 Mon Sep 17 00:00:00 2001 From: mymage Date: Tue, 15 Nov 2022 17:18:29 +0000 Subject: [PATCH 22/37] Translated using Weblate (Italian) Currently translated at 100.0% (10 of 10 strings) Translation: field-service-15.0/field-service-15.0-fieldservice_stage_validation Translate-URL: https://translation.odoo-community.org/projects/field-service-15-0/field-service-15-0-fieldservice_stage_validation/it/ --- fieldservice_stage_validation/i18n/it.po | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fieldservice_stage_validation/i18n/it.po b/fieldservice_stage_validation/i18n/it.po index 2be9d52480..6203f63651 100644 --- a/fieldservice_stage_validation/i18n/it.po +++ b/fieldservice_stage_validation/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: 2021-09-27 20:34+0000\n" +"PO-Revision-Date: 2022-11-15 19:44+0000\n" "Last-Translator: mymage \n" "Language-Team: none\n" "Language: it\n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.3.2\n" +"X-Generator: Weblate 4.14.1\n" #. module: fieldservice_stage_validation #: code:addons/fieldservice_stage_validation/models/validate_utils.py:0 @@ -22,6 +22,8 @@ msgstr "" msgid "" "Cannot move to stage \"%(stage_name)s\" until the \"%(name)s\" field is set." msgstr "" +"Non si può passare allo stato \"%(stage_name)s\" finché il campo \"%(name)s\"" +" non è compilato." #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_equipment From f70e9a844314daa7d0e30bc8308ae473520f7ee2 Mon Sep 17 00:00:00 2001 From: "Leonardo J. Caballero G" Date: Thu, 2 Mar 2023 19:16:56 +0000 Subject: [PATCH 23/37] Added translation using Weblate (Spanish) --- fieldservice_stage_validation/i18n/es.po | 66 ++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 fieldservice_stage_validation/i18n/es.po diff --git a/fieldservice_stage_validation/i18n/es.po b/fieldservice_stage_validation/i18n/es.po new file mode 100644 index 0000000000..c278015c8a --- /dev/null +++ b/fieldservice_stage_validation/i18n/es.po @@ -0,0 +1,66 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_stage_validation +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\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" + +#. module: fieldservice_stage_validation +#: code:addons/fieldservice_stage_validation/models/validate_utils.py:0 +#, python-format +msgid "Cannot move to stage \"%(stage_name)s\" until the \"%(name)s\" field is set." +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_equipment +msgid "Field Service Equipment" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_location +msgid "Field Service Location" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_order +msgid "Field Service Order" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_stage +msgid "Field Service Stage" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_person +msgid "Field Service Worker" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__validate_field_ids +msgid "Fields to Validate" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id +msgid "Model for Stage" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__validate_field_ids +msgid "Select fields which must be set on the document in this stage" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id +msgid "Technical field to hold model type" +msgstr "" From e08bbb4ef0ba3d968f4a3c8f611a91e04fbae3d4 Mon Sep 17 00:00:00 2001 From: "Leonardo J. Caballero G" Date: Thu, 2 Mar 2023 19:19:51 +0000 Subject: [PATCH 24/37] Translated using Weblate (Spanish) Currently translated at 100.0% (10 of 10 strings) Translation: field-service-15.0/field-service-15.0-fieldservice_stage_validation Translate-URL: https://translation.odoo-community.org/projects/field-service-15-0/field-service-15-0-fieldservice_stage_validation/es/ --- fieldservice_stage_validation/i18n/es.po | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/fieldservice_stage_validation/i18n/es.po b/fieldservice_stage_validation/i18n/es.po index c278015c8a..346045ca48 100644 --- a/fieldservice_stage_validation/i18n/es.po +++ b/fieldservice_stage_validation/i18n/es.po @@ -6,61 +6,66 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 15.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2023-03-02 20:22+0000\n" +"Last-Translator: Leonardo J. Caballero G. \n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.14.1\n" #. module: fieldservice_stage_validation #: code:addons/fieldservice_stage_validation/models/validate_utils.py:0 #, python-format msgid "Cannot move to stage \"%(stage_name)s\" until the \"%(name)s\" field is set." msgstr "" +"No se puede mover al escenario \"%(stage_name)s\" hasta que se establezca el " +"campo \"%(name)s\"." #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_equipment msgid "Field Service Equipment" -msgstr "" +msgstr "Equipo de Servicio de Campo" #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_location msgid "Field Service Location" -msgstr "" +msgstr "Ubicación del Servicio de Campo" #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_order msgid "Field Service Order" -msgstr "" +msgstr "Pedido de Servicio de Campo" #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_stage msgid "Field Service Stage" -msgstr "" +msgstr "Etapa de Servicio de Campo" #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_person msgid "Field Service Worker" -msgstr "" +msgstr "Trabajador de Servicio de Campo" #. module: fieldservice_stage_validation #: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__validate_field_ids msgid "Fields to Validate" -msgstr "" +msgstr "Campos a Validar" #. module: fieldservice_stage_validation #: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id msgid "Model for Stage" -msgstr "" +msgstr "Modelo para la Etapa" #. module: fieldservice_stage_validation #: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__validate_field_ids msgid "Select fields which must be set on the document in this stage" msgstr "" +"Seleccione los campos que se deben establecer en el documento en esta etapa" #. module: fieldservice_stage_validation #: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id msgid "Technical field to hold model type" -msgstr "" +msgstr "Campo técnico para mantener el tipo del modelo" From d3b66652d0b0a8c03cad1ab85c1e1750d54b6bff Mon Sep 17 00:00:00 2001 From: Juliette BLANC Date: Tue, 2 May 2023 16:00:33 +0200 Subject: [PATCH 25/37] [MIG] fieldservice_stage_validation: Migration to 16.0 --- fieldservice_stage_validation/__manifest__.py | 2 +- .../tests/test_fsm_stage_validation.py | 71 ++++++++++--------- 2 files changed, 37 insertions(+), 36 deletions(-) diff --git a/fieldservice_stage_validation/__manifest__.py b/fieldservice_stage_validation/__manifest__.py index 987210ebca..8abac6be0b 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": "15.0.1.0.0", + "version": "16.0.1.0.0", "category": "Field Service", "author": "Brian McMaster, Odoo Community Association (OCA)", "website": "https://github.com/OCA/field-service", diff --git a/fieldservice_stage_validation/tests/test_fsm_stage_validation.py b/fieldservice_stage_validation/tests/test_fsm_stage_validation.py index 92f72712ed..5ae704f06a 100644 --- a/fieldservice_stage_validation/tests/test_fsm_stage_validation.py +++ b/fieldservice_stage_validation/tests/test_fsm_stage_validation.py @@ -7,34 +7,35 @@ class TestFSMStageValidation(TransactionCase): - def setUp(self): - super().setUp() - self.env = self.env(context=dict(self.env.context, tracking_disable=True)) - self.stage = self.env["fsm.stage"] - self.fsm_order = self.env["fsm.order"] - self.fsm_person = self.env["fsm.person"] - self.fsm_location = self.env["fsm.location"] - self.fsm_equipment = self.env["fsm.equipment"] - self.ir_model_fields = self.env["ir.model.fields"] + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True)) + cls.stage = cls.env["fsm.stage"] + cls.fsm_order = cls.env["fsm.order"] + cls.fsm_person = cls.env["fsm.person"] + cls.fsm_location = cls.env["fsm.location"] + cls.fsm_equipment = cls.env["fsm.equipment"] + cls.ir_model_fields = cls.env["ir.model.fields"] # Get some fields to use in the stages - self.order_field = self.ir_model_fields.search( + cls.order_field = cls.ir_model_fields.search( [("model", "=", "fsm.order"), ("name", "=", "description")] ) - self.person_field = self.ir_model_fields.search( + cls.person_field = cls.ir_model_fields.search( [("model", "=", "fsm.person"), ("name", "=", "mobile")] ) - self.location_field = self.ir_model_fields.search( + cls.location_field = cls.ir_model_fields.search( [("model", "=", "fsm.location"), ("name", "=", "direction")] ) - self.equipment_field = self.ir_model_fields.search( + cls.equipment_field = cls.ir_model_fields.search( [("model", "=", "fsm.equipment"), ("name", "=", "notes")] ) # For each model type, create a default stage and a stage # which will apply field validation # Order Stages - self.stage_order_default = self.stage.create( + cls.stage_order_default = cls.stage.create( { "name": "Order Stage Default", "stage_type": "order", @@ -42,16 +43,16 @@ def setUp(self): "sequence": "10", } ) - self.stage_order = self.stage.create( + cls.stage_order = cls.stage.create( { "name": "Order Stage Validate", "stage_type": "order", - "validate_field_ids": [(6, 0, [self.order_field.id])], + "validate_field_ids": [(6, 0, [cls.order_field.id])], "sequence": "11", } ) # Person Stages - self.stage_person_default = self.stage.create( + cls.stage_person_default = cls.stage.create( { "name": "Person Stage Default", "stage_type": "worker", @@ -59,16 +60,16 @@ def setUp(self): "sequence": "10", } ) - self.stage_person = self.stage.create( + cls.stage_person = cls.stage.create( { "name": "Person Stage Validate", "stage_type": "worker", - "validate_field_ids": [(6, 0, [self.person_field.id])], + "validate_field_ids": [(6, 0, [cls.person_field.id])], "sequence": "11", } ) # Location Stages - self.stage_location_default = self.stage.create( + cls.stage_location_default = cls.stage.create( { "name": "Location Stage Default", "stage_type": "location", @@ -76,16 +77,16 @@ def setUp(self): "sequence": "10", } ) - self.stage_location = self.stage.create( + cls.stage_location = cls.stage.create( { "name": "Location Stage Validate", "stage_type": "location", - "validate_field_ids": [(6, 0, [self.location_field.id])], + "validate_field_ids": [(6, 0, [cls.location_field.id])], "sequence": "11", } ) # Equipment Stages - self.stage_equipment_default = self.stage.create( + cls.stage_equipment_default = cls.stage.create( { "name": "Equipment Stage Default", "stage_type": "equipment", @@ -93,45 +94,45 @@ def setUp(self): "sequence": "10", } ) - self.stage_equipment = self.stage.create( + cls.stage_equipment = cls.stage.create( { "name": "Equipment Stage Validate", "stage_type": "equipment", - "validate_field_ids": [(6, 0, [self.equipment_field.id])], + "validate_field_ids": [(6, 0, [cls.equipment_field.id])], "sequence": "11", } ) # Create a person - self.person_01 = self.fsm_person.create( + cls.person_01 = cls.fsm_person.create( { "name": "FSM Worker 01", - "partner_id": self.env["res.partner"] + "partner_id": cls.env["res.partner"] .create({"name": "Worker 01 Partner"}) .id, - "stage_id": self.stage_person_default.id, + "stage_id": cls.stage_person_default.id, } ) # Create a location - self.location_01 = self.fsm_location.create( + cls.location_01 = cls.fsm_location.create( { "name": "Location 01", - "owner_id": self.env["res.partner"] + "owner_id": cls.env["res.partner"] .create({"name": "Location 01 Partner"}) .id, - "stage_id": self.stage_location_default.id, + "stage_id": cls.stage_location_default.id, } ) # Create an Equipment - self.equipment_01 = self.fsm_equipment.create( + cls.equipment_01 = cls.fsm_equipment.create( { "name": "Equipment 01", - "current_location_id": self.location_01.id, - "stage_id": self.stage_equipment_default.id, + "current_location_id": cls.location_01.id, + "stage_id": cls.stage_equipment_default.id, } ) # Create an Order - self.order_01 = self.fsm_order.create({"location_id": self.location_01.id}) + cls.order_01 = cls.fsm_order.create({"location_id": cls.location_01.id}) def get_validate_message(self, stage): stage_name = stage.name From d40f2df34f140432fe505a7efb5d28e5f4f9ffa6 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Thu, 13 Jul 2023 17:06:12 +0000 Subject: [PATCH 26/37] [UPD] Update fieldservice_stage_validation.pot --- .../i18n/fieldservice_stage_validation.pot | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fieldservice_stage_validation/i18n/fieldservice_stage_validation.pot b/fieldservice_stage_validation/i18n/fieldservice_stage_validation.pot index c16da4915a..046e90c06b 100644 --- a/fieldservice_stage_validation/i18n/fieldservice_stage_validation.pot +++ b/fieldservice_stage_validation/i18n/fieldservice_stage_validation.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 15.0\n" +"Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" @@ -14,6 +14,7 @@ msgstr "" "Plural-Forms: \n" #. module: fieldservice_stage_validation +#. odoo-python #: code:addons/fieldservice_stage_validation/models/validate_utils.py:0 #, python-format msgid "Cannot move to stage \"%(stage_name)s\" until the \"%(name)s\" field is set." From f86b9060db81894de68bf9fba308dec9fe91e6bd Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Thu, 13 Jul 2023 17:10:28 +0000 Subject: [PATCH 27/37] [UPD] README.rst --- fieldservice_stage_validation/README.rst | 10 +++++----- .../static/description/index.html | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fieldservice_stage_validation/README.rst b/fieldservice_stage_validation/README.rst index 7614749349..2c6b688c6b 100644 --- a/fieldservice_stage_validation/README.rst +++ b/fieldservice_stage_validation/README.rst @@ -14,13 +14,13 @@ FSM Stage Validation :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/15.0/fieldservice_stage_validation + :target: https://github.com/OCA/field-service/tree/16.0/fieldservice_stage_validation :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-15-0/field-service-15-0-fieldservice_stage_validation + :target: https://translation.odoo-community.org/projects/field-service-16-0/field-service-16-0-fieldservice_stage_validation :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/15.0 + :target: https://runbot.odoo-community.org/runbot/264/16.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -67,7 +67,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 -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -108,6 +108,6 @@ Current `maintainers `__: |maintainer-brian10048| |maintainer-max3903| -This module is part of the `OCA/field-service `_ project on GitHub. +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_stage_validation/static/description/index.html b/fieldservice_stage_validation/static/description/index.html index ce8b2a9fd9..d4a4768031 100644 --- a/fieldservice_stage_validation/static/description/index.html +++ b/fieldservice_stage_validation/static/description/index.html @@ -367,7 +367,7 @@

FSM Stage Validation

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

+

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

As the stage of a field service document progresses, it may be important for specific fields of the document be completed.

For example, when a field service order enters the ‘Complete’ stage, the @@ -417,7 +417,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 -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -443,7 +443,7 @@

Maintainers

promote its widespread use.

Current maintainers:

brian10048 max3903

-

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

+

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.

From cb632022b748f3b7c4a6dc58dae9b98ad3e6ff7a Mon Sep 17 00:00:00 2001 From: Adriano Prado Date: Fri, 11 Aug 2023 19:01:39 +0000 Subject: [PATCH 28/37] Added translation using Weblate (Portuguese (Brazil)) --- fieldservice_stage_validation/i18n/pt_BR.po | 67 +++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 fieldservice_stage_validation/i18n/pt_BR.po diff --git a/fieldservice_stage_validation/i18n/pt_BR.po b/fieldservice_stage_validation/i18n/pt_BR.po new file mode 100644 index 0000000000..4e55cc4bc9 --- /dev/null +++ b/fieldservice_stage_validation/i18n/pt_BR.po @@ -0,0 +1,67 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_stage_validation +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" + +#. module: fieldservice_stage_validation +#. odoo-python +#: code:addons/fieldservice_stage_validation/models/validate_utils.py:0 +#, python-format +msgid "Cannot move to stage \"%(stage_name)s\" until the \"%(name)s\" field is set." +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_equipment +msgid "Field Service Equipment" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_location +msgid "Field Service Location" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_order +msgid "Field Service Order" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_stage +msgid "Field Service Stage" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model,name:fieldservice_stage_validation.model_fsm_person +msgid "Field Service Worker" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__validate_field_ids +msgid "Fields to Validate" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id +msgid "Model for Stage" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__validate_field_ids +msgid "Select fields which must be set on the document in this stage" +msgstr "" + +#. module: fieldservice_stage_validation +#: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id +msgid "Technical field to hold model type" +msgstr "" From d95767992fe94a9afde3a18d1196d594741fae57 Mon Sep 17 00:00:00 2001 From: Adriano Prado Date: Fri, 11 Aug 2023 21:06:54 +0000 Subject: [PATCH 29/37] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (10 of 10 strings) Translation: field-service-16.0/field-service-16.0-fieldservice_stage_validation Translate-URL: https://translation.odoo-community.org/projects/field-service-16-0/field-service-16-0-fieldservice_stage_validation/pt_BR/ --- fieldservice_stage_validation/i18n/pt_BR.po | 24 ++++++++++++--------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/fieldservice_stage_validation/i18n/pt_BR.po b/fieldservice_stage_validation/i18n/pt_BR.po index 4e55cc4bc9..9809076c3d 100644 --- a/fieldservice_stage_validation/i18n/pt_BR.po +++ b/fieldservice_stage_validation/i18n/pt_BR.po @@ -6,13 +6,15 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2023-08-11 23:13+0000\n" +"Last-Translator: Adriano Prado \n" "Language-Team: none\n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.17\n" #. module: fieldservice_stage_validation #. odoo-python @@ -20,48 +22,50 @@ msgstr "" #, python-format msgid "Cannot move to stage \"%(stage_name)s\" until the \"%(name)s\" field is set." msgstr "" +"Não é possível mover para o estágio \"%(stage_name)s\" até que o campo \"" +"%(name)s\" seja definido." #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_equipment msgid "Field Service Equipment" -msgstr "" +msgstr "Equipamento de Serviço de Campo" #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_location msgid "Field Service Location" -msgstr "" +msgstr "Localização do Serviço de Campo" #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_order msgid "Field Service Order" -msgstr "" +msgstr "Ordem de Serviço de Campo" #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_stage msgid "Field Service Stage" -msgstr "" +msgstr "Estágio de Serviço de Campo" #. module: fieldservice_stage_validation #: model:ir.model,name:fieldservice_stage_validation.model_fsm_person msgid "Field Service Worker" -msgstr "" +msgstr "Trabalhador do Serviço de Campo" #. module: fieldservice_stage_validation #: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__validate_field_ids msgid "Fields to Validate" -msgstr "" +msgstr "Campos para Validar" #. module: fieldservice_stage_validation #: model:ir.model.fields,field_description:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id msgid "Model for Stage" -msgstr "" +msgstr "Modelo par Estagio" #. module: fieldservice_stage_validation #: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__validate_field_ids msgid "Select fields which must be set on the document in this stage" -msgstr "" +msgstr "Selecione os campos que devem ser definidos no documento nesta etapa" #. module: fieldservice_stage_validation #: model:ir.model.fields,help:fieldservice_stage_validation.field_fsm_stage__stage_type_model_id msgid "Technical field to hold model type" -msgstr "" +msgstr "Campo técnico para manter o tipo de modelo" From 7b6d36d19d67e6e355561d1bfbdaf7f4e7c06483 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sun, 3 Sep 2023 12:55:58 +0000 Subject: [PATCH 30/37] [UPD] README.rst --- fieldservice_stage_validation/README.rst | 15 +++--- .../static/description/index.html | 48 ++++++++++--------- 2 files changed, 34 insertions(+), 29 deletions(-) diff --git a/fieldservice_stage_validation/README.rst b/fieldservice_stage_validation/README.rst index 2c6b688c6b..2d410d942e 100644 --- a/fieldservice_stage_validation/README.rst +++ b/fieldservice_stage_validation/README.rst @@ -2,10 +2,13 @@ FSM Stage Validation ==================== -.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:9b151ff66d87078952dbeea942b63732c5f353f6b4a6177b5121eceee261f2a0 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status @@ -19,11 +22,11 @@ FSM Stage Validation .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png :target: https://translation.odoo-community.org/projects/field-service-16-0/field-service-16-0-fieldservice_stage_validation :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/16.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=16.0 + :alt: Try me on Runboat -|badge1| |badge2| |badge3| |badge4| |badge5| +|badge1| |badge2| |badge3| |badge4| |badge5| As the stage of a field service document progresses, it may be important for specific fields of the document be completed. @@ -66,7 +69,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/fieldservice_stage_validation/static/description/index.html b/fieldservice_stage_validation/static/description/index.html index d4a4768031..17bda60fb8 100644 --- a/fieldservice_stage_validation/static/description/index.html +++ b/fieldservice_stage_validation/static/description/index.html @@ -1,20 +1,20 @@ - + - + FSM Stage Validation