Initial commit: OCA Technical packages (595 packages)

This commit is contained in:
Ernad Husremovic 2025-08-29 15:43:03 +02:00
commit 2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions

View file

@ -0,0 +1,174 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association
=================================
Management System - Nonconformity
=================================
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:b33df588c218de47c43bf07cfb5b460049b6a94cf2fd188542bbe7cad135d1bd
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/license-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%2Fmanagement--system-lightgray.png?logo=github
:target: https://github.com/OCA/management-system/tree/16.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-16-0/management-system-16-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=16.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
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)
**Table of contents**
.. contents::
:local:
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.
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
Click on the Save button and then on the "Action Plan" button in the top 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
When the action is created, a notification is sent to the person responsible
for the action.
Enter comments into the input field below the "Plan Review" section, those comments are required to reach the next stage.
To begin the work on the planned Actions change the stage of the NC to open by clicking on the "In Progress" button in the top right corner.
When all actions of the plan are done, their effectiveness must be 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
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/management-system/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 <https://github.com/OCA/management-system/issues/new?body=module:%20mgmtsystem_nonconformity%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
~~~~~~~
* Savoir-faire Linux
Contributors
~~~~~~~~~~~~
* Daniel Reis <dreis.pt@hotmail.com>
* Glen Dromgoole <gdromgoole@tier1engineering.com>
* Loic Lacroix <loic.lacroix@savoirfairelinux.com>
* Sandy Carter <sandy.carter@savoirfairelinux.com>
* Gervais Naoussi <gervaisnaoussi@gmail.com>
* Eugen Don <eugen.don@don-systems.de>
* Jose Maria Alzaga <jose.alzaga@aselcis.com>
* `Tecnativa <https://www.tecnativa.com>`_:
* Ernesto Tejeda
Trobz
* Dung Tran <dungtd@trobz.com>
Other credits
~~~~~~~~~~~~~
The development of this module has been financially supported by:
* Camptocamp
Maintainers
~~~~~~~~~~~
This module is maintained by the OCA.
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
This module is part of the `OCA/management-system <https://github.com/OCA/management-system/tree/16.0/mgmtsystem_nonconformity>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View file

@ -0,0 +1,6 @@
# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import models
from . import reports

View file

@ -0,0 +1,40 @@
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Management System - Nonconformity",
"version": "16.0.1.3.1",
"author": "Savoir-faire Linux, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/management-system",
"license": "AGPL-3",
"category": "Management System",
"depends": ["mgmtsystem_action", "document_page_procedure"],
"data": [
"security/ir.model.access.csv",
"security/mgmtsystem_nonconformity_security.xml",
"views/mgmtsystem_nonconformity.xml",
"views/mgmtsystem_origin.xml",
"views/mgmtsystem_cause.xml",
"views/mgmtsystem_severity.xml",
"views/mgmtsystem_action.xml",
"views/mgmtsystem_nonconformity_stage.xml",
"data/sequence.xml",
"data/mgmtsystem_nonconformity_severity.xml",
"data/mgmtsystem_nonconformity_origin.xml",
"data/mgmtsystem_nonconformity_cause.xml",
"data/mgmtsystem_nonconformity_stage.xml",
"data/mail_message_subtype.xml",
"reports/mgmtsystem_nonconformity_report.xml",
],
"demo": [
"demo/mgmtsystem_nonconformity_origin.xml",
"demo/mgmtsystem_nonconformity_cause.xml",
"demo/mgmtsystem_nonconformity.xml",
],
"assets": {
"web.assets_backend": [
"mgmtsystem_nonconformity/static/src/**/*.xml",
"mgmtsystem_nonconformity/static/src/**/*.js",
],
},
"installable": True,
}

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<!-- Not used at the moment. To use them override the _track_subtype method -->
<record id="subtype_analysis" model="mail.message.subtype">
<field name="name">Analysis</field>
<field name="res_model">mgmtsystem.nonconformity</field>
<field name="default" eval="False" />
<field name="description">Analysis</field>
</record>
<record id="subtype_pending" model="mail.message.subtype">
<field name="name">Pending Approval</field>
<field name="res_model">mgmtsystem.nonconformity</field>
<field name="default" eval="False" />
<field name="description">Pending Approval</field>
</record>
</odoo>

View file

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="badly_defined_need" model="mgmtsystem.nonconformity.cause">
<field name="name">Badly defined need</field>
</record>
<record id="work_conditions" model="mgmtsystem.nonconformity.cause">
<field name="name">Work conditions</field>
</record>
<record id="information_not_available" model="mgmtsystem.nonconformity.cause">
<field name="name">Information not available</field>
</record>
<record id="bad_communication" model="mgmtsystem.nonconformity.cause">
<field name="name">Bad communication</field>
</record>
<record id="bad_partner_relation" model="mgmtsystem.nonconformity.cause">
<field name="name">Bad customer/supplier relation</field>
</record>
<record id="hr_unavailable_inadequate" model="mgmtsystem.nonconformity.cause">
<field name="name">Human resource not available or inadequate</field>
</record>
<record id="instruction_not_respected" model="mgmtsystem.nonconformity.cause">
<field name="name">Instruction not respected</field>
</record>
<record id="procedure_not_respected" model="mgmtsystem.nonconformity.cause">
<field name="name">Procedure not respected</field>
</record>
<record id="technical_failure" model="mgmtsystem.nonconformity.cause">
<field name="name">Technical failure</field>
</record>
<record id="procedure_not_defined" model="mgmtsystem.nonconformity.cause">
<field name="name">Procedure not defined</field>
</record>
</odoo>

View file

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="nc_origin_qc" model="mgmtsystem.nonconformity.origin">
<field name="name">Quality Committee</field>
</record>
<record id="nc_origin_dr" model="mgmtsystem.nonconformity.origin">
<field name="name">Direction Review</field>
</record>
<record id="nc_origin_internal_client" model="mgmtsystem.nonconformity.origin">
<field name="name">Internal client complaint</field>
</record>
<record id="nc_origin_external_client" model="mgmtsystem.nonconformity.origin">
<field name="name">External client complaint</field>
</record>
<record id="nc_origin_process" model="mgmtsystem.nonconformity.origin">
<field name="name">Process Execution</field>
</record>
<record id="nc_origin_internal_audit" model="mgmtsystem.nonconformity.origin">
<field name="name">Internal Audit</field>
</record>
<record id="nc_origin_extenal_audit" model="mgmtsystem.nonconformity.origin">
<field name="name">External Audit</field>
</record>
</odoo>

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="nonconformity_severity_maj" model="mgmtsystem.nonconformity.severity">
<field name="name">Major</field>
<field name="active" eval="True" />
</record>
<record id="nonconformity_severity_min" model="mgmtsystem.nonconformity.severity">
<field name="name">Minor</field>
<field name="active" eval="True" />
</record>
<record id="nonconformity_severity_no" model="mgmtsystem.nonconformity.severity">
<field name="name">Unfounded</field>
<field name="active" eval="True" />
</record>
</odoo>

View file

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="stage_draft" model="mgmtsystem.nonconformity.stage">
<field name="name">Draft</field>
<field name="sequence">0</field>
<field name="state">draft</field>
</record>
<record id="stage_analysis" model="mgmtsystem.nonconformity.stage">
<field name="name">Analysis</field>
<field name="sequence">50</field>
<field name="state">analysis</field>
</record>
<record id="stage_pending" model="mgmtsystem.nonconformity.stage">
<field name="name">Action Plan</field>
<field name="sequence">100</field>
<field name="state">pending</field>
</record>
<record id="stage_open" model="mgmtsystem.nonconformity.stage">
<field name="name">In Progress</field>
<field name="sequence">150</field>
<field name="state">open</field>
</record>
<record id="stage_done" model="mgmtsystem.nonconformity.stage">
<field name="name">Closed</field>
<field name="sequence">200</field>
<field name="state">done</field>
</record>
<record id="stage_cancel" model="mgmtsystem.nonconformity.stage">
<field name="name">Cancelled</field>
<field name="sequence">250</field>
<field name="state">cancel</field>
</record>
</odoo>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="seq_mgmtsystem_nonconformity" model="ir.sequence">
<field name="name">Management System Nonconformity</field>
<field name="code">mgmtsystem.nonconformity</field>
<field name="padding">3</field>
<field name="company_id" eval="False" />
</record>
</odoo>

View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="demo_nonconformity" model="mgmtsystem.nonconformity">
<field name="partner_id" ref="base.res_partner_3" />
<field name="create_date">2010-12-03</field>
<field name="name">Demo Nonconformity</field>
<field name="responsible_user_id" ref="base.user_demo" />
<field name="manager_user_id" ref="base.user_root" />
<field name="user_id" ref="base.user_demo" />
<field
name="description"
>The procedure has changed with no comments on the revision.</field>
<field
name="analysis"
>Administrator didn't know he had to add a comment when changing the procedure.</field>
<field name="origin_ids" eval="[(6,0,[ref('demo_origin')])]" />
<field
name="procedure_ids"
eval="[(6,0,[ref('document_page_procedure.document_page_procedure')])]"
/>
<field name="cause_ids" eval="[(6,0,[ref('demo_cause')])]" />
<field name="immediate_action_id" ref="mgmtsystem_action.demo_immediate" />
<field
name="action_ids"
eval="[(6, 0, [ref('mgmtsystem_action.demo_immediate'), ref('mgmtsystem_action.demo_corrective'), ref('mgmtsystem_action.demo_preventive')])]"
/>
</record>
</odoo>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="demo_cause" model="mgmtsystem.nonconformity.cause">
<field name="name">Lack of expertise</field>
<field
name="description"
>The cause of the nonconformity is a lack of expertise of the person.</field>
</record>
</odoo>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="demo_origin" model="mgmtsystem.nonconformity.origin">
<field name="name">Internal Audit</field>
<field
name="description"
>The nonconformity was discovered during an internal audit.</field>
</record>
</odoo>

View file

@ -0,0 +1,14 @@
# Copyright 2023 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
def migrate(cr, version):
"""Set nonconformity stages from module data as noupdate."""
cr.execute(
"""
UPDATE ir_model_data
SET noupdate = TRUE
WHERE module = 'mgmtsystem_nonconformity'
AND model = 'mgmtsystem.nonconformity.stage';
"""
)

View file

@ -0,0 +1,11 @@
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import mgmtsystem_nonconformity_stage
from . import mgmtsystem_nonconformity_cause
from . import mgmtsystem_nonconformity_origin
from . import mgmtsystem_nonconformity_severity
from . import mgmtsystem_nonconformity
from . import mgmtsystem_action
from . import mgmtsystem_nonconformity_abstract

View file

@ -0,0 +1,20 @@
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class MgmtsystemAction(models.Model):
_inherit = "mgmtsystem.action"
nonconformity_immediate_id = fields.One2many(
"mgmtsystem.nonconformity", "immediate_action_id", readonly=True
)
nonconformity_ids = fields.Many2many(
"mgmtsystem.nonconformity",
"mgmtsystem_nonconformity_action_rel",
"action_id",
"nonconformity_id",
"Nonconformities",
readonly=True,
)

View file

@ -0,0 +1,243 @@
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import _, api, fields, models
class MgmtsystemNonconformity(models.Model):
_name = "mgmtsystem.nonconformity"
_description = "Nonconformity"
_inherit = ["mail.thread", "mail.activity.mixin"]
_order = "create_date desc"
@api.model
def _default_stage(self):
"""Return the default stage."""
return self.env.ref("mgmtsystem_nonconformity.stage_draft", False) or self.env[
"mgmtsystem.nonconformity.stage"
].search([("is_starting", "=", True)], limit=1)
@api.model
def _stage_groups(self, stages, domain, order):
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")
# Compute data
number_of_nonconformities = fields.Integer(
"# of nonconformities", readonly=True, default=1
)
days_since_updated = fields.Integer(
readonly=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)
partner_id = fields.Many2one("res.partner", "Partner", required=True)
reference = fields.Char(
"Related to", default=lambda self: self._default_reference()
)
responsible_user_id = fields.Many2one(
"res.users", "Responsible", required=True, tracking=True
)
manager_user_id = fields.Many2one(
"res.users", "Manager", required=True, tracking=True
)
user_id = fields.Many2one(
"res.users",
"Filled in by",
required=True,
default=lambda self: self.env.user,
tracking=True,
)
origin_ids = fields.Many2many(
"mgmtsystem.nonconformity.origin",
"mgmtsystem_nonconformity_origin_rel",
"nonconformity_id",
"origin_id",
"Origin",
required=True,
)
procedure_ids = fields.Many2many(
"document.page",
"mgmtsystem_nonconformity_procedure_rel",
"nonconformity_id",
"procedure_id",
"Procedure",
)
description = fields.Text(required=True)
system_id = fields.Many2one("mgmtsystem.system", "System")
stage_id = fields.Many2one(
"mgmtsystem.nonconformity.stage",
"Stage",
tracking=True,
copy=False,
default=_default_stage,
group_expand="_stage_groups",
)
state = fields.Selection(related="stage_id.state", store=True)
kanban_state = fields.Selection(
[
("normal", "In Progress"),
("done", "Ready for next stage"),
("blocked", "Blocked"),
],
default="normal",
tracking=True,
help="A kanban state indicates special situations affecting it:\n"
" * Normal is the default situation\n"
" * Blocked indicates something is preventing"
" the progress of this task\n"
" * Ready for next stage indicates the"
" task is ready to be pulled to the next stage",
required=True,
copy=False,
)
# 2. Root Cause Analysis
cause_ids = fields.Many2many(
"mgmtsystem.nonconformity.cause",
"mgmtsystem_nonconformity_cause_rel",
"nonconformity_id",
"cause_id",
"Cause",
)
severity_id = fields.Many2one("mgmtsystem.nonconformity.severity", "Severity")
analysis = fields.Text()
immediate_action_id = fields.Many2one(
"mgmtsystem.action",
domain="[('nonconformity_ids', '=', id)]",
)
# 3. Action Plan
action_ids = fields.Many2many(
"mgmtsystem.action",
"mgmtsystem_nonconformity_action_rel",
"nonconformity_id",
"action_id",
"Actions",
)
action_comments = fields.Text(
"Action Plan Comments", help="Comments on the action plan."
)
# 4. Effectiveness Evaluation
evaluation_comments = fields.Text(
help="Conclusions from the last effectiveness evaluation.",
)
# Multi-company
company_id = fields.Many2one(
"res.company", "Company", default=lambda self: self.env.company
)
res_model = fields.Char(index=True)
res_id = fields.Integer(index=True)
@api.model
def _default_reference(self):
if self.env.context.get("active_model") and self.env.context.get("active_id"):
return (
self.env[self.env.context["active_model"]]
.browse(self.env.context.get("active_id"))
.exists()
.display_name
)
return ""
def _get_all_actions(self):
self.ensure_one()
return self.action_ids + self.immediate_action_id
@api.constrains("stage_id")
def _check_open_with_action_comments(self):
for nc in self:
if nc.state == "open" and not nc.action_comments:
raise models.ValidationError(
_(
"Action plan comments are required "
"in order to put a nonconformity In Progress."
)
)
@api.constrains("stage_id")
def _check_close_with_evaluation(self):
for nc in self:
if nc.state == "done":
if not nc.evaluation_comments:
raise models.ValidationError(
_(
"Evaluation Comments are required "
"in order to close a Nonconformity."
)
)
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.")
)
@api.model
def _elapsed_days(self, dt1, dt2):
return (dt2 - dt1).days if dt1 and dt2 else 0
@api.depends("closing_date", "create_date")
def _compute_number_of_days_to_close(self):
for nc in self:
nc.number_of_days_to_close = self._elapsed_days(
nc.create_date, nc.closing_date
)
@api.depends("write_date")
def _compute_days_since_updated(self):
for nc in self:
nc.days_since_updated = self._elapsed_days(nc.create_date, nc.write_date)
@api.model_create_multi
def create(self, vals):
for value in vals:
value.update(
{
"ref": self.env["ir.sequence"].next_by_code(
"mgmtsystem.nonconformity"
)
}
)
return super().create(vals)
def write(self, vals):
is_writing = self.env.context.get("is_writing", False)
is_state_change = "stage_id" in vals or "state" in vals
# Reset Kanban State on Stage change
if is_state_change:
was_not_open = {
x.id: x.state in ("draft", "analysis", "pending") for x in self
}
if any(self.filtered(lambda x: x.kanban_state != "normal")):
vals["kanban_state"] = "normal"
result = super().write(vals)
# Set/reset the closing date
if not is_writing and is_state_change:
for nc in self.with_context(is_writing=True):
# On Close set Closing Date
if nc.state == "done" and not nc.closing_date:
nc.closing_date = fields.Datetime.now()
# On reopen resete Closing Date
elif nc.state != "done" and nc.closing_date:
nc.closing_date = None
# On action plan approval, Open the Actions
if nc.state == "open" and was_not_open[nc.id]:
for action in nc._get_all_actions():
if action.stage_id.is_starting:
action.case_open()
return result

View file

@ -0,0 +1,90 @@
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from lxml import etree
from odoo import api, fields, models
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"
non_conformity_ids = fields.One2many(
"mgmtsystem.nonconformity",
inverse_name="res_id",
domain=lambda r: [("res_model", "=", r._name)],
readonly=True,
)
non_conformity_count = fields.Integer(compute="_compute_non_conformity_count")
@api.depends("non_conformity_ids")
def _compute_non_conformity_count(self):
for record in self:
record.non_conformity_count = len(record.non_conformity_ids)
def _get_non_conformities_domain(self):
return [("res_model", "=", self._name), ("res_id", "=", self.id)]
def _get_non_conformities_context(self):
return {}
def action_view_non_conformities(self):
self.ensure_one()
action = self.env.ref(
"mgmtsystem_nonconformity.open_mgmtsystem_nonconformity_list"
).read()[0]
action["domain"] = self._get_non_conformities_domain()
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)
if view_type == "form" and self.env.user.has_group(
"mgmtsystem.group_mgmtsystem_viewer"
):
View = self.env["ir.ui.view"]
if view_id and res.get("base_model", self._name) != self._name:
View = View.with_context(base_model_name=res["base_model"])
doc = etree.XML(res["arch"])
# 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')]"):
# _add_tier_validation_label process
new_node = etree.fromstring(
"<field name='non_conformity_count' invisible='1'/>"
)
new_arch, new_models = View.postprocess_and_fields(new_node, self._name)
new_node = etree.fromstring(new_arch)
for model in list(filter(lambda x: x not in all_models, new_models)):
if model not in res["models"]:
all_models[model] = new_models[model]
else:
all_models[model] = res["models"][model]
node.addprevious(new_node)
res["arch"] = etree.tostring(doc)
res["models"] = frozendict(all_models)
return res
@api.model
def _get_view_fields(self, view_type, models):
"""
We need to add this in order to fix the usage of form opening from
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"
):
result[self._name].add("non_conformity_count")
return result

View file

@ -0,0 +1,36 @@
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class MgmtsystemNonconformityCause(models.Model):
"""Cause of the nonconformity of the management system."""
_name = "mgmtsystem.nonconformity.cause"
_description = "Cause of the nonconformity of the management system"
_order = "parent_id, sequence"
_parent_store = True
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_id = fields.Many2one(
"mgmtsystem.nonconformity.cause", "Group", ondelete="restrict"
)
child_ids = fields.One2many(
"mgmtsystem.nonconformity.cause", "parent_id", "Child Causes"
)
ref_code = fields.Char("Reference Code")
def name_get(self):
res = []
for obj in self:
if obj.parent_id:
name = obj.parent_id.name_get()[0][1] + " / " + obj.name
else:
name = obj.name
res.append((obj.id, name))
return res

View file

@ -0,0 +1,35 @@
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class MgmtsystemNonconformityOrigin(models.Model):
_name = "mgmtsystem.nonconformity.origin"
_description = "Origin of nonconformity of the management system"
_order = "parent_id, sequence"
_parent_store = True
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_id = fields.Many2one(
"mgmtsystem.nonconformity.origin", "Group", ondelete="restrict"
)
child_ids = fields.One2many(
"mgmtsystem.nonconformity.origin", "parent_id", "Childs"
)
ref_code = fields.Char("Reference Code")
active = fields.Boolean(default=True)
def name_get(self):
res = []
for obj in self:
name = obj.name
if obj.parent_id:
name = obj.parent_id.name_get()[0][1] + " / " + name
res.append((obj.id, name))
return res

View file

@ -0,0 +1,17 @@
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class MgmtsystemNonconformitySeverity(models.Model):
"""Nonconformity Severity - Critical, Major, Minor, Invalid, ..."""
_name = "mgmtsystem.nonconformity.severity"
_description = "Severity of Complaints and Nonconformities"
name = fields.Char("Title", required=True, translate=True)
sequence = fields.Integer()
description = fields.Text(translate=True)
active = fields.Boolean("Active?", default=True)

View file

@ -0,0 +1,37 @@
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
# 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")),
]
class MgmtsystemNonconformityStage(models.Model):
"""This object is used to defined different state for non conformity."""
_name = "mgmtsystem.nonconformity.stage"
_description = "Nonconformity Stages"
_order = "sequence"
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")
is_starting = fields.Boolean(
string="Is starting Stage",
help="select stis checkbox if this is the default stage \n"
"for new nonconformities",
)
fold = fields.Boolean(
string="Folded in Kanban",
help="This stage is folded in the kanban view when there are \n"
"no records in that stage to display.",
)

View file

@ -0,0 +1,9 @@
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.

View file

@ -0,0 +1,14 @@
* Daniel Reis <dreis.pt@hotmail.com>
* Glen Dromgoole <gdromgoole@tier1engineering.com>
* Loic Lacroix <loic.lacroix@savoirfairelinux.com>
* Sandy Carter <sandy.carter@savoirfairelinux.com>
* Gervais Naoussi <gervaisnaoussi@gmail.com>
* Eugen Don <eugen.don@don-systems.de>
* Jose Maria Alzaga <jose.alzaga@aselcis.com>
* `Tecnativa <https://www.tecnativa.com>`_:
* Ernesto Tejeda
Trobz
* Dung Tran <dungtd@trobz.com>

