[IMP] Total refactorization of quality control modules with new API, README files, and new concepts. WIP of quality_control_tolerance

This commit is contained in:
Pedro M. Baeza
2014-12-10 23:35:21 +01:00
committed by Andhitia Rama
parent 559de88ff8
commit aa1049042c
9 changed files with 189 additions and 0 deletions

View File

@@ -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 <alfredodelafuente@avanzosc.es>
* Pedro M. Baeza <pedro.baeza@serviciobaeza.com>
* Ana Juaristi <ajuaristio@gmail.com>

View File

@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from . import models

View File

@@ -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 <http://www.gnu.org/licenses/>.
#
##############################################################################
{
"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,
}

View File

@@ -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"

View File

@@ -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 ""

View File

@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from . import qc_inspection

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="qc_inspection_form_view_putvalid">
<field name="name">qc.inspection.form.view.putvalid</field>
<field name="model">qc.inspection</field>
<field name="inherit_id" ref="quality_control.qc_inspection_form_view" />
<field name="arch" type="xml">
<field name="success" position="after">
<field name="force_valid"
attrs="{'readonly': [('state', 'not in', ('draft', 'waiting'))]}" />
</field>
</field>
</record>
<record model="ir.ui.view" id="qc_inspection_tree_view_putvalid">
<field name="name">qc.inspection.tree.view.putvalid</field>
<field name="model">qc.inspection</field>
<field name="inherit_id" ref="quality_control.qc_inspection_tree_view" />
<field name="arch" type="xml">
<field name="success" position="after">
<field name="force_valid" />
</field>
</field>
</record>
<record model="ir.ui.view" id="qc_inspection_search_view_putvalid">
<field name="name">qc.inspection.search.view.putvalid</field>
<field name="model">qc.inspection</field>
<field name="inherit_id" ref="quality_control.qc_inspection_search_view" />
<field name="arch" type="xml">
<filter string="Success" position="after">
<filter string="Force valid"
domain="[]"
context="{'group_by': 'force_valid'}" />
</filter>
</field>
</record>
</data>
</openerp>