mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[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:
committed by
Andhitia Rama
parent
559de88ff8
commit
aa1049042c
11
quality_control_force_valid/README.rst
Normal file
11
quality_control_force_valid/README.rst
Normal 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>
|
||||
6
quality_control_force_valid/__init__.py
Normal file
6
quality_control_force_valid/__init__.py
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
# For copyright and license notices, see __openerp__.py file in root directory
|
||||
##############################################################################
|
||||
|
||||
from . import models
|
||||
35
quality_control_force_valid/__openerp__.py
Normal file
35
quality_control_force_valid/__openerp__.py
Normal 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,
|
||||
}
|
||||
29
quality_control_force_valid/i18n/es.po
Normal file
29
quality_control_force_valid/i18n/es.po
Normal 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"
|
||||
|
||||
|
||||
@@ -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 ""
|
||||
|
||||
|
||||
6
quality_control_force_valid/models/__init__.py
Normal file
6
quality_control_force_valid/models/__init__.py
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
# For copyright and license notices, see __openerp__.py file in root directory
|
||||
##############################################################################
|
||||
|
||||
from . import qc_inspection
|
||||
31
quality_control_force_valid/models/qc_inspection.py
Normal file
31
quality_control_force_valid/models/qc_inspection.py
Normal 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
|
||||
BIN
quality_control_force_valid/static/description/icon.png
Normal file
BIN
quality_control_force_valid/static/description/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.7 KiB |
42
quality_control_force_valid/views/qc_inspection_view.xml
Normal file
42
quality_control_force_valid/views/qc_inspection_view.xml
Normal 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>
|
||||
Reference in New Issue
Block a user