View file

@ -0,0 +1,3 @@
The development of this module has been financially supported by:
* Camptocamp

View file

@ -0,0 +1,7 @@
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)

View file

@ -0,0 +1,2 @@
* 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

View file

@ -0,0 +1,45 @@
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
Click on the Save button and then on the "Action Plan" button in the top 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
When the action is created, a notification is sent to the person responsible
for the action.
Enter comments into the input field below the "Plan Review" section, those comments are required to reach the next stage.
To begin the work on the planned Actions change the stage of the NC to open by clicking on the "In Progress" button in the top right corner.
When all actions of the plan are done, their effectiveness must be evaluated
before closing the NC.

View file

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- Management System Non Conformity Report Pivot View -->
<record id="view_report_mgmtsystem_nonconformity_pivot" model="ir.ui.view">
<field name="name">mgmtsystem.nonconformity.report.pivot</field>
<field name="model">mgmtsystem.nonconformity</field>
<field name="arch" type="xml">
<pivot string="Non conformity" disable_linking="True">
<field name="state" type="row" />
<field name="user_id" type="col" />
<field name="number_of_nonconformities" type="measure" />
</pivot>
</field>
</record>
<!-- Non Conformity Report Graph View -->
<record id="view_report_mgmtsystem_nonconformity_graph" model="ir.ui.view">
<field name="name">mgmtsystem.nonconformity.report.graph</field>
<field name="model">mgmtsystem.nonconformity</field>
<field name="arch" type="xml">
<graph string="Non conformity">
<field name="state" />
<field name="user_id" />
<field name="number_of_nonconformities" type="measure" />
</graph>
</field>
</record>
<!-- Management system Non Conformity Report Action -->
<record
id="action_report_mgmtsystem_nonconformity"
model="ir.actions.act_window"
>
<field name="name">Management System Analysis</field>
<field name="res_model">mgmtsystem.nonconformity</field>
<field name="view_mode">pivot,graph</field>
<field name="view_id" />
<!-- force empty -->
<field
name="help"
>Have a general overview of all non conformities processed in the system by sorting them with specific criteria.</field>
</record>
<menuitem
name="Nonconformities"
id="menu_report_mgmtsystem_nonconformity_tree"
action="action_report_mgmtsystem_nonconformity"
parent="mgmtsystem.menu_mgmtsystem_report"
sequence="15"
/>
</odoo>

