diff --git a/mgmtsystem_nonconformity/README.rst b/mgmtsystem_nonconformity/README.rst index 6a8bca949aae..16b7b2b46b87 100644 --- a/mgmtsystem_nonconformity/README.rst +++ b/mgmtsystem_nonconformity/README.rst @@ -17,13 +17,13 @@ Management System - Nonconformity :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmanagement--system-lightgray.png?logo=github - :target: https://github.com/OCA/management-system/tree/17.0/mgmtsystem_nonconformity + :target: https://github.com/OCA/management-system/tree/18.0/mgmtsystem_nonconformity :alt: OCA/management-system .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/management-system-17-0/management-system-17-0-mgmtsystem_nonconformity + :target: https://translation.odoo-community.org/projects/management-system-18-0/management-system-18-0-mgmtsystem_nonconformity :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/management-system&target_branch=17.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/management-system&target_branch=18.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -31,11 +31,11 @@ Management System - Nonconformity This module enables you to manage the nonconformities of your management systems: -- Quality (ISO 9001) -- Environment (ISO 14001) -- Information Security (ISO 27001) -- Health and Safety (ISO 45001) -- IT Services (ISO 20000) +- Quality (ISO 9001) +- Environment (ISO 14001) +- Information Security (ISO 27001) +- Health and Safety (ISO 45001) +- IT Services (ISO 20000) **Table of contents** @@ -47,40 +47,37 @@ Configuration Users must be added to the appropriate groups within Odoo as follows: -- Creators: Settings > Users > Groups > Management System / User - -To configure email notifications for certain stages go to: - -- Management System > Configuration > Nonconformities > Stages -- Click on any stage and click the edit button. -- Click on the dropdown icon in the field Email Template, select your - template and click Save. +- Creators: Settings > Users > Groups > Management System / User Usage ===== To use this module: -- Go to Management System > Nonconformities -- Click on Create to enter the following information: -- Partner : Customer, supplier or internal personnel -- Related to: Any reference pointing to the NC (order id, project id, - task id, etc.) -- Responsible: Person responsible for the NC -- Manager : Person managing the department or owner of the procedure -- Filled in by: Originator of NC report -- Origins: The source of the NC, how was it discover -- Procedures: Against which procedure is the NC -- Description: Evidence, reference to the standards -- Click on Save and then on Analysis. - -Go to the newly created NC and fill in the following information in the -tab named Causes and Analysis: - -- Causes: Add root causes -- Analysis: Describe the results of the investigation -- Severity: Select the severity among unfounded, minor and major -- Immediate action: Create or select an immediate action if appropriate +- Go to Management System > Nonconformities +- Click on Create to enter the following information: +- Partner : Customer, supplier or internal personnel +- Related to: Any reference pointing to the NC (order id, project id, + task id, etc.) +- Responsible: Person responsible for the NC +- Manager : Person managing the department or owner of the procedure +- Filled in by: Originator of NC report +- Origins: The source of the NC, how was it discover +- Procedures: Against which procedure is the NC +- Description: Evidence, reference to the standards +- Click on Save and then set state from Draft to Analysis. + +Go to the newly created NC and fill in the following information: + +In the Causes and Analysis tab: + +- Causes: Add root causes +- Analysis: Describe the results of the investigation +- Severity: Select the severity among unfounded, minor and major + +In the Description tab: + +- Immediate action: Create or select an immediate action if appropriate Click on the Save button and then on the "Action Plan" button in the top right corner. @@ -88,13 +85,13 @@ right corner. In the Actions tab, select or create new actions by entering the following items: -- Subject: What must be done - Return to Supplier, Use As Is, Scrap, - Rework, Re-grade, Repair -- Deadline: Date by which the action must be completed -- Responsible: Person in charge for implementing the action -- Type: Immediate, corrective or preventive actions or improvement - opportunity -- Description: Details of the action +- Subject: What must be done - Return to Supplier, Use As Is, Scrap, + Rework, Re-grade, Repair +- Deadline: Date by which the action must be completed +- Responsible: Person in charge for implementing the action +- Response Type: Immediate, corrective or preventive actions or + improvement opportunity +- Description: Details of the action When the action is created, a notification is sent to the person responsible for the action. @@ -111,10 +108,10 @@ evaluated before closing the NC. Known issues / Roadmap ====================== -- The custom emails should be replaced by Mail Tracking features and - Subtypes (like in Project Tasks and Project Issues) -- Automatically add responsible_user_id._uid, manager_user_id._uid, - author_user_id._uid to chatter +- The custom emails should be replaced by Mail Tracking features and + Subtypes (like in Project Tasks and Project Issues) +- Automatically add responsible_user_id._uid, manager_user_id._uid, + author_user_id._uid to chatter Bug Tracker =========== @@ -122,7 +119,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 to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -137,27 +134,28 @@ Authors Contributors ------------ -- Daniel Reis -- Glen Dromgoole -- Loic Lacroix -- Sandy Carter -- Gervais Naoussi -- Eugen Don -- Jose Maria Alzaga -- `Tecnativa `__: +- Daniel Reis +- Glen Dromgoole +- Loic Lacroix +- Sandy Carter +- Gervais Naoussi +- Eugen Don +- Jose Maria Alzaga +- `Tecnativa `__: - - Ernesto Tejeda + - Ernesto Tejeda Trobz -- Dung Tran +- Dung Tran +- Tuan Nguyen Other credits ------------- The development of this module has been financially supported by: -- Camptocamp +- Camptocamp Maintainers ----------- @@ -172,6 +170,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/management-system `_ project on GitHub. +This module is part of the `OCA/management-system `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/mgmtsystem_nonconformity/__manifest__.py b/mgmtsystem_nonconformity/__manifest__.py index e0018dc9623f..ca1504ef7dff 100644 --- a/mgmtsystem_nonconformity/__manifest__.py +++ b/mgmtsystem_nonconformity/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Management System - Nonconformity", - "version": "17.0.1.0.0", + "version": "18.0.1.0.0", "author": "Savoir-faire Linux, Odoo Community Association (OCA)", "website": "https://github.com/OCA/management-system", "license": "AGPL-3", diff --git a/mgmtsystem_nonconformity/models/__init__.py b/mgmtsystem_nonconformity/models/__init__.py index ff661014e8e6..b4f4eefbac3e 100644 --- a/mgmtsystem_nonconformity/models/__init__.py +++ b/mgmtsystem_nonconformity/models/__init__.py @@ -8,4 +8,4 @@ from . import mgmtsystem_nonconformity_severity from . import mgmtsystem_nonconformity from . import mgmtsystem_action -from . import mgmtsystem_nonconformity_abstract +from . import mail_thread diff --git a/mgmtsystem_nonconformity/models/mgmtsystem_nonconformity_abstract.py b/mgmtsystem_nonconformity/models/mail_thread.py similarity index 89% rename from mgmtsystem_nonconformity/models/mgmtsystem_nonconformity_abstract.py rename to mgmtsystem_nonconformity/models/mail_thread.py index 942815f68f39..f7373975e81b 100644 --- a/mgmtsystem_nonconformity/models/mgmtsystem_nonconformity_abstract.py +++ b/mgmtsystem_nonconformity/models/mail_thread.py @@ -7,10 +7,8 @@ from odoo.tools.misc import frozendict -class MgmtsystemNonconformityAbstract(models.AbstractModel): - # TODO: Remove this on 17.0 and move everything on mail.thread - _name = "mgmtsystem.nonconformity.abstract" - _description = "Nonconformity Abstract" +class MailThread(models.AbstractModel): + _inherit = "mail.thread" non_conformity_ids = fields.One2many( "mgmtsystem.nonconformity", @@ -41,11 +39,6 @@ def action_view_non_conformities(self): action["context"] = self._get_non_conformities_context() return action - -class MailThread(models.AbstractModel): - _name = "mail.thread" - _inherit = ["mail.thread", "mgmtsystem.nonconformity.abstract"] - @api.model def get_view(self, view_id=None, view_type="form", **options): res = super().get_view(view_id=view_id, view_type=view_type, **options) @@ -59,7 +52,7 @@ def get_view(self, view_id=None, view_type="form", **options): # We need to copy, because it is a frozen dict all_models = res["models"].copy() - for node in doc.xpath("/form/div[hasclass('oe_chatter')]"): + for node in doc.xpath("/form/chatter"): # _add_tier_validation_label process new_node = etree.fromstring( "" @@ -83,6 +76,7 @@ def _get_view_fields(self, view_type, models): trees inside a form """ result = super()._get_view_fields(view_type, models) + if view_type == "form" and self.env.user.has_group( "mgmtsystem.group_mgmtsystem_viewer" ): diff --git a/mgmtsystem_nonconformity/models/mgmtsystem_action.py b/mgmtsystem_nonconformity/models/mgmtsystem_action.py index 8c8856673d23..4c71d4bfaac5 100644 --- a/mgmtsystem_nonconformity/models/mgmtsystem_action.py +++ b/mgmtsystem_nonconformity/models/mgmtsystem_action.py @@ -8,7 +8,7 @@ class MgmtsystemAction(models.Model): _inherit = "mgmtsystem.action" nonconformity_immediate_id = fields.One2many( - "mgmtsystem.nonconformity", "immediate_action_id", readonly=True + "mgmtsystem.nonconformity", "immediate_action_id" ) nonconformity_ids = fields.Many2many( "mgmtsystem.nonconformity", @@ -16,5 +16,4 @@ class MgmtsystemAction(models.Model): "action_id", "nonconformity_id", "Nonconformities", - readonly=True, ) diff --git a/mgmtsystem_nonconformity/models/mgmtsystem_nonconformity.py b/mgmtsystem_nonconformity/models/mgmtsystem_nonconformity.py index 2de5a8c8c726..d8b78b651ad4 100644 --- a/mgmtsystem_nonconformity/models/mgmtsystem_nonconformity.py +++ b/mgmtsystem_nonconformity/models/mgmtsystem_nonconformity.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import _, api, fields, models +from odoo import api, fields, models class MgmtsystemNonconformity(models.Model): @@ -19,27 +19,24 @@ def _default_stage(self): ].search([("is_starting", "=", True)], limit=1) @api.model - def _stage_groups(self, stages, domain, order): + def _stage_groups(self, stages, domain): stage_ids = self.env["mgmtsystem.nonconformity.stage"].search([]) return stage_ids # 1. Description name = fields.Char() - ref = fields.Char("Reference", required=True, readonly=True, default="NEW") + ref = fields.Char("Reference", required=True, default="NEW") # Compute data - number_of_nonconformities = fields.Integer( - "# of nonconformities", readonly=True, default=1 - ) + number_of_nonconformities = fields.Integer("# of nonconformities", default=1) days_since_updated = fields.Integer( - readonly=True, compute="_compute_days_since_updated", store=True + compute="_compute_days_since_updated", store=True ) number_of_days_to_close = fields.Integer( "# of days to close", compute="_compute_number_of_days_to_close", store=True, - readonly=True, ) - closing_date = fields.Datetime(readonly=True) + closing_date = fields.Datetime() partner_id = fields.Many2one("res.partner", "Partner", required=True) reference = fields.Char( @@ -163,7 +160,7 @@ def _check_open_with_action_comments(self): for nc in self: if nc.state == "open" and not nc.action_comments: raise models.ValidationError( - _( + self.env._( "Action plan comments are required " "in order to put a nonconformity In Progress." ) @@ -175,7 +172,7 @@ def _check_close_with_evaluation(self): if nc.state == "done": if not nc.evaluation_comments: raise models.ValidationError( - _( + self.env._( "Evaluation Comments are required " "in order to close a Nonconformity." ) @@ -183,7 +180,10 @@ def _check_close_with_evaluation(self): actions_are_closed = nc._get_all_actions().mapped("stage_id.is_ending") if not all(actions_are_closed): raise models.ValidationError( - _("All actions must be done " "before closing a Nonconformity.") + self.env._( + "All actions must be done " + "before closing a Nonconformity." + ) ) @api.model diff --git a/mgmtsystem_nonconformity/models/mgmtsystem_nonconformity_cause.py b/mgmtsystem_nonconformity/models/mgmtsystem_nonconformity_cause.py index b4aa922cc56a..9a51c363039b 100644 --- a/mgmtsystem_nonconformity/models/mgmtsystem_nonconformity_cause.py +++ b/mgmtsystem_nonconformity/models/mgmtsystem_nonconformity_cause.py @@ -15,7 +15,7 @@ class MgmtsystemNonconformityCause(models.Model): name = fields.Char("Cause", required=True, translate=True) description = fields.Text() sequence = fields.Integer(help="Defines the order to present items") - parent_path = fields.Char(index=True, unaccent=False) + parent_path = fields.Char(index=True) parent_id = fields.Many2one( "mgmtsystem.nonconformity.cause", "Group", ondelete="restrict" ) diff --git a/mgmtsystem_nonconformity/models/mgmtsystem_nonconformity_origin.py b/mgmtsystem_nonconformity/models/mgmtsystem_nonconformity_origin.py index 97ef27ef32ca..653069e28a44 100644 --- a/mgmtsystem_nonconformity/models/mgmtsystem_nonconformity_origin.py +++ b/mgmtsystem_nonconformity/models/mgmtsystem_nonconformity_origin.py @@ -13,7 +13,7 @@ class MgmtsystemNonconformityOrigin(models.Model): name = fields.Char("Origin", required=True, translate=True) description = fields.Text() sequence = fields.Integer(help="Defines the order to present items") - parent_path = fields.Char(index=True, unaccent=False) + parent_path = fields.Char(index=True) parent_id = fields.Many2one( "mgmtsystem.nonconformity.origin", "Group", ondelete="restrict" ) diff --git a/mgmtsystem_nonconformity/models/mgmtsystem_nonconformity_stage.py b/mgmtsystem_nonconformity/models/mgmtsystem_nonconformity_stage.py index 44b2748d60b7..c3cc81f4406d 100644 --- a/mgmtsystem_nonconformity/models/mgmtsystem_nonconformity_stage.py +++ b/mgmtsystem_nonconformity/models/mgmtsystem_nonconformity_stage.py @@ -1,16 +1,7 @@ # Copyright (C) 2010 Savoir-faire Linux (). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import _, fields, models - -_STATES = [ - ("draft", _("Draft")), - ("analysis", _("Analysis")), - ("pending", _("Action Plan")), - ("open", _("In Progress")), - ("done", _("Closed")), - ("cancel", _("Cancelled")), -] +from odoo import fields, models class MgmtsystemNonconformityStage(models.Model): @@ -20,11 +11,21 @@ class MgmtsystemNonconformityStage(models.Model): _description = "Nonconformity Stages" _order = "sequence" + def _get_states(self): + return [ + ("draft", self.env._("Draft")), + ("analysis", self.env._("Analysis")), + ("pending", self.env._("Action Plan")), + ("open", self.env._("In Progress")), + ("done", self.env._("Closed")), + ("cancel", self.env._("Cancelled")), + ] + name = fields.Char("Stage Name", required=True, translate=True) sequence = fields.Integer( help="Used to order states. Lower is better.", default=100 ) - state = fields.Selection(_STATES, default="draft") + state = fields.Selection(selection=_get_states, default="draft") is_starting = fields.Boolean( string="Is starting Stage", help="select stis checkbox if this is the default stage \n" diff --git a/mgmtsystem_nonconformity/readme/CONFIGURE.md b/mgmtsystem_nonconformity/readme/CONFIGURE.md index b5b562064e8d..63435775c6ca 100644 --- a/mgmtsystem_nonconformity/readme/CONFIGURE.md +++ b/mgmtsystem_nonconformity/readme/CONFIGURE.md @@ -1,10 +1,3 @@ Users must be added to the appropriate groups within Odoo as follows: -- Creators: Settings \> Users \> Groups \> Management System / User - -To configure email notifications for certain stages go to: - -- Management System \> Configuration \> Nonconformities \> Stages -- Click on any stage and click the edit button. -- Click on the dropdown icon in the field Email Template, select your - template and click Save. +- Creators: Settings \> Users \> Groups \> Management System / User \ No newline at end of file diff --git a/mgmtsystem_nonconformity/readme/CONTRIBUTORS.md b/mgmtsystem_nonconformity/readme/CONTRIBUTORS.md index fc13aecd791c..6b1b4a30eb71 100644 --- a/mgmtsystem_nonconformity/readme/CONTRIBUTORS.md +++ b/mgmtsystem_nonconformity/readme/CONTRIBUTORS.md @@ -11,3 +11,4 @@ Trobz - Dung Tran \<\> +- Tuan Nguyen \<\> \ No newline at end of file diff --git a/mgmtsystem_nonconformity/readme/USAGE.md b/mgmtsystem_nonconformity/readme/USAGE.md index 42c64a0efd8f..7dc6c48f5fa1 100644 --- a/mgmtsystem_nonconformity/readme/USAGE.md +++ b/mgmtsystem_nonconformity/readme/USAGE.md @@ -11,14 +11,16 @@ To use this module: - Origins: The source of the NC, how was it discover - Procedures: Against which procedure is the NC - Description: Evidence, reference to the standards -- Click on Save and then on Analysis. +- Click on Save and then set state from Draft to Analysis. -Go to the newly created NC and fill in the following information in the -tab named Causes and Analysis: +Go to the newly created NC and fill in the following information: +In the Causes and Analysis tab: - Causes: Add root causes - Analysis: Describe the results of the investigation - Severity: Select the severity among unfounded, minor and major + +In the Description tab: - Immediate action: Create or select an immediate action if appropriate Click on the Save button and then on the "Action Plan" button in the top @@ -31,7 +33,7 @@ following items: Rework, Re-grade, Repair - Deadline: Date by which the action must be completed - Responsible: Person in charge for implementing the action -- Type: Immediate, corrective or preventive actions or improvement +- Response Type: Immediate, corrective or preventive actions or improvement opportunity - Description: Details of the action diff --git a/mgmtsystem_nonconformity/static/description/icon.png b/mgmtsystem_nonconformity/static/description/icon.png index cb1620bf203f..9e53b1e966a7 100644 Binary files a/mgmtsystem_nonconformity/static/description/icon.png and b/mgmtsystem_nonconformity/static/description/icon.png differ diff --git a/mgmtsystem_nonconformity/static/description/index.html b/mgmtsystem_nonconformity/static/description/index.html index bfef913c4153..d8f537ded628 100644 --- a/mgmtsystem_nonconformity/static/description/index.html +++ b/mgmtsystem_nonconformity/static/description/index.html @@ -369,7 +369,7 @@

