diff --git a/quality_control_team/README.rst b/quality_control_team/README.rst new file mode 100644 index 000000000..887063bff --- /dev/null +++ b/quality_control_team/README.rst @@ -0,0 +1,61 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +==================== +Quality Control Team +==================== + +This module extends the functionality of Quality Control app to support the +use of Quality control teams and to allow you to manage different team flows. + +This module by itself does not provide any functionality to QC teams. It +provides the teams basic configuration and a dashboard to be used by other +modules. + +Configuration +============= + +To configure this module, you need to: + +#. Go to *Quality Control > Configuration > Quality Control Teams*. + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/129/9.0 + +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 smash it by providing detailed and welcomed feedback. + +Credits +======= + +Images +------ + +* Odoo Community Association: `Icon `_. + +Contributors +------------ + +* Lois Rilo + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +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. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/quality_control_team/__init__.py b/quality_control_team/__init__.py new file mode 100644 index 000000000..7201c0805 --- /dev/null +++ b/quality_control_team/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models diff --git a/quality_control_team/__openerp__.py b/quality_control_team/__openerp__.py new file mode 100644 index 000000000..02328abc2 --- /dev/null +++ b/quality_control_team/__openerp__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +{ + "name": "Quality Control Team", + "summary": "Adds quality control teams to handle different quality " + "control workflows", + "version": "9.0.1.0.0", + "category": "Quality Control", + "website": "https://odoo-community.org/", + "author": "Eficent, Odoo Community Association (OCA)", + "license": "AGPL-3", + "application": False, + "installable": True, + "depends": [ + "quality_control", + ], + "data": [ + "security/ir.model.access.csv", + "views/qc_team_view.xml", + "views/qc_team_dashboard.xml", + "data/quality_control_team_data.xml", + ], +} diff --git a/quality_control_team/data/quality_control_team_data.xml b/quality_control_team/data/quality_control_team_data.xml new file mode 100644 index 000000000..58f52a17b --- /dev/null +++ b/quality_control_team/data/quality_control_team_data.xml @@ -0,0 +1,14 @@ + + + + + + + + Main QC Team + + + + + diff --git a/quality_control_team/models/__init__.py b/quality_control_team/models/__init__.py new file mode 100644 index 000000000..2009458d5 --- /dev/null +++ b/quality_control_team/models/__init__.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import qc_team +from . import res_partner +from . import res_user diff --git a/quality_control_team/models/qc_team.py b/quality_control_team/models/qc_team.py new file mode 100644 index 000000000..c1d0cc350 --- /dev/null +++ b/quality_control_team/models/qc_team.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openerp import api, fields, models + + +class QualityControlTeam(models.Model): + _name = "qc.team" + _inherit = ['mail.thread', 'ir.needaction_mixin'] + _description = "Quality Control Team" + _order = "name" + + @api.model + def _get_default_qc_team_id(self, user_id=None): + if not user_id: + user_id = self.env.uid + qc_team_id = None + if 'default_qc_team_id' in self.env.context: + qc_team_id = self.env['qc.team'].browse( + self.env.context.get('default_qc_team_id')) + if not qc_team_id or not qc_team_id.exists(): + company_id = self.sudo(user_id).company_id.id + qc_team_id = self.env['qc.team'].sudo().search([ + '|', + ('user_id', '=', user_id), + ('member_ids', '=', user_id), + '|', + ('company_id', '=', False), + ('company_id', 'child_of', [company_id]) + ], limit=1) + if not qc_team_id: + default_team_id = self.env.ref( + 'quality_control_team.qc_team_main', raise_if_not_found=False) + if default_team_id: + qc_team_id = default_team_id + return qc_team_id + + name = fields.Char( + string='Quality Control Team', required=True) + active = fields.Boolean(default=True) + company_id = fields.Many2one( + comodel_name='res.company', string='Company', + default=lambda self: self.env['res.company']._company_default_get( + 'qc.team')) + user_id = fields.Many2one( + comodel_name='res.users', string='Team Leader') + member_ids = fields.One2many( + comodel_name='res.users', inverse_name='qc_team_id', + string='Team Members') + reply_to = fields.Char( + string='Reply-To', + help="The email address put in the 'Reply-To' of all emails sent by " + "Odoo about cases in this QC team") + color = fields.Integer(string='Color Index', help="The color of the team") + + @api.model + def create(self, values): + return super( + QualityControlTeam, + self.with_context(mail_create_nosubscribe=True)).create(values) diff --git a/quality_control_team/models/res_partner.py b/quality_control_team/models/res_partner.py new file mode 100644 index 000000000..714b96e03 --- /dev/null +++ b/quality_control_team/models/res_partner.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openerp import fields, models + + +class ResPartner(models.Model): + _inherit = 'res.partner' + + qc_team_id = fields.Many2one( + comodel_name='qc.team', string='Quality Control Team') diff --git a/quality_control_team/models/res_user.py b/quality_control_team/models/res_user.py new file mode 100644 index 000000000..7fcaaa00c --- /dev/null +++ b/quality_control_team/models/res_user.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openerp import fields, models + + +class ResUsers(models.Model): + _inherit = 'res.users' + + qc_team_id = fields.Many2one( + comodel_name='qc.team', string='Quality Control Team') diff --git a/quality_control_team/security/ir.model.access.csv b/quality_control_team/security/ir.model.access.csv new file mode 100644 index 000000000..5e04d8322 --- /dev/null +++ b/quality_control_team/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_user_qc_team,qc.team.user,quality_control_team.model_qc_team,quality_control.group_quality_control_user,1,0,0,0 +access_manager_qc_team,qc.team.manager,quality_control_team.model_qc_team,quality_control.group_quality_control_manager,1,1,1,1 diff --git a/quality_control_team/static/description/icon.png b/quality_control_team/static/description/icon.png new file mode 100644 index 000000000..e0aa80bce Binary files /dev/null and b/quality_control_team/static/description/icon.png differ diff --git a/quality_control_team/static/description/icon.svg b/quality_control_team/static/description/icon.svg new file mode 100644 index 000000000..1c275d282 --- /dev/null +++ b/quality_control_team/static/description/icon.svg @@ -0,0 +1,95 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/quality_control_team/views/qc_team_dashboard.xml b/quality_control_team/views/qc_team_dashboard.xml new file mode 100644 index 000000000..6c2b26492 --- /dev/null +++ b/quality_control_team/views/qc_team_dashboard.xml @@ -0,0 +1,100 @@ + + + + + + qc.team.dashboard + qc.team + + + + + + + + +
+
+
+
+
+
+ More +
+
+
+
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + +
+ +
+
+
    +
+
+ Settings +
+
+
+
+ + + + + + + + Case Teams - Search + qc.team + + + + + + + + + + + + + + Dashboard + qc.team + form + kanban,form + {'search_default_personal':1} + +

Define a new quality control teams going to Configuration > + Quality Control Teams. +

+
+
+ + + + diff --git a/quality_control_team/views/qc_team_view.xml b/quality_control_team/views/qc_team_view.xml new file mode 100644 index 000000000..4541c2053 --- /dev/null +++ b/quality_control_team/views/qc_team_view.xml @@ -0,0 +1,108 @@ + + + + + + qc.team.form + qc.team + +
+ +
+