View file

@ -0,0 +1,15 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_mgmtsystem_nonconformity_user","mgmtsystem.nonconformity.user","model_mgmtsystem_nonconformity","mgmtsystem.group_mgmtsystem_user",1,1,1,0
"access_mgmtsystem_nonconformity_viewer","mgmtsystem.nonconformity.viewer","model_mgmtsystem_nonconformity","mgmtsystem.group_mgmtsystem_viewer",1,0,0,0
"access_mgmtsystem_nonconformity_origin_user","mgmtsystem.nonconformity.origin.user","model_mgmtsystem_nonconformity_origin","mgmtsystem.group_mgmtsystem_user",1,0,0,0
"access_mgmtsystem_nonconformity_origin_viewer","mgmtsystem.nonconformity.origin.viewer","model_mgmtsystem_nonconformity_origin","mgmtsystem.group_mgmtsystem_viewer",1,0,0,0
"access_mgmtsystem_nonconformity_origin_manager","mgmtsystem.nonconformity.origin.manager","model_mgmtsystem_nonconformity_origin","mgmtsystem.group_mgmtsystem_manager",1,1,1,1
"access_mgmtsystem_nonconformity_cause_user","mgmtsystem.nonconformity.cause.user","model_mgmtsystem_nonconformity_cause","mgmtsystem.group_mgmtsystem_user",1,0,0,0
"access_mgmtsystem_nonconformity_cause_viewer","mgmtsystem.nonconformity.cause.viewer","model_mgmtsystem_nonconformity_cause","mgmtsystem.group_mgmtsystem_viewer",1,0,0,0
"access_mgmtsystem_nonconformity_cause_manager","mgmtsystem.nonconformity.cause.manager","model_mgmtsystem_nonconformity_cause","mgmtsystem.group_mgmtsystem_manager",1,1,1,1
"access_mgmtsystem_nonconformity_severity_user","mgmtsystem.nonconformity.severity.user","model_mgmtsystem_nonconformity_severity","mgmtsystem.group_mgmtsystem_user",1,0,0,0
"access_mgmtsystem_nonconformity_severity_viewer","mgmtsystem.nonconformity.severity.viewer","model_mgmtsystem_nonconformity_severity","mgmtsystem.group_mgmtsystem_viewer",1,0,0,0
"access_mgmtsystem_nonconformity_severity_manager","mgmtsystem.nonconformity.severity.manager","model_mgmtsystem_nonconformity_severity","mgmtsystem.group_mgmtsystem_manager",1,1,1,1
"access_mgmtsystem_nonconformity_stage_user","access_mgmtsystem_nonconformity_stage","model_mgmtsystem_nonconformity_stage","mgmtsystem.group_mgmtsystem_user",1,0,0,0
"access_mgmtsystem_nonconformity_stage_viewer","mgmtsystem.nonconformity.stage.viewer","model_mgmtsystem_nonconformity_stage","mgmtsystem.group_mgmtsystem_viewer",1,0,0,0
"access_mgmtsystem_nonconformity_stage_manager","mgmtsystem.nonconformity.stage.manager","model_mgmtsystem_nonconformity_stage","mgmtsystem.group_mgmtsystem_manager",1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_mgmtsystem_nonconformity_user mgmtsystem.nonconformity.user model_mgmtsystem_nonconformity mgmtsystem.group_mgmtsystem_user 1 1 1 0
3 access_mgmtsystem_nonconformity_viewer mgmtsystem.nonconformity.viewer model_mgmtsystem_nonconformity mgmtsystem.group_mgmtsystem_viewer 1 0 0 0
4 access_mgmtsystem_nonconformity_origin_user mgmtsystem.nonconformity.origin.user model_mgmtsystem_nonconformity_origin mgmtsystem.group_mgmtsystem_user 1 0 0 0
5 access_mgmtsystem_nonconformity_origin_viewer mgmtsystem.nonconformity.origin.viewer model_mgmtsystem_nonconformity_origin mgmtsystem.group_mgmtsystem_viewer 1 0 0 0
6 access_mgmtsystem_nonconformity_origin_manager mgmtsystem.nonconformity.origin.manager model_mgmtsystem_nonconformity_origin mgmtsystem.group_mgmtsystem_manager 1 1 1 1
7 access_mgmtsystem_nonconformity_cause_user mgmtsystem.nonconformity.cause.user model_mgmtsystem_nonconformity_cause mgmtsystem.group_mgmtsystem_user 1 0 0 0
8 access_mgmtsystem_nonconformity_cause_viewer mgmtsystem.nonconformity.cause.viewer model_mgmtsystem_nonconformity_cause mgmtsystem.group_mgmtsystem_viewer 1 0 0 0
9 access_mgmtsystem_nonconformity_cause_manager mgmtsystem.nonconformity.cause.manager model_mgmtsystem_nonconformity_cause mgmtsystem.group_mgmtsystem_manager 1 1 1 1
10 access_mgmtsystem_nonconformity_severity_user mgmtsystem.nonconformity.severity.user model_mgmtsystem_nonconformity_severity mgmtsystem.group_mgmtsystem_user 1 0 0 0
11 access_mgmtsystem_nonconformity_severity_viewer mgmtsystem.nonconformity.severity.viewer model_mgmtsystem_nonconformity_severity mgmtsystem.group_mgmtsystem_viewer 1 0 0 0
12 access_mgmtsystem_nonconformity_severity_manager mgmtsystem.nonconformity.severity.manager model_mgmtsystem_nonconformity_severity mgmtsystem.group_mgmtsystem_manager 1 1 1 1
13 access_mgmtsystem_nonconformity_stage_user access_mgmtsystem_nonconformity_stage model_mgmtsystem_nonconformity_stage mgmtsystem.group_mgmtsystem_user 1 0 0 0
14 access_mgmtsystem_nonconformity_stage_viewer mgmtsystem.nonconformity.stage.viewer model_mgmtsystem_nonconformity_stage mgmtsystem.group_mgmtsystem_viewer 1 0 0 0
15 access_mgmtsystem_nonconformity_stage_manager mgmtsystem.nonconformity.stage.manager model_mgmtsystem_nonconformity_stage mgmtsystem.group_mgmtsystem_manager 1 1 1 1