Management System - Nonconformity

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:5faf87fb11e2609147fb49b4fcf9920bd836083dcefba27f374144b36347371c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/management-system Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/management-system Translate me on Weblate Try me on Runboat

This module enables you to manage the nonconformities of your management systems:

    @@ -401,13 +401,6 @@

    Configuration

    • Creators: Settings > Users > Groups > Management System / User
    -

    To configure email notifications for certain stages go to:

    -
      -
    • Management System > Configuration > Nonconformities > Stages
    • -
    • Click on any stage and click the edit button.
    • -
    • Click on the dropdown icon in the field Email Template, select your -template and click Save.
    • -

    Usage

    @@ -424,14 +417,17 @@

    Usage

  • Origins: The source of the NC, how was it discover
  • Procedures: Against which procedure is the NC
  • Description: Evidence, reference to the standards
  • -
  • Click on Save and then on Analysis.
  • +
  • Click on Save and then set state from Draft to Analysis.
-

Go to the newly created NC and fill in the following information in the -tab named Causes and Analysis:

+

Go to the newly created NC and fill in the following information:

+

In the Causes and Analysis tab:

  • Causes: Add root causes
  • Analysis: Describe the results of the investigation
  • Severity: Select the severity among unfounded, minor and major
  • +
+

In the Description tab:

