diff --git a/quality_control_force_valid/README.rst b/quality_control_force_valid/README.rst new file mode 100644 index 000000000..47369a113 --- /dev/null +++ b/quality_control_force_valid/README.rst @@ -0,0 +1,11 @@ +Manual validation for quality control inspections +================================================= + +This module adds a manual validation flag which allows to override the result +of the inspection. + +Contributors +------------ +* Alfredo de la Fuente +* Pedro M. Baeza +* Ana Juaristi diff --git a/quality_control_force_valid/__init__.py b/quality_control_force_valid/__init__.py new file mode 100644 index 000000000..ad6c8186c --- /dev/null +++ b/quality_control_force_valid/__init__.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## + +from . import models diff --git a/quality_control_force_valid/__openerp__.py b/quality_control_force_valid/__openerp__.py new file mode 100644 index 000000000..df89190a5 --- /dev/null +++ b/quality_control_force_valid/__openerp__.py @@ -0,0 +1,35 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Copyright (c) +# 2014 Serv. Tec. Avanzados - Pedro M. Baeza (http://www.serviciosbaeza.com) +# 2014 AvanzOsc (http://www.avanzosc.es) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +{ + "name": "Quality control - Manual validation", + "version": "1.0", + "depends": [ + "quality_control", + ], + "author": "OdooMRP team", + "category": "Quality control", + 'data': [ + 'views/qc_inspection_view.xml', + ], + 'installable': True, +} diff --git a/quality_control_force_valid/i18n/es.po b/quality_control_force_valid/i18n/es.po new file mode 100644 index 000000000..40547485c --- /dev/null +++ b/quality_control_force_valid/i18n/es.po @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * quality_control_force_valid +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-12-07 16:39+0000\n" +"PO-Revision-Date: 2014-12-07 16:39+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: quality_control_force_valid +#: view:qc.inspection:quality_control_force_valid.qc_inspection_search_view_putvalid +#: field:qc.inspection,force_valid:0 +msgid "Force valid" +msgstr "Forzar validez" + +#. module: quality_control_force_valid +#: help:qc.inspection,force_valid:0 +msgid "Mark this field if you want to override the result of the inspection" +msgstr "Marque esta casilla si quiere sobreescribir el resultado de la inspección" + + diff --git a/quality_control_force_valid/i18n/quality_control_force_valid.pot b/quality_control_force_valid/i18n/quality_control_force_valid.pot new file mode 100644 index 000000000..0f6714022 --- /dev/null +++ b/quality_control_force_valid/i18n/quality_control_force_valid.pot @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * quality_control_force_valid +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-12-07 16:39+0000\n" +"PO-Revision-Date: 2014-12-07 16:39+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: quality_control_force_valid +#: view:qc.inspection:quality_control_force_valid.qc_inspection_search_view_putvalid +#: field:qc.inspection,force_valid:0 +msgid "Force valid" +msgstr "" + +#. module: quality_control_force_valid +#: help:qc.inspection,force_valid:0 +msgid "Mark this field if you want to override the result of the inspection" +msgstr "" + + diff --git a/quality_control_force_valid/models/__init__.py b/quality_control_force_valid/models/__init__.py new file mode 100644 index 000000000..8752836a8 --- /dev/null +++ b/quality_control_force_valid/models/__init__.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## + +from . import qc_inspection diff --git a/quality_control_force_valid/models/qc_inspection.py b/quality_control_force_valid/models/qc_inspection.py new file mode 100644 index 000000000..08df8ecef --- /dev/null +++ b/quality_control_force_valid/models/qc_inspection.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## + +from openerp import models, fields, api + + +class QcInspection(models.Model): + _inherit = 'qc.inspection' + + force_valid = fields.Boolean( + string='Force valid', + help="Mark this field if you want to override the result of the " + "inspection") + + @api.multi + def action_confirm(self): + res = super(QcInspection, self).action_confirm() + for inspection in self: + if inspection.force_valid and inspection.state != 'success': + inspection.state = 'success' + return res + + @api.multi + def action_approve(self): + res = super(QcInspection, self).action_approve() + for inspection in self: + if inspection.force_valid and inspection.state != 'success': + inspection.state = 'success' + return res diff --git a/quality_control_force_valid/static/description/icon.png b/quality_control_force_valid/static/description/icon.png new file mode 100644 index 000000000..c93813525 Binary files /dev/null and b/quality_control_force_valid/static/description/icon.png differ diff --git a/quality_control_force_valid/views/qc_inspection_view.xml b/quality_control_force_valid/views/qc_inspection_view.xml new file mode 100644 index 000000000..5a72e1b3c --- /dev/null +++ b/quality_control_force_valid/views/qc_inspection_view.xml @@ -0,0 +1,42 @@ + + + + + + qc.inspection.form.view.putvalid + qc.inspection + + + + + + + + + + qc.inspection.tree.view.putvalid + qc.inspection + + + + + + + + + + qc.inspection.search.view.putvalid + qc.inspection + + + + + + + + + +