View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<!-- Rule -->
<record model="ir.rule" id="mgmtsystem_nonconformity_rule">
<field name="name">mgmtsystem_nonconformity multi-company</field>
<field name="model_id" ref="model_mgmtsystem_nonconformity" />
<field name="global" eval="True" />
<field
name="domain_force"
>['|', ('company_id', '=', False), ('company_id', 'in', company_ids)]</field>
</record>
</odoo>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View file

@ -0,0 +1,523 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>README.rst</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic, pre.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document">
<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
</a>
<div class="section" id="management-system-nonconformity">
<h1>Management System - Nonconformity</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:b33df588c218de47c43bf07cfb5b460049b6a94cf2fd188542bbe7cad135d1bd
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/management-system/tree/16.0/mgmtsystem_nonconformity"><img alt="OCA/management-system" src="https://img.shields.io/badge/github-OCA%2Fmanagement--system-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/management-system-16-0/management-system-16-0-mgmtsystem_nonconformity"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/management-system&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module enables you to manage the nonconformities of your management systems:</p>
<ul class="simple">
<li>Quality (ISO 9001)</li>
<li>Environment (ISO 14001)</li>
<li>Information Security (ISO 27001)</li>
<li>Health and Safety (ISO 45001)</li>
<li>IT Services (ISO 20000)</li>
</ul>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#configuration" id="toc-entry-1">Configuration</a></li>
<li><a class="reference internal" href="#usage" id="toc-entry-2">Usage</a></li>
<li><a class="reference internal" href="#known-issues-roadmap" id="toc-entry-3">Known issues / Roadmap</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-4">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-5">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-6">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-7">Contributors</a></li>
<li><a class="reference internal" href="#other-credits" id="toc-entry-8">Other credits</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-9">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="configuration">
<h2><a class="toc-backref" href="#toc-entry-1">Configuration</a></h2>
<p>Users must be added to the appropriate groups within Odoo as follows:</p>
<ul class="simple">
<li>Creators: Settings &gt; Users &gt; Groups &gt; Management System / User</li>
</ul>
<p>To configure email notifications for certain stages go to:</p>
<ul class="simple">
<li>Management System &gt; Configuration &gt; Nonconformities &gt; Stages</li>
<li>Click on any stage and click the edit button.</li>
<li>Click on the dropdown icon in the field Email Template, select your template and click Save.</li>
</ul>
</div>
<div class="section" id="usage">
<h2><a class="toc-backref" href="#toc-entry-2">Usage</a></h2>
<p>To use this module:</p>
<ul class="simple">
<li>Go to Management System &gt; Nonconformities</li>
<li>Click on Create to enter the following information:</li>
<li>Partner&nbsp;: Customer, supplier or internal personnel</li>
<li>Related to: Any reference pointing to the NC (order id, project id, task id, etc.)</li>
<li>Responsible: Person responsible for the NC</li>
<li>Manager&nbsp;: Person managing the department or owner of the procedure</li>
<li>Filled in by: Originator of NC report</li>
<li>Origins: The source of the NC, how was it discover</li>
<li>Procedures: Against which procedure is the NC</li>
<li>Description: Evidence, reference to the standards</li>
<li>Click on Save and then on Analysis.</li>
</ul>
<p>Go to the newly created NC and fill in the following
information in the tab named Causes and Analysis:</p>
<ul class="simple">
<li>Causes: Add root causes</li>
<li>Analysis: Describe the results of the investigation</li>
<li>Severity: Select the severity among unfounded, minor and major</li>
<li>Immediate action: Create or select an immediate action if appropriate</li>
</ul>
<p>Click on the Save button and then on the “Action Plan” button in the top right corner.</p>
<p>In the Actions tab, select or create new actions by entering the following
items:</p>
<ul class="simple">
<li>Subject: What must be done - Return to Supplier, Use As Is, Scrap, Rework,
Re-grade, Repair</li>
<li>Deadline: Date by which the action must be completed</li>
<li>Responsible: Person in charge for implementing the action</li>
<li>Type: Immediate, corrective or preventive actions or improvement opportunity</li>
<li>Description: Details of the action</li>
</ul>
<p>When the action is created, a notification is sent to the person responsible
for the action.</p>
<p>Enter comments into the input field below the “Plan Review” section, those comments are required to reach the next stage.</p>
<p>To begin the work on the planned Actions change the stage of the NC to open by clicking on the “In Progress” button in the top right corner.</p>
<p>When all actions of the plan are done, their effectiveness must be evaluated
before closing the NC.</p>
</div>
<div class="section" id="known-issues-roadmap">
<h2><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h2>
<ul class="simple">
<li>The custom emails should be replaced by Mail Tracking features and Subtypes (like in Project Tasks and Project Issues)</li>
<li>Automatically add responsible_user_id._uid, manager_user_id._uid, author_user_id._uid to chatter</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h2><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h2>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/management-system/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/management-system/issues/new?body=module:%20mgmtsystem_nonconformity%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h2><a class="toc-backref" href="#toc-entry-5">Credits</a></h2>
<div class="section" id="authors">
<h3><a class="toc-backref" href="#toc-entry-6">Authors</a></h3>
<ul class="simple">
<li>Savoir-faire Linux</li>
</ul>
</div>
<div class="section" id="contributors">
<h3><a class="toc-backref" href="#toc-entry-7">Contributors</a></h3>
<ul class="simple">
<li>Daniel Reis &lt;<a class="reference external" href="mailto:dreis.pt&#64;hotmail.com">dreis.pt&#64;hotmail.com</a>&gt;</li>
<li>Glen Dromgoole &lt;<a class="reference external" href="mailto:gdromgoole&#64;tier1engineering.com">gdromgoole&#64;tier1engineering.com</a>&gt;</li>
<li>Loic Lacroix &lt;<a class="reference external" href="mailto:loic.lacroix&#64;savoirfairelinux.com">loic.lacroix&#64;savoirfairelinux.com</a>&gt;</li>
<li>Sandy Carter &lt;<a class="reference external" href="mailto:sandy.carter&#64;savoirfairelinux.com">sandy.carter&#64;savoirfairelinux.com</a>&gt;</li>
<li>Gervais Naoussi &lt;<a class="reference external" href="mailto:gervaisnaoussi&#64;gmail.com">gervaisnaoussi&#64;gmail.com</a>&gt;</li>
<li>Eugen Don &lt;<a class="reference external" href="mailto:eugen.don&#64;don-systems.de">eugen.don&#64;don-systems.de</a>&gt;</li>
<li>Jose Maria Alzaga &lt;<a class="reference external" href="mailto:jose.alzaga&#64;aselcis.com">jose.alzaga&#64;aselcis.com</a>&gt;</li>
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
<li>Ernesto Tejeda</li>
</ul>
</li>
</ul>
<p>Trobz</p>
<ul class="simple">
<li>Dung Tran &lt;<a class="reference external" href="mailto:dungtd&#64;trobz.com">dungtd&#64;trobz.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="other-credits">
<h3><a class="toc-backref" href="#toc-entry-8">Other credits</a></h3>
<p>The development of this module has been financially supported by:</p>
<ul class="simple">
<li>Camptocamp</li>
</ul>
</div>
<div class="section" id="maintainers">
<h3><a class="toc-backref" href="#toc-entry-9">Maintainers</a></h3>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/management-system/tree/16.0/mgmtsystem_nonconformity">OCA/management-system</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
</div>
</div>
</body>
</html>