+
  • Immediate action: Create or select an immediate action if appropriate

Click on the Save button and then on the “Action Plan” button in the top @@ -443,8 +439,8 @@

Usage

Rework, Re-grade, Repair
  • Deadline: Date by which the action must be completed
  • Responsible: Person in charge for implementing the action
  • -
  • Type: Immediate, corrective or preventive actions or improvement -opportunity
  • +
  • Response Type: Immediate, corrective or preventive actions or +improvement opportunity
  • Description: Details of the action
  • When the action is created, a notification is sent to the person @@ -470,7 +466,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 to smash it by providing a detailed and welcomed -feedback.

    +feedback.

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

    @@ -499,6 +495,7 @@

    Contributors

    Trobz

    @@ -517,7 +514,7 @@

    Maintainers

    OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

    -

    This module is part of the OCA/management-system project on GitHub.

    +

    This module is part of the OCA/management-system project on GitHub.

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

    diff --git a/mgmtsystem_nonconformity/views/mgmtsystem_cause.xml b/mgmtsystem_nonconformity/views/mgmtsystem_cause.xml index 6273811ffafd..7cf7dffa7940 100644 --- a/mgmtsystem_nonconformity/views/mgmtsystem_cause.xml +++ b/mgmtsystem_nonconformity/views/mgmtsystem_cause.xml @@ -19,16 +19,16 @@ - mgmtsystem.nonconformity.cause.tree + mgmtsystem.nonconformity.cause.list mgmtsystem.nonconformity.cause - tree + list - + - + diff --git a/mgmtsystem_nonconformity/views/mgmtsystem_nonconformity.xml b/mgmtsystem_nonconformity/views/mgmtsystem_nonconformity.xml index f1d2f30716e6..d1ce008d177c 100644 --- a/mgmtsystem_nonconformity/views/mgmtsystem_nonconformity.xml +++ b/mgmtsystem_nonconformity/views/mgmtsystem_nonconformity.xml @@ -8,11 +8,11 @@ /> - mgmtsystem.nonconformity.tree + mgmtsystem.nonconformity.list mgmtsystem.nonconformity - - + + @@ -22,7 +22,7 @@ - + @@ -132,70 +132,30 @@ - -
    -