View file

@ -0,0 +1,26 @@
/** @odoo-module **/
import {registerPatch} from "@mail/model/model_core";
registerPatch({
name: "Chatter",
recordMethods: {
async onClickShowNonConformities() {
if (this.isTemporary) {
const saved = await this.doSaveRecord();
if (!saved) {
return;
}
}
this.env.services.action.doAction(
"mgmtsystem_nonconformity.open_mgmtsystem_nonconformity_thread_list",
{
additionalContext: {
active_id: this.thread.id,
active_model: this.thread.model,
},
}
);
},
},
});

View file

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">
<t
t-name="mgmtsystem_nonconformity.ChatterTopbar"
t-inherit="mail.ChatterTopbar"
t-inherit-mode="extension"
owl="1"
>
<xpath
expr="//button[hasclass('o_ChatterTopbar_buttonToggleAttachments')]"
position="after"
>
<button
class="o_ChatterTopbar_button o_ChatterTopbar_buttonNonConformities btn btn-light btn-primary"
type="button"
t-att-disabled="!chatterTopbar.chatter.isTemporary and !chatterTopbar.chatter.hasWriteAccess"
t-on-click="() => this.chatterTopbar.chatter.onClickShowNonConformities()"
t-if="chatterTopbar.chatter.webRecord.data.non_conformity_count !== undefined"
>
<i
class="fa fa-exclamation-triangle fa-lg me-1"
role="img"
aria-label="Non conformities"
/>
<span
class="o_ChatterTopbar_buttonCount o_ChatterTopbar_buttonNonConformitiesCount"
t-esc="chatterTopbar.chatter.webRecord.data.non_conformity_count"
/>
</button>
</xpath>
</t>
</templates>

View file

@ -0,0 +1,5 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import test_cause
from . import test_origin
from . import test_nonconformity

View file

@ -0,0 +1,48 @@
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import exceptions
from odoo.tests import common
class TestModelCause(common.TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.record = cls.env["mgmtsystem.nonconformity.cause"].create(
{"name": "TestCause"}
)
cls.record2 = cls.env["mgmtsystem.nonconformity.cause"].create(
{"name": "test2", "parent_id": cls.record.id}
)
cls.record3 = cls.env["mgmtsystem.nonconformity.cause"].create(
{"name": "test3", "parent_id": cls.record2.id}
)
def test_create_cause(self):
self.assertNotEqual(self.record.id, 0)
self.assertNotEqual(self.record.id, None)
def test_name_get(self):
name_assoc = self.record.name_get()
self.assertEqual(name_assoc[0][1], "TestCause")
self.assertEqual(name_assoc[0][0], self.record.id)
name_assoc = self.record2.name_get()
self.assertEqual(name_assoc[0][1], "TestCause / test2")
self.assertEqual(name_assoc[0][0], self.record2.id)
name_assoc = self.record3.name_get()
self.assertEqual(name_assoc[0][1], "TestCause / test2 / test3")
self.assertEqual(name_assoc[0][0], self.record3.id)
def test_recursion(self):
parent = self.env["mgmtsystem.nonconformity.cause"].create(
{"name": "ParentCause"}
)
child = self.env["mgmtsystem.nonconformity.cause"].create(
{"name": "ChildCause", "parent_id": parent.id}
)
# no recursion
with self.assertRaises(exceptions.UserError), self.cr.savepoint():
parent.write({"parent_id": child.id})

View file

@ -0,0 +1,86 @@
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.exceptions import ValidationError
from odoo.tests import common
class TestModelNonConformity(common.TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.nc_model = cls.env["mgmtsystem.nonconformity"]
cls.partner = cls.env["res.partner"].search([])[0]
cls.nc_test = cls.nc_model.create(
{
"partner_id": cls.partner.id,
"manager_user_id": cls.env.user.id,
"description": "description",
"responsible_user_id": cls.env.user.id,
}
)
action_vals = {"name": "An Action", "type_action": "immediate"}
action1 = cls.nc_model.action_ids.create(action_vals)
cls.nc_test.immediate_action_id = action1
def test_stage_group(self):
"""Group by Stage shows all stages"""
group_stages = self.nc_test.read_group(
domain=[], fields=["stage_id"], groupby=["stage_id"]
)
num_stages = len(self.nc_model.stage_id.search([]))
self.assertEqual(len(group_stages), num_stages)
def test_reset_kanban_state(self):
"""Reset Kanban State on Stage change"""
self.nc_test.kanban_state = "done"
self.nc_test.stage_id = self.env.ref("mgmtsystem_nonconformity.stage_analysis")
self.assertEqual(self.nc_test.kanban_state, "normal")
def test_open_validation(self):
"""Don't allow approving/In Progress action comments"""
open_stage = self.env.ref("mgmtsystem_nonconformity.stage_open")
with self.assertRaises(ValidationError):
self.nc_test.stage_id = open_stage
def test_done_validation(self):
"""Don't allow closing an NC without evaluation comments"""
done_stage = self.env.ref("mgmtsystem_nonconformity.stage_done")
self.nc_test.action_comments = "OK!"
with self.assertRaises(ValidationError):
self.nc_test.stage_id = done_stage
def test_done_actions_validation(self):
"""Don't allow closing an NC with open actions"""
done_stage = self.env.ref("mgmtsystem_nonconformity.stage_done")
self.nc_test.immediate_action_id.stage_id = self.env.ref(
"mgmtsystem_action.stage_open"
)
self.nc_test.evaluation_comments = "OK!"
with self.assertRaises(ValidationError):
self.nc_test.stage_id = done_stage
def test_state_transition(self):
"""Close and reopen Nonconformity"""
self.nc_test.action_comments = "OK!"
self.nc_test.stage_id = self.env.ref("mgmtsystem_nonconformity.stage_open")
self.assertEqual(
self.nc_test.immediate_action_id.stage_id,
self.env.ref("mgmtsystem_action.stage_open"),
"Plan Approval starts Actions",
)
self.nc_test.immediate_action_id.stage_id = self.env.ref(
"mgmtsystem_action.stage_open"
)
self.nc_test.evaluation_comments = "OK!"
self.nc_test.immediate_action_id.stage_id = self.env.ref(
"mgmtsystem_action.stage_close"
)
self.nc_test.stage_id = self.env.ref("mgmtsystem_nonconformity.stage_done")
self.assertEqual(self.nc_test.state, "done")
self.assertTrue(self.nc_test.closing_date, "Set close date on Done")
self.nc_test.stage_id = self.env.ref("mgmtsystem_nonconformity.stage_open")
self.assertEqual(self.nc_test.state, "open")
self.assertFalse(self.nc_test.closing_date, "Reset close date on reopen")

View file

@ -0,0 +1,36 @@
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.tests import common
class TestModelOrigin(common.TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.record = cls.env["mgmtsystem.nonconformity.origin"].create(
{"name": "TestOrigin"}
)
cls.record2 = cls.env["mgmtsystem.nonconformity.origin"].create(
{"name": "test2", "parent_id": cls.record.id}
)
cls.record3 = cls.env["mgmtsystem.nonconformity.origin"].create(
{"name": "test3", "parent_id": cls.record2.id}
)
def test_create_origin(self):
self.assertNotEqual(self.record.id, 0)
self.assertNotEqual(self.record.id, None)
def test_name_get(self):
name_assoc = self.record.name_get()
self.assertEqual(name_assoc[0][1], "TestOrigin")
self.assertEqual(name_assoc[0][0], self.record.id)
name_assoc = self.record2.name_get()
self.assertEqual(name_assoc[0][1], "TestOrigin / test2")
self.assertEqual(name_assoc[0][0], self.record2.id)
name_assoc = self.record3.name_get()
self.assertEqual(name_assoc[0][1], "TestOrigin / test2 / test3")
self.assertEqual(name_assoc[0][0], self.record3.id)

View file

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- Actions: add link to NCs -->
<record id="view_mgmtsystem_action_form" model="ir.ui.view">
<field name="name">mgmtsystem.action.form</field>
<field name="model">mgmtsystem.action</field>
<field name="inherit_id" ref="mgmtsystem_action.view_mgmtsystem_action_form" />
<field name="arch" type="xml">
<field name="description" position="after">
<separator string="Related Nonconformities" colspan="4" />
<field
name="nonconformity_ids"
colspan="4"
nolabel="1"
attrs="{'invisible':[('nonconformity_ids','=',False)]}"
/>
</field>
</field>
</record>
</odoo>

View file

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- Cause -->
<record id="view_mgmtsystem_nonconformity_cause_form" model="ir.ui.view">
<field name="name">mgmtsystem.nonconformity.cause.form</field>
<field name="type">form</field>
<field name="model">mgmtsystem.nonconformity.cause</field>
<field name="arch" type="xml">
<form string="Causes of nonconformity">
<group>
<field name="name" />
<field name="sequence" />
<field name="parent_id" />
<field name="ref_code" />
<field name="description" />
</group>
</form>
</field>
</record>
<record id="view_mgmtsystem_nonconformity_cause_tree" model="ir.ui.view">
<field name="name">mgmtsystem.nonconformity.cause.tree</field>
<field name="model">mgmtsystem.nonconformity.cause</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree>
<field name="parent_id" />
<field name="name" />
<field name="description" />
<field name="sequence" />
</tree>
</field>
</record>
<record id="view_mgmtsystem_nonconformity_cause_filter" model="ir.ui.view">
<field name="name">Causes</field>
<field name="model">mgmtsystem.nonconformity.cause</field>
<field name="arch" type="xml">
<search string="Causes">
<field name="parent_id" />
<field name="name" />
</search>
</field>
</record>
<record id="open_mgmtsystem_nonconformity_cause_list" model="ir.actions.act_window">
<field name="name">Causes</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mgmtsystem.nonconformity.cause</field>
<field name="view_id" eval="view_mgmtsystem_nonconformity_cause_tree" />
<field name="search_view_id" ref="view_mgmtsystem_nonconformity_cause_filter" />
</record>
<menuitem
id="menu_open_nonconformity_cause"
action="open_mgmtsystem_nonconformity_cause_list"
parent="menu_mgmtsystem_configuration_nonconformities"
sequence="30"
groups="mgmtsystem.group_mgmtsystem_manager"
/>
</odoo>

View file

@ -0,0 +1,419 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<menuitem
id="menu_mgmtsystem_configuration_nonconformities"
name="Nonconformities"
parent="mgmtsystem.menu_mgmtsystem_configuration"
groups="mgmtsystem.group_mgmtsystem_manager"
sequence="10"
/>
<record id="view_mgmtsystem_nonconformity_tree" model="ir.ui.view">
<field name="name">mgmtsystem.nonconformity.tree</field>
<field name="model">mgmtsystem.nonconformity</field>
<field name="arch" type="xml">
<tree>
<field name="ref" />
<field name="create_date" />
<field name="partner_id" />
<field name="description" />
<field name="user_id" />
<field name="responsible_user_id" />
<field name="manager_user_id" />
<field name="system_id" />
<field name="company_id" groups="base.group_multi_company" />
<field name="stage_id" />
</tree>
</field>
</record>
<record id="view_mgmtsystem_nonconformity_filter" model="ir.ui.view">
<field name="name">mgmtsystem.nonconformity.filter</field>
<field name="model">mgmtsystem.nonconformity</field>
<field name="arch" type="xml">
<search>
<group name="filters">
<filter
name="draft"
icon="terp-document-new"
domain="[('state','=','draft')]"
string="Draft"
help="Draft/New nonconformities"
/>
<filter
name="pending"
icon="terp-gtk-media-pause"
domain="[('state','in',['analysis','pending'])]"
string="Analysis"
help="Nonconformities pending review"
/>
<filter
name="current"
icon="terp-check"
domain="[('state','=','open')]"
string="In Progress"
help="Open Nonconformities"
/>
<filter
name="icon"
icon="terp-camera_test"
domain="[('state','=','done')]"
string="Closed"
help="Closed Nonconformities"
/>
<separator orientation="vertical" />
<field name="ref" />
<field name="create_date" />
<filter
name="current_user"
string="User"
domain="['|','|',('user_id','=',uid),('responsible_user_id','=',uid),('manager_user_id','=',uid)]"
/>
<field name="system_id" />
<field name="company_id" groups="base.group_multi_company" />
</group>
<newline />
<group expand="0" string="Group By...">
<filter
name="groupby_author"
string="Author"
icon="gtk-edit"
context="{'group_by':'user_id'}"
/>
<filter
name="groupby_responsible"
string="Responsible"
icon="terp-personal"
context="{'group_by':'responsible_user_id'}"
/>
<filter
name="groupby_manager"
string="Manager"
icon="terp-personal+"
context="{'group_by':'manager_user_id'}"
/>
<separator orientation="vertical" />
<filter
name="groupby_system"
string="System"
icon="gtk-execute"
context="{'group_by':'system_id'}"
/>
<filter
name="groupby_partner"
string="Partner"
icon="terp-personal+"
domain="[]"
context="{'group_by':'partner_id'}"
/>
<filter
name="groupby_procedure"
string="Procedure"
icon="terp-stock_symbol-selection"
context="{'group_by':'procedure_ids'}"
/>
</group>
</search>
</field>
</record>
<!-- Kanban view -->
<record id="view_mgmtsystem_nonconformity_kanban" model="ir.ui.view">
<field name="name">mgmtsystem.nonconformity.kanban</field>
<field name="model">mgmtsystem.nonconformity</field>
<field name="arch" type="xml">
<kanban
quick_create="false"
default_group_by="stage_id"
class="o_kanban_small_column"
>
<field name="stage_id" />
<field name="responsible_user_id" />
<field name="ref" />
<field name="name" />
<field name="message_needaction_counter" />
<templates>
<t t-name="kanban-box">
<div
t-attf-class="#{kanban_color(red)} oe_kanban_global_click oe_kanban_content"
>
<div class="o_dropdown_kanban dropdown">
<a
class="dropdown-toggle btn"
role="button"
data-toggle="dropdown"
href="#"
data-display="static"
aria-label="Dropdown menu"
title="Dropdown menu"
>
<span class="fa fa-bars fa-lg" />
</a>
<ul
class="dropdown-menu"
role="menu"
aria-labelledby="dLabel"
>
<t t-if="widget.editable">
<li>
<a
type="edit"
role="menuitem"
class="dropdown-item"
>
Edit
</a>
</li>
</t>
</ul>
</div>
<div>
<strong><field name="ref" /> - <field
name="name"
/></strong>
</div>
<div class="o_kanban_record_bottom">
<div class="oe_kanban_bottom_left">
<span
class='oe_kanban_mail_new'
title='Unread Messages'
><i class='fa fa-comments' /><t
t-raw="record.message_needaction_counter.raw_value"
/></span>
</div>
<div class="oe_kanban_bottom_right">
<field
name="kanban_state"
widget="kanban_state_selection"
/>
<field
name="responsible_user_id"
widget="many2one_avatar_user"
/>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="view_mgmtsystem_nonconformity_form" model="ir.ui.view">
<field name="name">mgmtsystem.nonconformity.form</field>
<field name="model">mgmtsystem.nonconformity</field>
<field name="arch" type="xml">
<form string="Non-Conformity">
<header>
<field
name="stage_id"
widget="statusbar"
options="{'clickable': 1}"
/>
<field name="state" invisible="True" />
</header>
<sheet string="Non-Conformity">
<div class="oe_button_box" name="button_box" />
<field name="kanban_state" widget="kanban_state_selection" />
<group name="main">
<group name="config">
<field
name="name"
attrs="{'readonly':[('state','not in',['draft'])]}"
/>
<field
name="ref"
attrs="{'readonly':[('state','not in',['draft'])]}"
/>
<field name="create_date" readonly="1" />
<field
name="partner_id"
attrs="{'readonly':[('state','not in',['draft','analysis'])]}"
/>
<field
name="reference"
attrs="{'readonly':[('state','not in',['draft'])]}"
/>
<field
name="origin_ids"
widget="many2many_tags"
attrs="{'readonly':[('state','not in',['draft','analysis'])]}"
/>
</group>
<group name="meta">
<field
name="responsible_user_id"
attrs="{'readonly':[('state','not in',['draft','analysis'])]}"
/>
<field
name="manager_user_id"
attrs="{'readonly':[('state','not in',['draft','analysis'])]}"
/>
<field
name="user_id"
attrs="{'readonly':[('state','not in',['draft'])]}"
/>
<field
name="system_id"
attrs="{'readonly':[('state','not in',['draft','analysis'])]}"
/>
<field
name="company_id"
groups="base.group_multi_company"
/>
</group>
</group>
<notebook>
<page string="Description" name="description">
<field
name="description"
placeholder="Add a description ..."
attrs="{'readonly':[('state','not in',['draft','analysis'])]}"
/>
<group name="state">
<field
name="immediate_action_id"
domain="[('type_action','=','immediate')]"
attrs="{'readonly':[('state','not in',['draft', 'analysis'])]}"
/>
</group>
</page>
<page string="Procedures" name="procedures">
<field
name="procedure_ids"
attrs="{'readonly':[('state','not in',['draft','analysis'])]}"
domain="[('parent_id','in',('Procedure','Environmental Aspect','Manuals'))]"
/>
</page>
<page
string="Causes and Analysis"
attrs="{'invisible':[('state','in',['draft','cancel'])]}"
name="causes_analysis"
>
<separator string="Analysis" />
<field
name="analysis"
attrs="{'readonly':[('state','not in',['analysis'])]}"
/>
<separator string="Causes" />
<field
name="cause_ids"
attrs="{'readonly':[('state','not in',['analysis'])]}"
options="{'no_create': True}"
>
<tree create="1" delete="1" decoration-info="parent_id">
<field name="parent_id" />
<field name="name" />
<field name="description" />
<field name="sequence" />
</tree>
</field>
<separator string="Analysis Confirmation" />
<group>
<group>
<field
name="severity_id"
attrs="{'readonly':[('state','not in',['analysis'])]}"
/>
</group>
</group>
</page>
<page
string="Actions"
attrs="{'invisible':[('state','in',['draft','analysis','cancel'])]}"
name="actions"
>
<separator string="Action Plan" />
<field
name="action_ids"
attrs="{'readonly':[('state','not in',['pending'])]}"
/>
<group string="Plan Review" name="plan_review">
<field
name="action_comments"
attrs="{'readonly':[('state','not in',['pending'])]}"
nolabel="1"
colspan="2"
placeholder="Action Plan Comments"
/>
</group>
<group
name="effectiveness_review"
attrs="{'invisible':[('state','not in',['open','done'])]}"
string="Effectiveness Review"
>
<field
name="evaluation_comments"
attrs="{'readonly':[('state','not in',['open'])]}"
nolabel="1"
colspan="2"
placeholder="Evaluation Comments"
/>
</group>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field
name="message_follower_ids"
widget="mail_followers"
groups="base.group_user"
/>
<field name="activity_ids" widget="mail_activity" />
<field name="message_ids" widget="mail_thread" />
</div>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="open_mgmtsystem_nonconformity_list">
<field name="name">Nonconformities</field>
<field name="res_model">mgmtsystem.nonconformity</field>
<field name="view_mode">kanban,tree,form</field>
<field name="view_id" ref="view_mgmtsystem_nonconformity_kanban" />
<field name="search_view_id" ref="view_mgmtsystem_nonconformity_filter" />
<field name="context">{"search_default_user_id":uid}</field>
</record>
<record
model="ir.actions.act_window"
id="open_mgmtsystem_nonconformity_thread_list"
>
<field name="name">Nonconformities</field>
<field name="res_model">mgmtsystem.nonconformity</field>
<field name="view_mode">kanban,tree,form</field>
<field
name="domain"
>[('res_id', '=', active_id), ('res_model', '=', active_model)]</field>
<field name="view_id" ref="view_mgmtsystem_nonconformity_kanban" />
<field name="search_view_id" ref="view_mgmtsystem_nonconformity_filter" />
<field
name="context"
>{"search_default_user_id":uid, "default_res_model": active_model, "default_res_id": active_id}</field>
</record>
<menuitem
id="menu_open_nonconformity"
name="Nonconformities"
action="open_mgmtsystem_nonconformity_list"
parent="mgmtsystem.menu_mgmtsystem_main"
sequence="30"
groups="mgmtsystem.group_mgmtsystem_manager,mgmtsystem.group_mgmtsystem_auditor,base.group_user"
/>
</odoo>

View file

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record model="ir.ui.view" id="mgmtsystem_nonconformity_stage_tree_view">
<field name="name">Management System Nonconformity Stage Tree</field>
<field name="model">mgmtsystem.nonconformity.stage</field>
<field name="arch" type="xml">
<tree>
<field name="name" />
<field name="sequence" widget="handle" />
<field name="state" />
</tree>
</field>
</record>
<record id="mgmtsystem_nonconformity_stage_form_view" model="ir.ui.view">
<field name="name">mgmtsystem.nonconformity.stage.form.view</field>
<field name="model">mgmtsystem.nonconformity.stage</field>
<field name="arch" type="xml">
<form string="Nonconformity Stage">
<sheet>
<group>
<field name="name" />
</group>
<group>
<field name="fold" />
<field name="sequence" groups="base.group_no_one" />
<field name="is_starting" />
<field name="state" />
</group>
</sheet>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="mgmtsystem_nonconformity_stage_action">
<field name="name">Stages</field>
<field name="res_model">mgmtsystem.nonconformity.stage</field>
<field name="view_mode">tree,form</field>
<field name="context">{}</field>
</record>
<menuitem
id="menu_mgmtsystem_nonconformity_stages"
name="Stages"
parent="menu_mgmtsystem_configuration_nonconformities"
action="mgmtsystem_nonconformity_stage_action"
sequence="90"
groups="mgmtsystem.group_mgmtsystem_manager,mgmtsystem.group_mgmtsystem_auditor,base.group_user"
/>
</odoo>

View file

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- Origin -->
<record id="view_mgmtsystem_nonconformity_origin_form" model="ir.ui.view">
<field name="name">mgmtsystem.nonconformity.origin.form</field>
<field name="type">form</field>
<field name="model">mgmtsystem.nonconformity.origin</field>
<field name="arch" type="xml">
<form string="Origins of nonconformity">
<sheet>
<field name="active" invisible="1" />
<widget
name="web_ribbon"
title="Archived"
bg_color="bg-danger"
attrs="{'invisible': [('active', '=', True)]}"
/>
<group>
<field name="name" />
<field name="sequence" />
<field name="parent_id" />
<field name="ref_code" />
<field name="description" />
</group>
</sheet>
</form>
</field>
</record>
<record id="view_mgmtsystem_nonconformity_origin_tree" model="ir.ui.view">
<field name="name">mgmtsystem.nonconformity.origin.tree</field>
<field name="model">mgmtsystem.nonconformity.origin</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree>
<field name="parent_id" />
<field name="name" />
<field name="description" />
<field name="sequence" />
</tree>
</field>
</record>
<record id="view_mgmtsystem_nonconformity_origin_filter" model="ir.ui.view">
<field name="name">Origins</field>
<field name="model">mgmtsystem.nonconformity.origin</field>
<field name="arch" type="xml">
<search string="Origins">
<field name="parent_id" />
<field name="name" />
</search>
</field>
</record>
<record
id="open_mgmtsystem_nonconformity_origin_list"
model="ir.actions.act_window"
>
<field name="name">Origins</field>
<field name="res_model">mgmtsystem.nonconformity.origin</field>
<field name="view_mode">tree,form</field>
<field name="view_id" eval="False" />
<field name="search_view_id" ref="view_mgmtsystem_nonconformity_origin_filter" />
</record>
<menuitem
id="menu_open_nonconformity_origin"
action="open_mgmtsystem_nonconformity_origin_list"
parent="menu_mgmtsystem_configuration_nonconformities"
sequence="20"
groups="mgmtsystem.group_mgmtsystem_manager"
/>
</odoo>

View file

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- Severity -->
<record id="view_mgmtsystem_nonconformity_severity_form" model="ir.ui.view">
<field name="name">mgmtsystem.nonconformity.severity.form</field>
<field name="type">form</field>
<field name="model">mgmtsystem.nonconformity.severity</field>
<field name="arch" type="xml">
<form string="Severity of Complaints and Nonconformities">
<group>
<field name="name" />
<field name="sequence" />
<field name="description" colspan="2" />
<field name="active" />
</group>
</form>
</field>
</record>
<record
id="open_mgmtsystem_nonconformity_severity_list"
model="ir.actions.act_window"
>
<field name="name">Severity</field>
<field name="res_model">mgmtsystem.nonconformity.severity</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem
id="menu_open_nonconformity_severity"
action="open_mgmtsystem_nonconformity_severity_list"
parent="mgmtsystem_nonconformity.menu_mgmtsystem_configuration_nonconformities"
groups="mgmtsystem.group_mgmtsystem_manager"
/>
</odoo>