From a6ede073a399c4e807c9de1e94fb3f6a4f179ff4 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 10 Dec 2014 23:35:21 +0100 Subject: [PATCH] quality_control: Total refactorization with new API, README files, and new concepts. * Triggers for product category * ACLs * Tolerances in questions * one2many copyable * Fix some views * Error on same tolerance * Colors on inspection lines * Unify inspection header data assignment in set_test method * key name in set_test * Change icon set --- quality_control/README.rst | 44 + quality_control/__init__.py | 29 +- quality_control/__openerp__.py | 64 +- quality_control/data/quality_control_data.xml | 24 +- quality_control/i18n/es.po | 875 +++++++++--------- quality_control/i18n/quality_control.pot | 761 ++++++++------- quality_control/models/__init__.py | 36 +- quality_control/models/product_category.py | 14 + quality_control/models/product_product.py | 13 + quality_control/models/product_template.py | 14 + quality_control/models/qc_inspection.py | 293 ++++++ quality_control/models/qc_test.py | 95 ++ quality_control/models/qc_test_category.py | 48 + quality_control/models/qc_trigger.py | 18 + quality_control/models/qc_trigger_line.py | 71 ++ quality_control/models/quality_control.py | 638 ------------- quality_control/security/ir.model.access.csv | 28 +- .../security/quality_control_security.xml | 27 +- quality_control/static/description/icon.png | Bin 0 -> 7121 bytes quality_control/static/description/icon.svg | 95 ++ .../views/product_category_view.xml | 25 + .../views/product_template_view.xml | 25 + quality_control/views/qc_inspection_view.xml | 245 +++++ quality_control/views/qc_menus.xml | 20 + .../views/qc_test_category_view.xml | 33 + quality_control/views/qc_test_view.xml | 127 +++ quality_control/views/qc_trigger_view.xml | 34 + .../views/quality_control_view.xml | 552 ----------- quality_control/wizard/__init__.py | 28 +- quality_control/wizard/qc_test_wizard.py | 77 +- .../wizard/qc_test_wizard_view.xml | 27 +- quality_control/workflow/test_workflow.xml | 90 -- 32 files changed, 2189 insertions(+), 2281 deletions(-) create mode 100644 quality_control/README.rst create mode 100644 quality_control/models/product_category.py create mode 100644 quality_control/models/product_product.py create mode 100644 quality_control/models/product_template.py create mode 100644 quality_control/models/qc_inspection.py create mode 100644 quality_control/models/qc_test.py create mode 100644 quality_control/models/qc_test_category.py create mode 100644 quality_control/models/qc_trigger.py create mode 100644 quality_control/models/qc_trigger_line.py delete mode 100644 quality_control/models/quality_control.py create mode 100644 quality_control/static/description/icon.png create mode 100644 quality_control/static/description/icon.svg create mode 100644 quality_control/views/product_category_view.xml create mode 100644 quality_control/views/product_template_view.xml create mode 100644 quality_control/views/qc_inspection_view.xml create mode 100644 quality_control/views/qc_menus.xml create mode 100644 quality_control/views/qc_test_category_view.xml create mode 100644 quality_control/views/qc_test_view.xml create mode 100644 quality_control/views/qc_trigger_view.xml delete mode 100644 quality_control/views/quality_control_view.xml delete mode 100644 quality_control/workflow/test_workflow.xml diff --git a/quality_control/README.rst b/quality_control/README.rst new file mode 100644 index 000000000..765875375 --- /dev/null +++ b/quality_control/README.rst @@ -0,0 +1,44 @@ +Quality control management for Odoo +=================================== + +This module provides a generic infrastructure for quality tests. The idea is +that it can be later reused for doing quality inspections on production lots +or any other area of the company. + +Definitions +----------- + +* Question: The thing to be checked. We have two types of questions: + + * Qualitative: The result is a description, color, yes, no... + + * Quantitative: The result must be within a range. + +* Possible values: The values chosen in qualitative questions. + +* Test: The set of questions to be used in inspections. + +* Once these values are set, we define the inspection. + +We have a *generic* test that can be applied to any model: shipments, +invoices or product, or a *test related*, making it specific to a particular +product and that eg apply whenever food is sold or when creating a batch. + +Once these parameters are set, we can just pass the test. We create a +new inspection, selecting a relationship with the model (sale, stock move...), +and pressing "Select test" button to choose the test to pass. Then, you must +fill the lines depending on the chosen test. + +The complete inspection workflow is: + + Draft -> Confirmed -> Success + | + | -> Failure (Pending approval) -> Approved + +Based on the nan_quality_control_* modules from NaN·tic. + +Contributors +------------ +* Pedro M. Baeza +* Oihane Crucelaegui +* Ana Juaristi diff --git a/quality_control/__init__.py b/quality_control/__init__.py index 2868583fc..7333c0440 100644 --- a/quality_control/__init__.py +++ b/quality_control/__init__.py @@ -1,31 +1,6 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## -# -# Copyright (c) 2010 NaN Projectes de Programari Lliure, S.L. -# All Rights Reserved. -# http://www.NaN-tic.com -# -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability of assessing all potential -# consequences resulting from its eventual inadequacies and bugs -# End users who are looking for a ready-to-use solution with commercial -# garantees and support are strongly adviced to contract a Free Software -# Service Company -# -# This program is Free Software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# +# For copyright and license notices, see __openerp__.py file in root directory ############################################################################## from . import models diff --git a/quality_control/__openerp__.py b/quality_control/__openerp__.py index 839cfac37..622f493c4 100644 --- a/quality_control/__openerp__.py +++ b/quality_control/__openerp__.py @@ -1,58 +1,52 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Copyright (c) 2010 NaN Projectes de Programari Lliure, S.L. -# All Rights Reserved. -# http://www.NaN-tic.com +# Copyright (c) +# 2010 NaN Projectes de Programari Lliure, S.L. (http://www.NaN-tic.com) +# 2014 Serv. Tec. Avanzados - Pedro M. Baeza (http://www.serviciosbaeza.com) +# 2014 AvanzOsc (http://www.avanzosc.es) # -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability of assessing all potential -# consequences resulting from its eventual inadequacies and bugs -# End users who are looking for a ready-to-use solution with commercial -# garantees and support are strongly adviced to contract a Free Software -# Service Company +# 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 Free Software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# 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. # -# 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . # ############################################################################## { - "name": "Quality Control", - "version": "0.1", - "author": "NaN·tic", + "name": "Quality control", + "version": "1.0", + "author": "OdooMRP team", + "website": "http://www.odoomrp.com", "contributors": [ + "Pedro M. Baeza ", + "Ana Juaristi ", ], - "category": "Generic Modules/Others", - "summary": "Quality control", - "description": """ -This module provides a generic infrastructure for quality tests. The idea is -that it can be later be reused for doing quality tests in production lots but -also in any other areas a company may desire. - -Developed for Trod y Avia, S.L.""", + "category": "Quality control", "depends": [ - 'product' + 'product', ], "data": [ 'data/quality_control_data.xml', 'security/quality_control_security.xml', 'security/ir.model.access.csv', - 'workflow/test_workflow.xml', 'wizard/qc_test_wizard_view.xml', - 'views/quality_control_view.xml', + 'views/qc_menus.xml', + 'views/qc_inspection_view.xml', + 'views/qc_test_category_view.xml', + 'views/qc_test_view.xml', + 'views/qc_trigger_view.xml', + 'views/product_template_view.xml', + 'views/product_category_view.xml', ], "installable": True, } diff --git a/quality_control/data/quality_control_data.xml b/quality_control/data/quality_control_data.xml index 71ec8bd59..fec4f95a2 100644 --- a/quality_control/data/quality_control_data.xml +++ b/quality_control/data/quality_control_data.xml @@ -1,20 +1,26 @@ - - - + + Generic - + + Referenced - + - - Quality Control - - + + Quality inspection + qc.inspection + + + + Quality inspection + qc.inspection + QC- + 6 diff --git a/quality_control/i18n/es.po b/quality_control/i18n/es.po index ce6bcfa79..1117664a8 100644 --- a/quality_control/i18n/es.po +++ b/quality_control/i18n/es.po @@ -6,264 +6,271 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 8.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-11-06 08:16+0000\n" -"PO-Revision-Date: 2014-11-06 09:17+0100\n" -"Last-Translator: Alfredo \n" +"POT-Creation-Date: 2014-12-10 22:13+0000\n" +"PO-Revision-Date: 2014-12-10 22:13+0000\n" +"Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" +"Content-Transfer-Encoding: \n" "Plural-Forms: \n" #. module: quality_control -#: view:qc.test.set.template.wizard:quality_control.view_qc_test_set_template_wizard_form -msgid "Accept" -msgstr "Aceptado" +#: model:ir.model,name:quality_control.model_qc_trigger_line +#: model:ir.model,name:quality_control.model_qc_trigger_product_category_line +#: model:ir.model,name:quality_control.model_qc_trigger_product_line +#: model:ir.model,name:quality_control.model_qc_trigger_product_template_line +msgid "Abstract line for defining triggers" +msgstr "Línea abstracta para definir disparadores" #. module: quality_control -#: field:qc.posible.value,active:0 -#: field:qc.proof,active:0 -#: field:qc.proof.method,active:0 -#: field:qc.test.template,active:0 -#: field:qc.test.template.category,active:0 -#: field:qc.test.template.trigger,active:0 +#: view:qc.inspection.set.test:quality_control.view_qc_test_set_test_form +msgid "Accept" +msgstr "Aceptar" + +#. module: quality_control +#: field:qc.test,active:0 +#: field:qc.test.category,active:0 +#: field:qc.trigger,active:0 msgid "Active" msgstr "Activo" #. module: quality_control -#: field:qc.test.line,valid_value_ids:0 -#: field:qc.test.template.line,valid_value_ids:0 +#: field:qc.inspection.line,possible_ql_values:0 +#: view:qc.test.question:quality_control.qc_test_question_form_view msgid "Answers" msgstr "Respuestas" #. module: quality_control -#: view:qc.test:quality_control.qc_test_form_view +#: view:qc.inspection:quality_control.qc_inspection_form_view msgid "Approve" -msgstr "Aprobado" +msgstr "Aprobar" #. module: quality_control -#: view:qc.test:quality_control.qc_test_form_view -#: view:qc.test.set.template.wizard:quality_control.view_qc_test_set_template_wizard_form +#: field:qc.inspection,auto_generated:0 +#: view:qc.inspection:quality_control.qc_inspection_search_view +msgid "Auto-generated" +msgstr "Auto-generada" + +#. module: quality_control +#: view:qc.inspection:quality_control.qc_inspection_form_view +#: view:qc.inspection.set.test:quality_control.view_qc_test_set_test_form msgid "Cancel" msgstr "Cancelar" #. module: quality_control -#: selection:qc.test,state:0 -msgid "Canceled" -msgstr "Cancelado" +#: selection:qc.inspection,state:0 +msgid "Cancelled" +msgstr "" #. module: quality_control -#: field:qc.test.template,category_id:0 +#: field:qc.test,category:0 msgid "Category" msgstr "Categoría" #. module: quality_control -#: field:qc.test.template.category,name:0 -msgid "Category Name" -msgstr "Descripción categoría" +#: field:qc.inspection,company_id:0 +#: field:qc.test,company_id:0 +#: field:qc.trigger,company_id:0 +msgid "Company" +msgstr "Compañía" #. module: quality_control -#: view:qc.test.line:quality_control.qc_test_line_form_view -msgid "Check Values" -msgstr "Comprobar valores" - -#. module: quality_control -#: view:qc.test.template.category:quality_control.qc_test_template_category_form_view -#: field:qc.test.template.category,child_ids:0 -msgid "Child Categories" -msgstr "Categorías hija" - -#. module: quality_control -#: field:qc.proof,ref:0 -msgid "Code" -msgstr "Referencia" - -#. module: quality_control -#: model:ir.ui.menu,name:quality_control.qc_menu_config -msgid "Configuration" -msgstr "Configuración" - -#. module: quality_control -#: view:qc.test:quality_control.qc_test_form_view +#: view:qc.inspection:quality_control.qc_inspection_form_view msgid "Confirm" msgstr "Confirmar" #. module: quality_control -#: field:qc.posible.value,ok:0 -msgid "Correct answer" -msgstr "Respuesta correcta" +#: view:qc.inspection:quality_control.qc_inspection_search_view +#: view:qc.inspection.line:quality_control.qc_inspection_line_search_view +msgid "Correct" +msgstr "Correcta" #. module: quality_control -#: field:qc.posible.value,create_uid:0 -#: field:qc.proof,create_uid:0 -#: field:qc.proof.method,create_uid:0 -#: field:qc.proof.synonym,create_uid:0 +#: field:qc.test.question.value,ok:0 +msgid "Correct answer?" +msgstr "¿Respuesta correcta?" + +#. module: quality_control +#: field:qc.inspection,create_uid:0 +#: field:qc.inspection.line,create_uid:0 +#: field:qc.inspection.set.test,create_uid:0 #: field:qc.test,create_uid:0 -#: field:qc.test.line,create_uid:0 -#: field:qc.test.set.template.wizard,create_uid:0 -#: field:qc.test.template,create_uid:0 -#: field:qc.test.template.category,create_uid:0 -#: field:qc.test.template.line,create_uid:0 -#: field:qc.test.template.trigger,create_uid:0 +#: field:qc.test.category,create_uid:0 +#: field:qc.test.question,create_uid:0 +#: field:qc.test.question.value,create_uid:0 +#: field:qc.trigger,create_uid:0 +#: field:qc.trigger.product_category_line,create_uid:0 +#: field:qc.trigger.product_line,create_uid:0 +#: field:qc.trigger.product_template_line,create_uid:0 msgid "Created by" msgstr "Creado por" #. module: quality_control -#: field:qc.posible.value,create_date:0 -#: field:qc.proof,create_date:0 -#: field:qc.proof.method,create_date:0 -#: field:qc.proof.synonym,create_date:0 +#: field:qc.inspection,create_date:0 +#: field:qc.inspection.line,create_date:0 +#: field:qc.inspection.set.test,create_date:0 #: field:qc.test,create_date:0 -#: field:qc.test.line,create_date:0 -#: field:qc.test.set.template.wizard,create_date:0 -#: field:qc.test.template,create_date:0 -#: field:qc.test.template.category,create_date:0 -#: field:qc.test.template.line,create_date:0 -#: field:qc.test.template.trigger,create_date:0 +#: field:qc.test.category,create_date:0 +#: field:qc.test.question,create_date:0 +#: field:qc.test.question.value,create_date:0 +#: field:qc.trigger,create_date:0 +#: field:qc.trigger.product_category_line,create_date:0 +#: field:qc.trigger.product_line,create_date:0 +#: field:qc.trigger.product_template_line,create_date:0 msgid "Created on" -msgstr "Creado el" +msgstr "Creado en" #. module: quality_control -#: field:qc.test,name:0 +#: field:qc.inspection,date:0 msgid "Date" msgstr "Fecha" #. module: quality_control -#: help:qc.test,message_last_post:0 +#: help:qc.inspection,message_last_post:0 msgid "Date of the last message posted on the record." -msgstr "Fecha del último mensaje publicado en el registro." +msgstr "Fecha del último mensaje publicado en el registro" #. module: quality_control -#: view:qc.test:quality_control.qc_test_form_view -#: selection:qc.test,state:0 +#: view:qc.inspection:quality_control.qc_inspection_form_view +#: selection:qc.inspection,state:0 msgid "Draft" msgstr "Borrador" #. module: quality_control -#: view:qc.test:quality_control.qc_test_search_view -#: field:qc.test,enabled:0 -msgid "Enabled" -msgstr "Habilitado" +#: model:ir.model,name:quality_control.model_qc_inspection +msgid "Email Thread" +msgstr "Inspeción creada" #. module: quality_control -#: code:addons/quality_control/models/quality_control.py:227 -#: constraint:qc.test.template.category:0 +#: code:addons/quality_control/models/qc_test_category.py:35 #, python-format msgid "Error ! You can not create recursive categories." -msgstr "Error ! No puede crear categorías recursivas." +msgstr "Error. No puede crear categorías recursivas." #. module: quality_control -#: view:qc.test:quality_control.qc_test_form_view -#: field:qc.test,test_external_note:0 -msgid "External Note" -msgstr "Nota externa" +#: view:qc.inspection:quality_control.qc_inspection_form_view +#: field:qc.inspection,external_notes:0 +msgid "External notes" +msgstr "Notas externas" #. module: quality_control -#: field:qc.test.template,fill_correct_values:0 -msgid "Fill With Correct Values" -msgstr "Pre-rellenar con valores correctos" - -#. module: quality_control -#: field:qc.test,message_follower_ids:0 +#: field:qc.inspection,message_follower_ids:0 msgid "Followers" msgstr "Seguidores" #. module: quality_control -#: field:qc.test.template.category,complete_name:0 -msgid "Full Name" -msgstr "Descripción completa" - -#. module: quality_control -#: selection:qc.test.template,type:0 -#: model:qc.test.template.category,name:quality_control.qc_test_template_category_generic +#: selection:qc.test,type:0 +#: model:qc.test.category,name:quality_control.qc_test_template_category_generic msgid "Generic" msgstr "Genérico" #. module: quality_control -#: view:qc.test:quality_control.qc_test_search_view -msgid "Group By..." -msgstr "Agrupar Por..." +#: view:qc.inspection:quality_control.qc_inspection_search_view +#: view:qc.inspection.line:quality_control.qc_inspection_line_search_view +msgid "Group by..." +msgstr "Agrupar por..." #. module: quality_control -#: help:qc.test,message_summary:0 +#: help:qc.inspection,message_summary:0 msgid "Holds the Chatter summary (number of messages, ...). This summary is directly in html format in order to be inserted in kanban views." -msgstr "Contiene el resumen del chater (número de mensajes, ...). Este resumen viene directamente en formato HTML para poder ser insertado en vistas kanban." +msgstr "Contiene el resumen del chatter (nº de mensajes, ...). Este resumen está directamente en formato html para ser insertado en vistas kanban." #. module: quality_control -#: field:qc.posible.value,id:0 -#: field:qc.proof,id:0 -#: field:qc.proof.method,id:0 -#: field:qc.proof.synonym,id:0 -#: field:qc.test,id:0 -#: field:qc.test.line,id:0 -#: field:qc.test.set.template.wizard,id:0 -#: field:qc.test.template,id:0 -#: field:qc.test.template.category,id:0 -#: field:qc.test.template.line,id:0 -#: field:qc.test.template.trigger,id:0 -msgid "ID" -msgstr "ID" +#: help:qc.inspection,auto_generated:0 +msgid "If an inspection is auto-generated, it can be cancelled nor removed" +msgstr "Si una inspección es auto-generada, no se podrá cancelar ni eliminar" #. module: quality_control -#: help:qc.test,enabled:0 -msgid "If a quality control test is not enabled it means it can not be moved from \"Quality Success\" or \"Quality Failed\" state." -msgstr "Si una prueba de control de calidad no está activa significa que no se puede mover desde el estado \"Calidad Correcta\" or \"Calidad Errónea\"." - -#. module: quality_control -#: help:qc.test,message_unread:0 +#: help:qc.inspection,message_unread:0 msgid "If checked new messages require your attention." -msgstr "Si se marca nuevos mensajes requieren su atención." +msgstr "Si está marcado, hay nuevos mensajes que requieren su atención." #. module: quality_control -#: view:qc.test:quality_control.qc_test_form_view -#: field:qc.test,test_internal_note:0 -msgid "Internal Note" -msgstr "Nota interna" +#: view:qc.inspection:quality_control.qc_inspection_search_view +#: view:qc.inspection.line:quality_control.qc_inspection_line_search_view +msgid "Incorrect" +msgstr "Incorrecta" #. module: quality_control -#: field:qc.test,message_is_follower:0 +#: view:qc.inspection:quality_control.qc_inspection_form_view +#: view:qc.inspection.line:quality_control.qc_inspection_line_search_view +#: field:qc.inspection.line,inspection_id:0 +msgid "Inspection" +msgstr "Inspección" + +#. module: quality_control +#: model:ir.actions.act_window,name:quality_control.action_qc_inspection_line +#: model:ir.ui.menu,name:quality_control.qc_inspection_lines_menu +#: view:qc.inspection:quality_control.qc_inspection_form_view +#: field:qc.inspection,inspection_lines:0 +#: view:qc.inspection.line:quality_control.qc_inspection_line_tree_view +msgid "Inspection lines" +msgstr "Líneas de inspección" + +#. module: quality_control +#: field:qc.inspection,name:0 +msgid "Inspection number" +msgstr "Nº de inspección" + +#. module: quality_control +#: model:ir.actions.act_window,name:quality_control.action_qc_inspection +#: model:ir.ui.menu,name:quality_control.qc_inspection_menu +#: model:ir.ui.menu,name:quality_control.qc_inspection_menu_parent +#: view:qc.inspection:quality_control.qc_inspection_tree_view +msgid "Inspections" +msgstr "Inspecciones" + +#. module: quality_control +#: view:qc.inspection:quality_control.qc_inspection_form_view +#: field:qc.inspection,internal_notes:0 +msgid "Internal notes" +msgstr "Notas internas" + +#. module: quality_control +#: view:product.template:quality_control.product_template_qc_form_view +msgid "Inventory" +msgstr "Inventario" + +#. module: quality_control +#: field:qc.inspection,message_is_follower:0 msgid "Is a Follower" msgstr "Es un seguidor" #. module: quality_control -#: field:qc.test,message_last_post:0 +#: field:qc.inspection,message_last_post:0 msgid "Last Message Date" -msgstr "Última fecha mensaje" +msgstr "Fecha del último mensaje" #. module: quality_control -#: field:qc.posible.value,write_uid:0 -#: field:qc.proof,write_uid:0 -#: field:qc.proof.method,write_uid:0 -#: field:qc.proof.synonym,write_uid:0 +#: field:qc.inspection,write_uid:0 +#: field:qc.inspection.line,write_uid:0 +#: field:qc.inspection.set.test,write_uid:0 #: field:qc.test,write_uid:0 -#: field:qc.test.line,write_uid:0 -#: field:qc.test.set.template.wizard,write_uid:0 -#: field:qc.test.template,write_uid:0 -#: field:qc.test.template.category,write_uid:0 -#: field:qc.test.template.line,write_uid:0 -#: field:qc.test.template.trigger,write_uid:0 +#: field:qc.test.category,write_uid:0 +#: field:qc.test.question,write_uid:0 +#: field:qc.test.question.value,write_uid:0 +#: field:qc.trigger,write_uid:0 +#: field:qc.trigger.product_category_line,write_uid:0 +#: field:qc.trigger.product_line,write_uid:0 +#: field:qc.trigger.product_template_line,write_uid:0 msgid "Last Updated by" msgstr "Última actualización por" #. module: quality_control -#: field:qc.posible.value,write_date:0 -#: field:qc.proof,write_date:0 -#: field:qc.proof.method,write_date:0 -#: field:qc.proof.synonym,write_date:0 +#: field:qc.inspection,write_date:0 +#: field:qc.inspection.line,write_date:0 +#: field:qc.inspection.set.test,write_date:0 #: field:qc.test,write_date:0 -#: field:qc.test.line,write_date:0 -#: field:qc.test.set.template.wizard,write_date:0 -#: field:qc.test.template,write_date:0 -#: field:qc.test.template.category,write_date:0 -#: field:qc.test.template.line,write_date:0 -#: field:qc.test.template.trigger,write_date:0 +#: field:qc.test.category,write_date:0 +#: field:qc.test.question,write_date:0 +#: field:qc.test.question.value,write_date:0 +#: field:qc.trigger,write_date:0 +#: field:qc.trigger.product_category_line,write_date:0 +#: field:qc.trigger.product_line,write_date:0 +#: field:qc.trigger.product_template_line,write_date:0 msgid "Last Updated on" -msgstr "Última actualización el" - -#. module: quality_control -#: field:qc.test.template,test_template_line_ids:0 -msgid "Lines" -msgstr "Líneas" +msgstr "Última actualización en" #. module: quality_control #: model:res.groups,name:quality_control.group_quality_control_manager @@ -271,393 +278,378 @@ msgid "Manager" msgstr "Responsable" #. module: quality_control -#: field:qc.test.line,max_value:0 -#: field:qc.test.template.line,max_value:0 +#: view:qc.inspection:quality_control.qc_inspection_form_view +msgid "Mark todo" +msgstr "Marcar para hacer" + +#. module: quality_control +#: field:qc.inspection.line,max_value:0 +#: field:qc.test.question,max_value:0 msgid "Max" -msgstr "Max" +msgstr "Máximo" #. module: quality_control -#: help:qc.test.line,max_value:0 -msgid "Maximum valid value if it is a quantitative proof." -msgstr "El valor máximo válido si se trata de una prueba cuantitativa." +#: help:qc.inspection.line,max_value:0 +msgid "Maximum valid value if it's a quantitative question." +msgstr "Máximo valor válido si es una pregunta cuantitativa." #. module: quality_control -#: field:qc.test,message_ids:0 +#: field:qc.inspection,message_ids:0 msgid "Messages" msgstr "Mensajes" #. module: quality_control -#: help:qc.test,message_ids:0 +#: help:qc.inspection,message_ids:0 msgid "Messages and communication history" -msgstr "Mensajes e historial de la comunicación" +msgstr "Mensajes e historial de comunicación" #. module: quality_control -#: model:ir.model,name:quality_control.model_qc_proof_method -#: model:ir.ui.menu,name:quality_control.qc_proof_method_menu -#: field:qc.test.line,method_id:0 -#: field:qc.test.template.line,method_id:0 -msgid "Method" -msgstr "Método" - -#. module: quality_control -#: model:ir.actions.act_window,name:quality_control.action_qc_proof_method -msgid "Methods" -msgstr "Métodos" - -#. module: quality_control -#: field:qc.test.line,min_value:0 -#: field:qc.test.template.line,min_value:0 +#: field:qc.inspection.line,min_value:0 +#: field:qc.test.question,min_value:0 msgid "Min" -msgstr "Min" +msgstr "Mínimo" #. module: quality_control -#: help:qc.test.line,min_value:0 -msgid "Minimum valid value if it is a quantitative proof." -msgstr "Valor válido mínimo si se trata de una prueba cuantitativa." +#: help:qc.inspection.line,min_value:0 +msgid "Minimum valid value if it's a quantitative question." +msgstr "Mínimo valor válido si es una pregunta cuantitativa." #. module: quality_control -#: field:qc.posible.value,name:0 -#: field:qc.proof,name:0 -#: field:qc.proof.method,name:0 -#: field:qc.proof.synonym,name:0 -#: field:qc.test.template,name:0 -#: field:qc.test.template.trigger,name:0 +#: code:addons/quality_control/models/qc_test.py:66 +#, python-format +msgid "Minimum value can't be higher than maximum value." +msgstr "El valor mínimo no puede ser más alto que el valor máximo." + +#. module: quality_control +#: field:qc.test,name:0 +#: field:qc.test.category,name:0 +#: field:qc.test.question,name:0 +#: field:qc.test.question.value,name:0 +#: field:qc.trigger,name:0 msgid "Name" -msgstr "Descripción" +msgstr "Nombre" #. module: quality_control -#: view:qc.test:quality_control.qc_test_form_view -#: field:qc.test.line,notes:0 -#: field:qc.test.template.line,notes:0 +#: view:qc.inspection:quality_control.qc_inspection_form_view +#: field:qc.inspection.line,notes:0 +#: field:qc.test.question,notes:0 msgid "Notes" msgstr "Notas" #. module: quality_control -#: field:qc.test.template.category,parent_id:0 -msgid "Parent Category" +#: field:qc.test.category,parent_id:0 +msgid "Parent category" msgstr "Categoría padre" #. module: quality_control -#: view:qc.posible.value:quality_control.qc_posible_value_tree_view -msgid "Posible Value" -msgstr "Valor posible" +#: model:ir.model,name:quality_control.model_qc_test_question_value +msgid "Possible values of qualitative questions." +msgstr "Posibles valores de preguntas cualitativas." #. module: quality_control -#: model:ir.actions.act_window,name:quality_control.action_qc_posible_value -#: model:ir.ui.menu,name:quality_control.qc_proof_posible_value_menu -#: view:qc.proof:quality_control.qc_proof_form_view -#: field:qc.proof,value_ids:0 -msgid "Posible Values" -msgstr "Valores posibles" +#: field:qc.test,fill_correct_values:0 +msgid "Pre-fill with correct values" +msgstr "Pre-rellenar con valores correctos" #. module: quality_control -#: model:ir.actions.act_window,name:quality_control.action_qc_proof -#: model:ir.ui.menu,name:quality_control.qc_proof_menu -#: view:qc.proof:quality_control.qc_proof_form_view -#: view:qc.proof:quality_control.qc_proof_tree_view -#: field:qc.proof.synonym,proof_id:0 -msgid "Proof" -msgstr "Pregunta" +#: view:qc.inspection:quality_control.qc_inspection_search_view +#: field:qc.inspection,product:0 +#: view:qc.inspection.line:quality_control.qc_inspection_line_search_view +#: field:qc.inspection.line,product:0 +#: field:qc.trigger.product_line,product:0 +msgid "Product" +msgstr "Producto" #. module: quality_control -#: view:qc.proof.method:quality_control.qc_method_form_view -msgid "Proof Method" -msgstr "Método pregunta" +#: model:ir.model,name:quality_control.model_product_category +#: field:qc.inspection.line,test_uom_category:0 +msgid "Product Category" +msgstr "Categoría de producto" #. module: quality_control -#: view:qc.posible.value:quality_control.qc_posible_value_form_view -msgid "Proof Posible Value" -msgstr "Posible respuesta a la pregunta" +#: help:qc.inspection,product:0 +#: help:qc.inspection.line,product:0 +msgid "Product associated with the inspection" +msgstr "Producto asociado con la inspección" #. module: quality_control -#: view:qc.proof.synonym:quality_control.qc_proof_synonym_form_view -msgid "Proof Synonym" -msgstr "Sinónimo pregunta" +#: field:qc.trigger.product_category_line,product_category:0 +msgid "Product category" +msgstr "Categoría de producto" #. module: quality_control -#: field:qc.test.line,proof_type:0 -msgid "Proof Type" -msgstr "Tipo pregunta" +#: field:qc.trigger.product_template_line,product_template:0 +msgid "Product template" +msgstr "Plantilla de producto" #. module: quality_control -#: field:qc.test.line,actual_value_ql:0 -msgid "Ql.Value" -msgstr "Ql.Valor" - -#. module: quality_control -#: field:qc.test.line,actual_value_qt:0 -msgid "Qt.Value" -msgstr "Qt.Valor" - -#. module: quality_control -#: selection:qc.proof,type:0 -#: selection:qc.test.line,proof_type:0 -#: selection:qc.test.template.line,type:0 +#: selection:qc.inspection.line,question_type:0 +#: selection:qc.test.question,type:0 msgid "Qualitative" msgstr "Cualitativa" +#. module: quality_control +#: field:qc.inspection.line,qualitative_value:0 +msgid "Qualitative value" +msgstr "Valor cualitativo" + +#. module: quality_control +#: field:qc.test.question,ql_values:0 +msgid "Qualitative values" +msgstr "Valores cualitativos" + #. module: quality_control #: model:ir.module.category,name:quality_control.module_category_quality_control #: model:ir.ui.menu,name:quality_control.qc_menu -msgid "Quality Control" +#: view:product.category:quality_control.product_category_qc_form_view +#: view:product.template:quality_control.product_template_qc_form_view +msgid "Quality control" msgstr "Control de calidad" #. module: quality_control -#: selection:qc.test,state:0 -msgid "Quality Failed" -msgstr "Calidad errónea" +#: model:ir.model,name:quality_control.model_qc_test_question +msgid "Quality control question" +msgstr "Pregunta del control de calidad" #. module: quality_control -#: selection:qc.test,state:0 -msgid "Quality Success" -msgstr "Calidad correcta" +#: model:ir.model,name:quality_control.model_qc_test +msgid "Quality control test" +msgstr "Test del control de calidad" #. module: quality_control -#: selection:qc.proof,type:0 -#: selection:qc.test.line,proof_type:0 -#: selection:qc.test.template.line,type:0 +#: model:ir.model,name:quality_control.model_qc_trigger +#: view:qc.trigger:quality_control.qc_trigger_form_view +msgid "Quality control trigger" +msgstr "Disparador del control de calidad" + +#. module: quality_control +#: view:product.category:quality_control.product_category_qc_form_view +#: field:product.category,qc_triggers:0 +#: field:product.product,qc_triggers:0 +#: view:product.template:quality_control.product_template_qc_form_view +#: field:product.template,qc_triggers:0 +#: view:qc.trigger:quality_control.qc_trigger_tree_view +msgid "Quality control triggers" +msgstr "Disparadores del control de calidad" + +#. module: quality_control +#: selection:qc.inspection,state:0 +msgid "Quality failed" +msgstr "Calidad fallida" + +#. module: quality_control +#: selection:qc.inspection,state:0 +msgid "Quality success" +msgstr "Calidad satisfactoria" + +#. module: quality_control +#: selection:qc.inspection.line,question_type:0 +#: selection:qc.test.question,type:0 msgid "Quantitative" msgstr "Cuantitativa" #. module: quality_control -#: field:qc.test.line,proof_id:0 -#: field:qc.test.template.line,proof_id:0 +#: field:qc.inspection.line,quantitative_value:0 +msgid "Quantitative value" +msgstr "Valor cuantitativo" + +#. module: quality_control +#: view:qc.inspection.line:quality_control.qc_inspection_line_search_view +#: field:qc.inspection.line,name:0 msgid "Question" msgstr "Pregunta" #. module: quality_control -#: view:qc.test:quality_control.qc_test_search_view -#: field:qc.test,object_id:0 +#: field:qc.inspection.line,question_type:0 +msgid "Question type" +msgstr "Tipo de pregunta" + +#. module: quality_control +#: view:qc.test.question:quality_control.qc_test_question_form_view +msgid "Question value" +msgstr "Valor de la pregunta" + +#. module: quality_control +#: view:qc.inspection:quality_control.qc_inspection_form_view +#: view:qc.test:quality_control.qc_test_form_view +#: field:qc.test,test_lines:0 +msgid "Questions" +msgstr "Preguntas" + +#. module: quality_control +#: selection:qc.inspection,state:0 +msgid "Ready" +msgstr "Lista" + +#. module: quality_control +#: view:qc.inspection:quality_control.qc_inspection_search_view +#: field:qc.inspection,object_id:0 msgid "Reference" msgstr "Referencia" #. module: quality_control -#: field:qc.test.template,object_id:0 -msgid "Reference Object" -msgstr "Referencia Objeto" +#: field:qc.test,object_id:0 +msgid "Reference object" +msgstr "Objeto referencia" #. module: quality_control -#: model:qc.test.template.category,name:quality_control.qc_test_template_category_referenced +#: model:qc.test.category,name:quality_control.qc_test_template_category_referenced msgid "Referenced" msgstr "Referenciado" #. module: quality_control -#: selection:qc.test.template,type:0 +#: selection:qc.test,type:0 msgid "Related" -msgstr "Relacionado" +msgstr "Relativo" #. module: quality_control -#: view:qc.test:quality_control.qc_test_search_view -msgid "Search Test" -msgstr "Buscar test" +#: view:qc.inspection:quality_control.qc_inspection_search_view +msgid "Search inspection" +msgstr "Buscar inspección" #. module: quality_control -#: model:ir.actions.act_window,name:quality_control.action_qc_test_set_template_wizard_form -#: view:qc.test.set.template.wizard:quality_control.view_qc_test_set_template_wizard_form -msgid "Select Test Template" -msgstr "Seleccione la plantilla de test" +#: view:qc.inspection.line:quality_control.qc_inspection_line_search_view +msgid "Search inspection line" +msgstr "Buscar línea de inspección" #. module: quality_control -#: field:qc.test.template.line,sequence:0 +#: model:ir.actions.act_window,name:quality_control.action_qc_inspection_set_test +#: view:qc.inspection.set.test:quality_control.view_qc_test_set_test_form +msgid "Select test" +msgstr "Seleccionar test" + +#. module: quality_control +#: field:qc.test.question,sequence:0 msgid "Sequence" msgstr "Secuencia" #. module: quality_control -#: view:qc.test:quality_control.qc_test_search_view -#: field:qc.test,state:0 +#: view:qc.inspection:quality_control.qc_inspection_form_view +msgid "Set test" +msgstr "Establecer test" + +#. module: quality_control +#: view:qc.inspection:quality_control.qc_inspection_search_view +#: field:qc.inspection,state:0 msgid "State" msgstr "Estado" #. module: quality_control -#: view:qc.test:quality_control.qc_test_search_view -#: field:qc.test,success:0 +#: view:qc.inspection:quality_control.qc_inspection_search_view +#: field:qc.inspection,success:0 +#: view:qc.inspection.line:quality_control.qc_inspection_line_search_view msgid "Success" -msgstr "Éxito" +msgstr "Correcta" #. module: quality_control -#: field:qc.test.line,success:0 +#: field:qc.inspection.line,success:0 msgid "Success?" -msgstr "¿Correcto?" +msgstr "Correcta?" #. module: quality_control -#: field:qc.test,message_summary:0 +#: field:qc.inspection,message_summary:0 msgid "Summary" msgstr "Resumen" #. module: quality_control -#: model:ir.actions.act_window,name:quality_control.action_proof_synonym -msgid "Synonym" -msgstr "Sinónimo" - -#. module: quality_control -#: model:ir.ui.menu,name:quality_control.qc_proof_synonyms_menu -#: view:qc.proof:quality_control.qc_proof_form_view -#: field:qc.proof,synonym_ids:0 -#: field:qc.proof,synonyms:0 -msgid "Synonyms" -msgstr "Sinónimos" - -#. module: quality_control +#: view:qc.inspection:quality_control.qc_inspection_search_view +#: field:qc.inspection,test:0 #: view:qc.test:quality_control.qc_test_form_view -#: view:qc.test:quality_control.qc_test_search_view -#: field:qc.test.set.template.wizard,test_template_id:0 -msgid "Template" -msgstr "Plantilla" - -#. module: quality_control -#: model:ir.actions.act_window,name:quality_control.action_qc_test_template_trigger -#: model:ir.ui.menu,name:quality_control.qc_test_template_trigger_menu -#: view:qc.test.template.trigger:quality_control.qc_test_template_trigger_form_view -#: view:qc.test.template.trigger:quality_control.qc_test_template_trigger_tree_view -msgid "Template Trigger" -msgstr "Disparador plantilla" - -#. module: quality_control -#: model:ir.actions.act_window,name:quality_control.action_qc_new_test -#: view:qc.test:quality_control.qc_test_form_view -#: view:qc.test:quality_control.qc_test_tree_view -#: field:qc.test,test_template_id:0 -#: field:qc.test.line,test_id:0 +#: field:qc.test.question,test:0 +#: field:qc.inspection.set.test,test:0 +#: field:qc.trigger.line,test:0 +#: field:qc.trigger.product_category_line,test:0 +#: field:qc.trigger.product_line,test:0 +#: field:qc.trigger.product_template_line,test:0 msgid "Test" msgstr "Test" #. module: quality_control -#: model:ir.actions.act_window,name:quality_control.action_qc_test_line -#: view:qc.test.line:quality_control.qc_test_line_form_view -#: view:qc.test.line:quality_control.qc_test_line_tree_view -msgid "Test Line" -msgstr "Línea de test" +#: field:qc.inspection.line,test_uom_id:0 +msgid "Test UoM" +msgstr "UdM test" #. module: quality_control -#: model:ir.ui.menu,name:quality_control.qc_test_lines_menu -#: field:qc.test,test_line_ids:0 -msgid "Test Lines" -msgstr "Líneas de test" +#: model:ir.actions.act_window,name:quality_control.action_qc_test_category +#: model:ir.ui.menu,name:quality_control.qc_test_category_menu +#: view:qc.test.category:quality_control.qc_test_category_tree_view +msgid "Test categories" +msgstr "Categorías de test" #. module: quality_control -#: view:qc.proof.method:quality_control.qc_proof_method_tree_view -msgid "Test Method" -msgstr "Test método" +#: model:ir.model,name:quality_control.model_qc_test_category +msgid "Test category" +msgstr "Categoría de test" #. module: quality_control -#: view:qc.test:quality_control.qc_test_form_view -msgid "Test Name" -msgstr "Descripción test" +#: field:qc.inspection.line,test_line:0 +#: view:qc.test.question:quality_control.qc_test_question_form_view +#: field:qc.test.question.value,test_line:0 +msgid "Test question" +msgstr "Pregunta del test" #. module: quality_control -#: view:qc.test.line:quality_control.qc_test_line_form_view -msgid "Test Result" -msgstr "Resultado test" - -#. module: quality_control -#: view:qc.proof.synonym:quality_control.qc_test_synonym_tree_view -msgid "Test Synonym" -msgstr "Sinónimo test" - -#. module: quality_control -#: model:ir.actions.act_window,name:quality_control.action_qc_test_template -#: model:ir.model,name:quality_control.model_qc_test_template -#: model:ir.ui.menu,name:quality_control.qc_test_template_menu -#: view:qc.test.template:quality_control.qc_test_template_form_view -#: view:qc.test.template:quality_control.qc_test_template_tree_view -#: field:qc.test.template.line,test_template_id:0 -msgid "Test Template" -msgstr "Plantilla de test" - -#. module: quality_control -#: model:ir.ui.menu,name:quality_control.qc_template_category_menu -msgid "Test Template Categories" -msgstr "Categorías de plantilla de test" - -#. module: quality_control -#: model:ir.actions.act_window,name:quality_control.action_qc_test_template_category -#: model:ir.model,name:quality_control.model_qc_test_template_category -#: view:qc.test.template.category:quality_control.qc_test_template_category_form_view -#: view:qc.test.template.category:quality_control.qc_test_template_category_tree_view -msgid "Test Template Category" -msgstr "Categoría de plantilla de test" - -#. module: quality_control -#: model:ir.actions.act_window,name:quality_control.action_qc_test_template_line -#: model:ir.model,name:quality_control.model_qc_test_template_line -#: field:qc.test.line,test_template_line_id:0 -#: view:qc.test.template.line:quality_control.qc_test_template_line_tree_view -msgid "Test Template Line" -msgstr "Línea de plantilla de test" - -#. module: quality_control -#: model:ir.ui.menu,name:quality_control.qc_test_template_line_menu -msgid "Test Template Lines" -msgstr "Líneas de plantilla de test" - -#. module: quality_control -#: model:ir.model,name:quality_control.model_qc_test_template_trigger -msgid "Test Template Trigger" -msgstr "Disparador plantilla de test" - -#. module: quality_control -#: model:ir.ui.menu,name:quality_control.qc_menu_config_templates -msgid "Test Templates" -msgstr "Plantillas de test" - -#. module: quality_control -#: view:qc.test.line:quality_control.qc_test_line_form_view -msgid "Test Values" -msgstr "Respuestas del test" - -#. module: quality_control -#: model:ir.ui.menu,name:quality_control.qc_menu_tests +#: model:ir.actions.act_window,name:quality_control.action_qc_test +#: model:ir.ui.menu,name:quality_control.qc_menu_test_parent #: model:ir.ui.menu,name:quality_control.qc_test_menu +#: view:qc.test:quality_control.qc_test_tree_view msgid "Tests" msgstr "Tests" #. module: quality_control -#: help:qc.test.template.category,active:0 -msgid "The active field allows you to hide the category without removing it." -msgstr "El campo activo le permite ocultar la categoría sin eliminarlo." +#: code:addons/quality_control/models/qc_test.py:56 +#, python-format +msgid "There isn't any value with OK marked. You have to mark at least one." +msgstr "No hay ningún valor con OK marcado. Debe marcar al menos uno." #. module: quality_control -#: help:qc.test,success:0 -msgid "This field will be active if all tests have succeeded." -msgstr "Este campo estará marcado si todas las pruebas han tenido éxito." +#: help:qc.test.category,active:0 +msgid "This field allows you to hide the category without removing it." +msgstr "Este campo le permite ocultar la categoría sin eliminarla." #. module: quality_control -#: field:qc.test.template,trig_on:0 +#: help:qc.inspection,success:0 +msgid "This field will be marked if all tests have been succeeded." +msgstr "Este campo se marcará si todos los tests han sido correctos." + +#. module: quality_control +#: field:qc.trigger.line,trigger:0 +#: field:qc.trigger.product_category_line,trigger:0 +#: field:qc.trigger.product_line,trigger:0 +#: field:qc.trigger.product_template_line,trigger:0 msgid "Trigger" msgstr "Disparador" #. module: quality_control -#: field:qc.proof,type:0 -#: field:qc.test.template,type:0 -#: field:qc.test.template.line,type:0 +#: field:qc.test,type:0 +#: field:qc.test.question,type:0 msgid "Type" msgstr "Tipo" #. module: quality_control -#: field:qc.test,message_unread:0 +#: field:qc.inspection,message_unread:0 msgid "Unread Messages" -msgstr "Mensajes no leidos." +msgstr "Mensajes sin leer" #. module: quality_control -#: help:qc.test.line,uom_id:0 -msgid "UoM for minimum and maximum values if it is a quantitative proof." -msgstr "UdM para los valores mínimo y máximo si se trata de una pregunta cuantitativa." - -#. module: quality_control -#: help:qc.test.line,test_uom_id:0 -msgid "UoM of the value of the result if it is a quantitative proof." -msgstr "UdM del valor del resultado, si se trata de una prueba cuantitativa." - -#. module: quality_control -#: field:qc.test.line,uom_id:0 -#: field:qc.test.template.line,uom_id:0 -msgid "Uom" +#: field:qc.inspection.line,uom_id:0 +msgid "UoM" msgstr "UdM" #. module: quality_control -#: field:qc.test.line,test_uom_id:0 -msgid "Uom Test" -msgstr "UdM Test" +#: help:qc.inspection.line,test_uom_id:0 +msgid "UoM for minimum and maximum values if it's a quantitative question." +msgstr "UdM de los valores mínimos y máximos si es una pregunta cuantitativa." + +#. module: quality_control +#: help:qc.inspection.line,uom_id:0 +msgid "UoM of the inspection value if it's a quantitative question." +msgstr "UdM del valor de inspección si es una pregunta cuantitativa." + +#. module: quality_control +#: field:qc.test.question,uom_id:0 +msgid "Uom" +msgstr "UdM" #. module: quality_control #: model:res.groups,name:quality_control.group_quality_control_user @@ -665,32 +657,57 @@ msgid "User" msgstr "Usuario" #. module: quality_control -#: help:qc.test.line,actual_value_ql:0 -msgid "Value of the result if it is a qualitative proof." -msgstr "Valor del resultado, si se trata de una pregunta cualitativa." +#: field:qc.inspection.line,valid_values:0 +msgid "Valid values" +msgstr "Valores válidos" #. module: quality_control -#: help:qc.test.line,actual_value_qt:0 -msgid "Value of the result if it is a quantitative proof." -msgstr "Valor del resultado, si se trata de una pregunta cuantitativa." +#: help:qc.inspection.line,qualitative_value:0 +msgid "Value of the result if it's a qualitative question." +msgstr "Valor del resultado si es una pregunta cualitativa." #. module: quality_control -#: selection:qc.test,state:0 -msgid "Waiting Supervisor Approval" -msgstr "Esperando aprobación del supervisor" +#: help:qc.inspection.line,quantitative_value:0 +msgid "Value of the result if it's a quantitative question." +msgstr "Valor del resultado si es una pregunta cuantitativa." #. module: quality_control -#: help:qc.posible.value,ok:0 +#: selection:qc.inspection,state:0 +msgid "Waiting supervisor approval" +msgstr "Esperando la aprobación del supervisor" + +#. module: quality_control +#: help:qc.test.question.value,ok:0 msgid "When this field is marked, the answer is considered correct." msgstr "Cuando este campo está marcado, la respuesta se considera correcta." #. module: quality_control -#: view:qc.test.template.line:quality_control.qc_test_template_line_form_view -msgid "proof Line" -msgstr "Línea pregunta" +#: code:addons/quality_control/models/qc_inspection.py:92 +#, python-format +msgid "You cannot remove an auto-generated inspection" +msgstr "No puede eliminar una inspección auto-generada." #. module: quality_control -#: view:qc.test:quality_control.qc_test_form_view -msgid "questions" -msgstr "Preguntas" +#: code:addons/quality_control/models/qc_inspection.py:95 +#, python-format +msgid "You cannot remove an inspection that it's not in draft state" +msgstr "No puede eliminar una inspección que no esté en estado borrador" + +#. module: quality_control +#: code:addons/quality_control/models/qc_inspection.py:108 +#, python-format +msgid "You must set the test to perform first." +msgstr "Debe establecer primero el test a realizar." + +#. module: quality_control +#: code:addons/quality_control/models/qc_inspection.py:123 +#, python-format +msgid "You should provide a unit of measure for qualitative questions." +msgstr "Debe proveer una unidad de medida para las preguntas cualitativas." + +#. module: quality_control +#: code:addons/quality_control/models/qc_inspection.py:118 +#, python-format +msgid "You should provide an answer for all quantitative questions." +msgstr "Debe proveer una respuesta para todas las preguntas cuantitativas." diff --git a/quality_control/i18n/quality_control.pot b/quality_control/i18n/quality_control.pot index cf37cd3da..44eb31853 100644 --- a/quality_control/i18n/quality_control.pot +++ b/quality_control/i18n/quality_control.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 8.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-11-06 08:15+0000\n" -"PO-Revision-Date: 2014-11-06 08:15+0000\n" +"POT-Creation-Date: 2014-12-10 22:13+0000\n" +"PO-Revision-Date: 2014-12-10 22:13+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -16,681 +16,724 @@ msgstr "" "Plural-Forms: \n" #. module: quality_control -#: view:qc.test.set.template.wizard:quality_control.view_qc_test_set_template_wizard_form +#: model:ir.model,name:quality_control.model_qc_trigger_line +#: model:ir.model,name:quality_control.model_qc_trigger_product_category_line +#: model:ir.model,name:quality_control.model_qc_trigger_product_line +#: model:ir.model,name:quality_control.model_qc_trigger_product_template_line +msgid "Abstract line for defining triggers" +msgstr "" + +#. module: quality_control +#: view:qc.inspection.set.test:quality_control.view_qc_test_set_test_form msgid "Accept" msgstr "" #. module: quality_control -#: field:qc.posible.value,active:0 -#: field:qc.proof,active:0 -#: field:qc.proof.method,active:0 -#: field:qc.test.template,active:0 -#: field:qc.test.template.category,active:0 -#: field:qc.test.template.trigger,active:0 +#: field:qc.test,active:0 +#: field:qc.test.category,active:0 +#: field:qc.trigger,active:0 msgid "Active" msgstr "" #. module: quality_control -#: field:qc.test.line,valid_value_ids:0 -#: field:qc.test.template.line,valid_value_ids:0 +#: field:qc.inspection.line,possible_ql_values:0 +#: view:qc.test.question:quality_control.qc_test_question_form_view msgid "Answers" msgstr "" #. module: quality_control -#: view:qc.test:quality_control.qc_test_form_view +#: view:qc.inspection:quality_control.qc_inspection_form_view msgid "Approve" msgstr "" #. module: quality_control -#: view:qc.test:quality_control.qc_test_form_view -#: view:qc.test.set.template.wizard:quality_control.view_qc_test_set_template_wizard_form +#: field:qc.inspection,auto_generated:0 +#: view:qc.inspection:quality_control.qc_inspection_search_view +msgid "Auto-generated" +msgstr "" + +#. module: quality_control +#: view:qc.inspection:quality_control.qc_inspection_form_view +#: view:qc.inspection.set.test:quality_control.view_qc_test_set_test_form msgid "Cancel" msgstr "" #. module: quality_control -#: selection:qc.test,state:0 -msgid "Canceled" +#: selection:qc.inspection,state:0 +msgid "Cancelled" msgstr "" #. module: quality_control -#: field:qc.test.template,category_id:0 +#: field:qc.test,category:0 msgid "Category" msgstr "" #. module: quality_control -#: field:qc.test.template.category,name:0 -msgid "Category Name" +#: field:qc.inspection,company_id:0 +#: field:qc.test,company_id:0 +#: field:qc.trigger,company_id:0 +msgid "Company" msgstr "" #. module: quality_control -#: view:qc.test.line:quality_control.qc_test_line_form_view -msgid "Check Values" -msgstr "" - -#. module: quality_control -#: view:qc.test.template.category:quality_control.qc_test_template_category_form_view -#: field:qc.test.template.category,child_ids:0 -msgid "Child Categories" -msgstr "" - -#. module: quality_control -#: field:qc.proof,ref:0 -msgid "Code" -msgstr "" - -#. module: quality_control -#: model:ir.ui.menu,name:quality_control.qc_menu_config -msgid "Configuration" -msgstr "" - -#. module: quality_control -#: view:qc.test:quality_control.qc_test_form_view +#: view:qc.inspection:quality_control.qc_inspection_form_view msgid "Confirm" msgstr "" #. module: quality_control -#: field:qc.posible.value,ok:0 -msgid "Correct answer" +#: view:qc.inspection:quality_control.qc_inspection_search_view +#: view:qc.inspection.line:quality_control.qc_inspection_line_search_view +msgid "Correct" msgstr "" #. module: quality_control -#: field:qc.posible.value,create_uid:0 -#: field:qc.proof,create_uid:0 -#: field:qc.proof.method,create_uid:0 -#: field:qc.proof.synonym,create_uid:0 +#: field:qc.test.question.value,ok:0 +msgid "Correct answer?" +msgstr "" + +#. module: quality_control +#: field:qc.inspection,create_uid:0 +#: field:qc.inspection.line,create_uid:0 +#: field:qc.inspection.set.test,create_uid:0 #: field:qc.test,create_uid:0 -#: field:qc.test.line,create_uid:0 -#: field:qc.test.set.template.wizard,create_uid:0 -#: field:qc.test.template,create_uid:0 -#: field:qc.test.template.category,create_uid:0 -#: field:qc.test.template.line,create_uid:0 -#: field:qc.test.template.trigger,create_uid:0 +#: field:qc.test.category,create_uid:0 +#: field:qc.test.question,create_uid:0 +#: field:qc.test.question.value,create_uid:0 +#: field:qc.trigger,create_uid:0 +#: field:qc.trigger.product_category_line,create_uid:0 +#: field:qc.trigger.product_line,create_uid:0 +#: field:qc.trigger.product_template_line,create_uid:0 msgid "Created by" msgstr "" #. module: quality_control -#: field:qc.posible.value,create_date:0 -#: field:qc.proof,create_date:0 -#: field:qc.proof.method,create_date:0 -#: field:qc.proof.synonym,create_date:0 +#: field:qc.inspection,create_date:0 +#: field:qc.inspection.line,create_date:0 +#: field:qc.inspection.set.test,create_date:0 #: field:qc.test,create_date:0 -#: field:qc.test.line,create_date:0 -#: field:qc.test.set.template.wizard,create_date:0 -#: field:qc.test.template,create_date:0 -#: field:qc.test.template.category,create_date:0 -#: field:qc.test.template.line,create_date:0 -#: field:qc.test.template.trigger,create_date:0 +#: field:qc.test.category,create_date:0 +#: field:qc.test.question,create_date:0 +#: field:qc.test.question.value,create_date:0 +#: field:qc.trigger,create_date:0 +#: field:qc.trigger.product_category_line,create_date:0 +#: field:qc.trigger.product_line,create_date:0 +#: field:qc.trigger.product_template_line,create_date:0 msgid "Created on" msgstr "" #. module: quality_control -#: field:qc.test,name:0 +#: field:qc.inspection,date:0 msgid "Date" msgstr "" #. module: quality_control -#: help:qc.test,message_last_post:0 +#: help:qc.inspection,message_last_post:0 msgid "Date of the last message posted on the record." msgstr "" #. module: quality_control -#: view:qc.test:quality_control.qc_test_form_view -#: selection:qc.test,state:0 +#: view:qc.inspection:quality_control.qc_inspection_form_view +#: selection:qc.inspection,state:0 msgid "Draft" msgstr "" #. module: quality_control -#: view:qc.test:quality_control.qc_test_search_view -#: field:qc.test,enabled:0 -msgid "Enabled" +#: model:ir.model,name:quality_control.model_qc_inspection +msgid "Email Thread" msgstr "" #. module: quality_control -#: code:addons/quality_control/models/quality_control.py:227 -#: constraint:qc.test.template.category:0 +#: code:addons/quality_control/models/qc_test_category.py:35 #, python-format msgid "Error ! You can not create recursive categories." msgstr "" #. module: quality_control -#: view:qc.test:quality_control.qc_test_form_view -#: field:qc.test,test_external_note:0 -msgid "External Note" +#: view:qc.inspection:quality_control.qc_inspection_form_view +#: field:qc.inspection,external_notes:0 +msgid "External notes" msgstr "" #. module: quality_control -#: field:qc.test.template,fill_correct_values:0 -msgid "Fill With Correct Values" -msgstr "" - -#. module: quality_control -#: field:qc.test,message_follower_ids:0 +#: field:qc.inspection,message_follower_ids:0 msgid "Followers" msgstr "" #. module: quality_control -#: field:qc.test.template.category,complete_name:0 -msgid "Full Name" -msgstr "" - -#. module: quality_control -#: selection:qc.test.template,type:0 -#: model:qc.test.template.category,name:quality_control.qc_test_template_category_generic +#: selection:qc.test,type:0 +#: model:qc.test.category,name:quality_control.qc_test_template_category_generic msgid "Generic" msgstr "" #. module: quality_control -#: view:qc.test:quality_control.qc_test_search_view -msgid "Group By..." +#: view:qc.inspection:quality_control.qc_inspection_search_view +#: view:qc.inspection.line:quality_control.qc_inspection_line_search_view +msgid "Group by..." msgstr "" #. module: quality_control -#: help:qc.test,message_summary:0 +#: help:qc.inspection,message_summary:0 msgid "Holds the Chatter summary (number of messages, ...). This summary is directly in html format in order to be inserted in kanban views." msgstr "" #. module: quality_control -#: field:qc.posible.value,id:0 -#: field:qc.proof,id:0 -#: field:qc.proof.method,id:0 -#: field:qc.proof.synonym,id:0 +#: field:qc.inspection,id:0 +#: field:qc.inspection.line,id:0 +#: field:qc.inspection.set.test,id:0 #: field:qc.test,id:0 -#: field:qc.test.line,id:0 -#: field:qc.test.set.template.wizard,id:0 -#: field:qc.test.template,id:0 -#: field:qc.test.template.category,id:0 -#: field:qc.test.template.line,id:0 -#: field:qc.test.template.trigger,id:0 +#: field:qc.test.category,id:0 +#: field:qc.test.question,id:0 +#: field:qc.test.question.value,id:0 +#: field:qc.trigger,id:0 +#: field:qc.trigger.line,id:0 +#: field:qc.trigger.product_category_line,id:0 +#: field:qc.trigger.product_line,id:0 +#: field:qc.trigger.product_template_line,id:0 msgid "ID" msgstr "" #. module: quality_control -#: help:qc.test,enabled:0 -msgid "If a quality control test is not enabled it means it can not be moved from \"Quality Success\" or \"Quality Failed\" state." +#: help:qc.inspection,auto_generated:0 +msgid "If an inspection is auto-generated, it can be cancelled nor removed" msgstr "" #. module: quality_control -#: help:qc.test,message_unread:0 +#: help:qc.inspection,message_unread:0 msgid "If checked new messages require your attention." msgstr "" #. module: quality_control -#: view:qc.test:quality_control.qc_test_form_view -#: field:qc.test,test_internal_note:0 -msgid "Internal Note" +#: view:qc.inspection:quality_control.qc_inspection_search_view +#: view:qc.inspection.line:quality_control.qc_inspection_line_search_view +msgid "Incorrect" msgstr "" #. module: quality_control -#: field:qc.test,message_is_follower:0 +#: view:qc.inspection:quality_control.qc_inspection_form_view +#: view:qc.inspection.line:quality_control.qc_inspection_line_search_view +#: field:qc.inspection.line,inspection_id:0 +msgid "Inspection" +msgstr "" + +#. module: quality_control +#: model:ir.actions.act_window,name:quality_control.action_qc_inspection_line +#: model:ir.ui.menu,name:quality_control.qc_inspection_lines_menu +#: view:qc.inspection:quality_control.qc_inspection_form_view +#: field:qc.inspection,inspection_lines:0 +#: view:qc.inspection.line:quality_control.qc_inspection_line_tree_view +msgid "Inspection lines" +msgstr "" + +#. module: quality_control +#: field:qc.inspection,name:0 +msgid "Inspection number" +msgstr "" + +#. module: quality_control +#: model:ir.actions.act_window,name:quality_control.action_qc_inspection +#: model:ir.ui.menu,name:quality_control.qc_inspection_menu +#: model:ir.ui.menu,name:quality_control.qc_inspection_menu_parent +#: view:qc.inspection:quality_control.qc_inspection_tree_view +msgid "Inspections" +msgstr "" + +#. module: quality_control +#: view:qc.inspection:quality_control.qc_inspection_form_view +#: field:qc.inspection,internal_notes:0 +msgid "Internal notes" +msgstr "" + +#. module: quality_control +#: view:product.template:quality_control.product_template_qc_form_view +msgid "Inventory" +msgstr "" + +#. module: quality_control +#: field:qc.inspection,message_is_follower:0 msgid "Is a Follower" msgstr "" #. module: quality_control -#: field:qc.test,message_last_post:0 +#: field:qc.inspection,message_last_post:0 msgid "Last Message Date" msgstr "" #. module: quality_control -#: field:qc.posible.value,write_uid:0 -#: field:qc.proof,write_uid:0 -#: field:qc.proof.method,write_uid:0 -#: field:qc.proof.synonym,write_uid:0 +#: field:qc.inspection,write_uid:0 +#: field:qc.inspection.line,write_uid:0 +#: field:qc.inspection.set.test,write_uid:0 #: field:qc.test,write_uid:0 -#: field:qc.test.line,write_uid:0 -#: field:qc.test.set.template.wizard,write_uid:0 -#: field:qc.test.template,write_uid:0 -#: field:qc.test.template.category,write_uid:0 -#: field:qc.test.template.line,write_uid:0 -#: field:qc.test.template.trigger,write_uid:0 +#: field:qc.test.category,write_uid:0 +#: field:qc.test.question,write_uid:0 +#: field:qc.test.question.value,write_uid:0 +#: field:qc.trigger,write_uid:0 +#: field:qc.trigger.product_category_line,write_uid:0 +#: field:qc.trigger.product_line,write_uid:0 +#: field:qc.trigger.product_template_line,write_uid:0 msgid "Last Updated by" msgstr "" #. module: quality_control -#: field:qc.posible.value,write_date:0 -#: field:qc.proof,write_date:0 -#: field:qc.proof.method,write_date:0 -#: field:qc.proof.synonym,write_date:0 +#: field:qc.inspection,write_date:0 +#: field:qc.inspection.line,write_date:0 +#: field:qc.inspection.set.test,write_date:0 #: field:qc.test,write_date:0 -#: field:qc.test.line,write_date:0 -#: field:qc.test.set.template.wizard,write_date:0 -#: field:qc.test.template,write_date:0 -#: field:qc.test.template.category,write_date:0 -#: field:qc.test.template.line,write_date:0 -#: field:qc.test.template.trigger,write_date:0 +#: field:qc.test.category,write_date:0 +#: field:qc.test.question,write_date:0 +#: field:qc.test.question.value,write_date:0 +#: field:qc.trigger,write_date:0 +#: field:qc.trigger.product_category_line,write_date:0 +#: field:qc.trigger.product_line,write_date:0 +#: field:qc.trigger.product_template_line,write_date:0 msgid "Last Updated on" msgstr "" -#. module: quality_control -#: field:qc.test.template,test_template_line_ids:0 -msgid "Lines" -msgstr "" - #. module: quality_control #: model:res.groups,name:quality_control.group_quality_control_manager msgid "Manager" msgstr "" #. module: quality_control -#: field:qc.test.line,max_value:0 -#: field:qc.test.template.line,max_value:0 +#: view:qc.inspection:quality_control.qc_inspection_form_view +msgid "Mark todo" +msgstr "" + +#. module: quality_control +#: field:qc.inspection.line,max_value:0 +#: field:qc.test.question,max_value:0 msgid "Max" msgstr "" #. module: quality_control -#: help:qc.test.line,max_value:0 -msgid "Maximum valid value if it is a quantitative proof." +#: help:qc.inspection.line,max_value:0 +msgid "Maximum valid value if it's a quantitative question." msgstr "" #. module: quality_control -#: field:qc.test,message_ids:0 +#: field:qc.inspection,message_ids:0 msgid "Messages" msgstr "" #. module: quality_control -#: help:qc.test,message_ids:0 +#: help:qc.inspection,message_ids:0 msgid "Messages and communication history" msgstr "" #. module: quality_control -#: model:ir.model,name:quality_control.model_qc_proof_method -#: model:ir.ui.menu,name:quality_control.qc_proof_method_menu -#: field:qc.test.line,method_id:0 -#: field:qc.test.template.line,method_id:0 -msgid "Method" -msgstr "" - -#. module: quality_control -#: model:ir.actions.act_window,name:quality_control.action_qc_proof_method -msgid "Methods" -msgstr "" - -#. module: quality_control -#: field:qc.test.line,min_value:0 -#: field:qc.test.template.line,min_value:0 +#: field:qc.inspection.line,min_value:0 +#: field:qc.test.question,min_value:0 msgid "Min" msgstr "" #. module: quality_control -#: help:qc.test.line,min_value:0 -msgid "Minimum valid value if it is a quantitative proof." +#: help:qc.inspection.line,min_value:0 +msgid "Minimum valid value if it's a quantitative question." msgstr "" #. module: quality_control -#: field:qc.posible.value,name:0 -#: field:qc.proof,name:0 -#: field:qc.proof.method,name:0 -#: field:qc.proof.synonym,name:0 -#: field:qc.test.template,name:0 -#: field:qc.test.template.trigger,name:0 +#: code:addons/quality_control/models/qc_test.py:66 +#, python-format +msgid "Minimum value can't be higher than maximum value." +msgstr "" + +#. module: quality_control +#: field:qc.test,name:0 +#: field:qc.test.category,name:0 +#: field:qc.test.question,name:0 +#: field:qc.test.question.value,name:0 +#: field:qc.trigger,name:0 msgid "Name" msgstr "" #. module: quality_control -#: view:qc.test:quality_control.qc_test_form_view -#: field:qc.test.line,notes:0 -#: field:qc.test.template.line,notes:0 +#: view:qc.inspection:quality_control.qc_inspection_form_view +#: field:qc.inspection.line,notes:0 +#: field:qc.test.question,notes:0 msgid "Notes" msgstr "" #. module: quality_control -#: field:qc.test.template.category,parent_id:0 -msgid "Parent Category" +#: field:qc.test.category,parent_id:0 +msgid "Parent category" msgstr "" #. module: quality_control -#: view:qc.posible.value:quality_control.qc_posible_value_tree_view -msgid "Posible Value" +#: model:ir.model,name:quality_control.model_qc_test_question_value +msgid "Possible values of qualitative questions." msgstr "" #. module: quality_control -#: model:ir.actions.act_window,name:quality_control.action_qc_posible_value -#: model:ir.ui.menu,name:quality_control.qc_proof_posible_value_menu -#: view:qc.proof:quality_control.qc_proof_form_view -#: field:qc.proof,value_ids:0 -msgid "Posible Values" +#: field:qc.test,fill_correct_values:0 +msgid "Pre-fill with correct values" msgstr "" #. module: quality_control -#: model:ir.actions.act_window,name:quality_control.action_qc_proof -#: model:ir.ui.menu,name:quality_control.qc_proof_menu -#: view:qc.proof:quality_control.qc_proof_form_view -#: view:qc.proof:quality_control.qc_proof_tree_view -#: field:qc.proof.synonym,proof_id:0 -msgid "Proof" +#: model:ir.model,name:quality_control.model_product_product +#: view:qc.inspection:quality_control.qc_inspection_search_view +#: field:qc.inspection,product:0 +#: view:qc.inspection.line:quality_control.qc_inspection_line_search_view +#: field:qc.inspection.line,product:0 +#: field:qc.trigger.product_line,product:0 +msgid "Product" msgstr "" #. module: quality_control -#: view:qc.proof.method:quality_control.qc_method_form_view -msgid "Proof Method" +#: model:ir.model,name:quality_control.model_product_category +#: field:qc.inspection.line,test_uom_category:0 +msgid "Product Category" msgstr "" #. module: quality_control -#: view:qc.posible.value:quality_control.qc_posible_value_form_view -msgid "Proof Posible Value" +#: model:ir.model,name:quality_control.model_product_template +msgid "Product Template" msgstr "" #. module: quality_control -#: view:qc.proof.synonym:quality_control.qc_proof_synonym_form_view -msgid "Proof Synonym" +#: help:qc.inspection,product:0 +#: help:qc.inspection.line,product:0 +msgid "Product associated with the inspection" msgstr "" #. module: quality_control -#: field:qc.test.line,proof_type:0 -msgid "Proof Type" +#: field:qc.trigger.product_category_line,product_category:0 +msgid "Product category" msgstr "" #. module: quality_control -#: field:qc.test.line,actual_value_ql:0 -msgid "Ql.Value" +#: field:qc.trigger.product_template_line,product_template:0 +msgid "Product template" msgstr "" #. module: quality_control -#: field:qc.test.line,actual_value_qt:0 -msgid "Qt.Value" -msgstr "" - -#. module: quality_control -#: selection:qc.proof,type:0 -#: selection:qc.test.line,proof_type:0 -#: selection:qc.test.template.line,type:0 +#: selection:qc.inspection.line,question_type:0 +#: selection:qc.test.question,type:0 msgid "Qualitative" msgstr "" +#. module: quality_control +#: field:qc.inspection.line,qualitative_value:0 +msgid "Qualitative value" +msgstr "" + +#. module: quality_control +#: field:qc.test.question,ql_values:0 +msgid "Qualitative values" +msgstr "" + #. module: quality_control #: model:ir.module.category,name:quality_control.module_category_quality_control #: model:ir.ui.menu,name:quality_control.qc_menu -msgid "Quality Control" +#: view:product.category:quality_control.product_category_qc_form_view +#: view:product.template:quality_control.product_template_qc_form_view +msgid "Quality control" msgstr "" #. module: quality_control -#: selection:qc.test,state:0 -msgid "Quality Failed" +#: model:ir.model,name:quality_control.model_qc_test_question +msgid "Quality control question" msgstr "" #. module: quality_control -#: selection:qc.test,state:0 -msgid "Quality Success" +#: model:ir.model,name:quality_control.model_qc_test +msgid "Quality control test" msgstr "" #. module: quality_control -#: selection:qc.proof,type:0 -#: selection:qc.test.line,proof_type:0 -#: selection:qc.test.template.line,type:0 +#: model:ir.model,name:quality_control.model_qc_trigger +#: view:qc.trigger:quality_control.qc_trigger_form_view +msgid "Quality control trigger" +msgstr "" + +#. module: quality_control +#: view:product.category:quality_control.product_category_qc_form_view +#: field:product.category,qc_triggers:0 +#: field:product.product,qc_triggers:0 +#: view:product.template:quality_control.product_template_qc_form_view +#: field:product.template,qc_triggers:0 +#: view:qc.trigger:quality_control.qc_trigger_tree_view +msgid "Quality control triggers" +msgstr "" + +#. module: quality_control +#: selection:qc.inspection,state:0 +msgid "Quality failed" +msgstr "" + +#. module: quality_control +#: selection:qc.inspection,state:0 +msgid "Quality success" +msgstr "" + +#. module: quality_control +#: selection:qc.inspection.line,question_type:0 +#: selection:qc.test.question,type:0 msgid "Quantitative" msgstr "" #. module: quality_control -#: field:qc.test.line,proof_id:0 -#: field:qc.test.template.line,proof_id:0 +#: field:qc.inspection.line,quantitative_value:0 +msgid "Quantitative value" +msgstr "" + +#. module: quality_control +#: view:qc.inspection.line:quality_control.qc_inspection_line_search_view +#: field:qc.inspection.line,name:0 msgid "Question" msgstr "" #. module: quality_control -#: view:qc.test:quality_control.qc_test_search_view -#: field:qc.test,object_id:0 +#: field:qc.inspection.line,question_type:0 +msgid "Question type" +msgstr "" + +#. module: quality_control +#: view:qc.test.question:quality_control.qc_test_question_form_view +msgid "Question value" +msgstr "" + +#. module: quality_control +#: view:qc.inspection:quality_control.qc_inspection_form_view +#: view:qc.test:quality_control.qc_test_form_view +#: field:qc.test,test_lines:0 +msgid "Questions" +msgstr "" + +#. module: quality_control +#: selection:qc.inspection,state:0 +msgid "Ready" +msgstr "" + +#. module: quality_control +#: view:qc.inspection:quality_control.qc_inspection_search_view +#: field:qc.inspection,object_id:0 msgid "Reference" msgstr "" #. module: quality_control -#: field:qc.test.template,object_id:0 -msgid "Reference Object" +#: field:qc.test,object_id:0 +msgid "Reference object" msgstr "" #. module: quality_control -#: model:qc.test.template.category,name:quality_control.qc_test_template_category_referenced +#: model:qc.test.category,name:quality_control.qc_test_template_category_referenced msgid "Referenced" msgstr "" #. module: quality_control -#: selection:qc.test.template,type:0 +#: selection:qc.test,type:0 msgid "Related" msgstr "" #. module: quality_control -#: view:qc.test:quality_control.qc_test_search_view -msgid "Search Test" +#: view:qc.inspection:quality_control.qc_inspection_search_view +msgid "Search inspection" msgstr "" #. module: quality_control -#: model:ir.actions.act_window,name:quality_control.action_qc_test_set_template_wizard_form -#: view:qc.test.set.template.wizard:quality_control.view_qc_test_set_template_wizard_form -msgid "Select Test Template" +#: view:qc.inspection.line:quality_control.qc_inspection_line_search_view +msgid "Search inspection line" msgstr "" #. module: quality_control -#: field:qc.test.template.line,sequence:0 +#: model:ir.actions.act_window,name:quality_control.action_qc_inspection_set_test +#: view:qc.inspection.set.test:quality_control.view_qc_test_set_test_form +msgid "Select test" +msgstr "" + +#. module: quality_control +#: field:qc.test.question,sequence:0 msgid "Sequence" msgstr "" #. module: quality_control -#: view:qc.test:quality_control.qc_test_search_view -#: field:qc.test,state:0 +#: view:qc.inspection:quality_control.qc_inspection_form_view +msgid "Set test" +msgstr "" + +#. module: quality_control +#: view:qc.inspection:quality_control.qc_inspection_search_view +#: field:qc.inspection,state:0 msgid "State" msgstr "" #. module: quality_control -#: view:qc.test:quality_control.qc_test_search_view -#: field:qc.test,success:0 +#: view:qc.inspection:quality_control.qc_inspection_search_view +#: field:qc.inspection,success:0 +#: view:qc.inspection.line:quality_control.qc_inspection_line_search_view msgid "Success" msgstr "" #. module: quality_control -#: field:qc.test.line,success:0 +#: field:qc.inspection.line,success:0 msgid "Success?" msgstr "" #. module: quality_control -#: field:qc.test,message_summary:0 +#: field:qc.inspection,message_summary:0 msgid "Summary" msgstr "" #. module: quality_control -#: model:ir.actions.act_window,name:quality_control.action_proof_synonym -msgid "Synonym" -msgstr "" - -#. module: quality_control -#: model:ir.ui.menu,name:quality_control.qc_proof_synonyms_menu -#: view:qc.proof:quality_control.qc_proof_form_view -#: field:qc.proof,synonym_ids:0 -#: field:qc.proof,synonyms:0 -msgid "Synonyms" -msgstr "" - -#. module: quality_control -#: view:qc.test:quality_control.qc_test_form_view -#: view:qc.test:quality_control.qc_test_search_view -#: field:qc.test.set.template.wizard,test_template_id:0 +#: field:qc.inspection.set.test,test:0 msgid "Template" msgstr "" #. module: quality_control -#: model:ir.actions.act_window,name:quality_control.action_qc_test_template_trigger -#: model:ir.ui.menu,name:quality_control.qc_test_template_trigger_menu -#: view:qc.test.template.trigger:quality_control.qc_test_template_trigger_form_view -#: view:qc.test.template.trigger:quality_control.qc_test_template_trigger_tree_view -msgid "Template Trigger" -msgstr "" - -#. module: quality_control -#: model:ir.actions.act_window,name:quality_control.action_qc_new_test +#: view:qc.inspection:quality_control.qc_inspection_search_view +#: field:qc.inspection,test:0 #: view:qc.test:quality_control.qc_test_form_view -#: view:qc.test:quality_control.qc_test_tree_view -#: field:qc.test,test_template_id:0 -#: field:qc.test.line,test_id:0 +#: field:qc.test.question,test:0 +#: field:qc.trigger.line,test:0 +#: field:qc.trigger.product_category_line,test:0 +#: field:qc.trigger.product_line,test:0 +#: field:qc.trigger.product_template_line,test:0 msgid "Test" msgstr "" #. module: quality_control -#: model:ir.actions.act_window,name:quality_control.action_qc_test_line -#: view:qc.test.line:quality_control.qc_test_line_form_view -#: view:qc.test.line:quality_control.qc_test_line_tree_view -msgid "Test Line" +#: field:qc.inspection.line,test_uom_id:0 +msgid "Test UoM" msgstr "" #. module: quality_control -#: model:ir.ui.menu,name:quality_control.qc_test_lines_menu -#: field:qc.test,test_line_ids:0 -msgid "Test Lines" +#: model:ir.actions.act_window,name:quality_control.action_qc_test_category +#: model:ir.ui.menu,name:quality_control.qc_test_category_menu +#: view:qc.test.category:quality_control.qc_test_category_tree_view +msgid "Test categories" msgstr "" #. module: quality_control -#: view:qc.proof.method:quality_control.qc_proof_method_tree_view -msgid "Test Method" +#: model:ir.model,name:quality_control.model_qc_test_category +msgid "Test category" msgstr "" #. module: quality_control -#: view:qc.test:quality_control.qc_test_form_view -msgid "Test Name" +#: field:qc.inspection.line,test_line:0 +#: view:qc.test.question:quality_control.qc_test_question_form_view +#: field:qc.test.question.value,test_line:0 +msgid "Test question" msgstr "" #. module: quality_control -#: view:qc.test.line:quality_control.qc_test_line_form_view -msgid "Test Result" -msgstr "" - -#. module: quality_control -#: view:qc.proof.synonym:quality_control.qc_test_synonym_tree_view -msgid "Test Synonym" -msgstr "" - -#. module: quality_control -#: model:ir.actions.act_window,name:quality_control.action_qc_test_template -#: model:ir.model,name:quality_control.model_qc_test_template -#: model:ir.ui.menu,name:quality_control.qc_test_template_menu -#: view:qc.test.template:quality_control.qc_test_template_form_view -#: view:qc.test.template:quality_control.qc_test_template_tree_view -#: field:qc.test.template.line,test_template_id:0 -msgid "Test Template" -msgstr "" - -#. module: quality_control -#: model:ir.ui.menu,name:quality_control.qc_template_category_menu -msgid "Test Template Categories" -msgstr "" - -#. module: quality_control -#: model:ir.actions.act_window,name:quality_control.action_qc_test_template_category -#: model:ir.model,name:quality_control.model_qc_test_template_category -#: view:qc.test.template.category:quality_control.qc_test_template_category_form_view -#: view:qc.test.template.category:quality_control.qc_test_template_category_tree_view -msgid "Test Template Category" -msgstr "" - -#. module: quality_control -#: model:ir.actions.act_window,name:quality_control.action_qc_test_template_line -#: model:ir.model,name:quality_control.model_qc_test_template_line -#: field:qc.test.line,test_template_line_id:0 -#: view:qc.test.template.line:quality_control.qc_test_template_line_tree_view -msgid "Test Template Line" -msgstr "" - -#. module: quality_control -#: model:ir.ui.menu,name:quality_control.qc_test_template_line_menu -msgid "Test Template Lines" -msgstr "" - -#. module: quality_control -#: model:ir.model,name:quality_control.model_qc_test_template_trigger -msgid "Test Template Trigger" -msgstr "" - -#. module: quality_control -#: model:ir.ui.menu,name:quality_control.qc_menu_config_templates -msgid "Test Templates" -msgstr "" - -#. module: quality_control -#: view:qc.test.line:quality_control.qc_test_line_form_view -msgid "Test Values" -msgstr "" - -#. module: quality_control -#: model:ir.ui.menu,name:quality_control.qc_menu_tests +#: model:ir.actions.act_window,name:quality_control.action_qc_test +#: model:ir.ui.menu,name:quality_control.qc_menu_test_parent #: model:ir.ui.menu,name:quality_control.qc_test_menu +#: view:qc.test:quality_control.qc_test_tree_view msgid "Tests" msgstr "" #. module: quality_control -#: help:qc.test.template.category,active:0 -msgid "The active field allows you to hide the category without removing it." +#: code:addons/quality_control/models/qc_test.py:56 +#, python-format +msgid "There isn't any value with OK marked. You have to mark at least one." msgstr "" #. module: quality_control -#: help:qc.test,success:0 -msgid "This field will be active if all tests have succeeded." +#: help:qc.test.category,active:0 +msgid "This field allows you to hide the category without removing it." msgstr "" #. module: quality_control -#: field:qc.test.template,trig_on:0 +#: help:qc.inspection,success:0 +msgid "This field will be marked if all tests have been succeeded." +msgstr "" + +#. module: quality_control +#: field:qc.trigger.line,trigger:0 +#: field:qc.trigger.product_category_line,trigger:0 +#: field:qc.trigger.product_line,trigger:0 +#: field:qc.trigger.product_template_line,trigger:0 msgid "Trigger" msgstr "" #. module: quality_control -#: field:qc.proof,type:0 -#: field:qc.test.template,type:0 -#: field:qc.test.template.line,type:0 +#: field:qc.test,type:0 +#: field:qc.test.question,type:0 msgid "Type" msgstr "" #. module: quality_control -#: field:qc.test,message_unread:0 +#: field:qc.inspection,message_unread:0 msgid "Unread Messages" msgstr "" #. module: quality_control -#: help:qc.test.line,uom_id:0 -msgid "UoM for minimum and maximum values if it is a quantitative proof." +#: field:qc.inspection.line,uom_id:0 +msgid "UoM" msgstr "" #. module: quality_control -#: help:qc.test.line,test_uom_id:0 -msgid "UoM of the value of the result if it is a quantitative proof." +#: help:qc.inspection.line,test_uom_id:0 +msgid "UoM for minimum and maximum values if it's a quantitative question." msgstr "" #. module: quality_control -#: field:qc.test.line,uom_id:0 -#: field:qc.test.template.line,uom_id:0 +#: help:qc.inspection.line,uom_id:0 +msgid "UoM of the inspection value if it's a quantitative question." +msgstr "" + +#. module: quality_control +#: field:qc.test.question,uom_id:0 msgid "Uom" msgstr "" -#. module: quality_control -#: field:qc.test.line,test_uom_id:0 -msgid "Uom Test" -msgstr "" - #. module: quality_control #: model:res.groups,name:quality_control.group_quality_control_user msgid "User" msgstr "" #. module: quality_control -#: help:qc.test.line,actual_value_ql:0 -msgid "Value of the result if it is a qualitative proof." +#: field:qc.inspection.line,valid_values:0 +msgid "Valid values" msgstr "" #. module: quality_control -#: help:qc.test.line,actual_value_qt:0 -msgid "Value of the result if it is a quantitative proof." +#: help:qc.inspection.line,qualitative_value:0 +msgid "Value of the result if it's a qualitative question." msgstr "" #. module: quality_control -#: selection:qc.test,state:0 -msgid "Waiting Supervisor Approval" +#: help:qc.inspection.line,quantitative_value:0 +msgid "Value of the result if it's a quantitative question." msgstr "" #. module: quality_control -#: help:qc.posible.value,ok:0 +#: selection:qc.inspection,state:0 +msgid "Waiting supervisor approval" +msgstr "" + +#. module: quality_control +#: help:qc.test.question.value,ok:0 msgid "When this field is marked, the answer is considered correct." msgstr "" #. module: quality_control -#: view:qc.test.template.line:quality_control.qc_test_template_line_form_view -msgid "proof Line" +#: code:addons/quality_control/models/qc_inspection.py:92 +#, python-format +msgid "You cannot remove an auto-generated inspection" msgstr "" #. module: quality_control -#: view:qc.test:quality_control.qc_test_form_view -msgid "questions" +#: code:addons/quality_control/models/qc_inspection.py:95 +#, python-format +msgid "You cannot remove an inspection that it's not in draft state" +msgstr "" + +#. module: quality_control +#: code:addons/quality_control/models/qc_inspection.py:108 +#, python-format +msgid "You must set the test to perform first." +msgstr "" + +#. module: quality_control +#: code:addons/quality_control/models/qc_inspection.py:123 +#, python-format +msgid "You should provide a unit of measure for qualitative questions." +msgstr "" + +#. module: quality_control +#: code:addons/quality_control/models/qc_inspection.py:118 +#, python-format +msgid "You should provide an answer for all quantitative questions." msgstr "" diff --git a/quality_control/models/__init__.py b/quality_control/models/__init__.py index 93bc89c58..aec418acc 100644 --- a/quality_control/models/__init__.py +++ b/quality_control/models/__init__.py @@ -1,31 +1,13 @@ # -*- encoding: utf-8 -*- ############################################################################## -# -# Copyright (c) 2010 NaN Projectes de Programari Lliure, S.L. -# All Rights Reserved. -# http://www.NaN-tic.com -# -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability of assessing all potential -# consequences resulting from its eventual inadequacies and bugs -# End users who are looking for a ready-to-use solution with commercial -# garantees and support are strongly adviced to contract a Free Software -# Service Company -# -# This program is Free Software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# +# For copyright and license notices, see __openerp__.py file in root directory ############################################################################## -from . import quality_control +from . import qc_trigger +from . import qc_trigger_line +from . import qc_test_category +from . import qc_test +from . import qc_inspection +from . import product_product +from . import product_template +from . import product_category diff --git a/quality_control/models/product_category.py b/quality_control/models/product_category.py new file mode 100644 index 000000000..5cf22ff99 --- /dev/null +++ b/quality_control/models/product_category.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## +from openerp import models, fields + + +class ProductCategory(models.Model): + _inherit = "product.category" + + qc_triggers = fields.One2many( + comodel_name="qc.trigger.product_category_line", + inverse_name="product_category", + string="Quality control triggers") diff --git a/quality_control/models/product_product.py b/quality_control/models/product_product.py new file mode 100644 index 000000000..8eca86385 --- /dev/null +++ b/quality_control/models/product_product.py @@ -0,0 +1,13 @@ +# -*- coding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## +from openerp import models, fields + + +class ProductProduct(models.Model): + _inherit = "product.product" + + qc_triggers = fields.One2many( + comodel_name="qc.trigger.product_line", inverse_name="product", + string="Quality control triggers") diff --git a/quality_control/models/product_template.py b/quality_control/models/product_template.py new file mode 100644 index 000000000..de2641c37 --- /dev/null +++ b/quality_control/models/product_template.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## +from openerp import models, fields + + +class ProductTemplate(models.Model): + _inherit = "product.template" + + qc_triggers = fields.One2many( + comodel_name="qc.trigger.product_template_line", + inverse_name="product_template", + string="Quality control triggers") diff --git a/quality_control/models/qc_inspection.py b/quality_control/models/qc_inspection.py new file mode 100644 index 000000000..5e2415f81 --- /dev/null +++ b/quality_control/models/qc_inspection.py @@ -0,0 +1,293 @@ +# -*- coding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## +from openerp import models, fields, api, exceptions, _ + + +class QcInspection(models.Model): + _name = 'qc.inspection' + _inherit = ['mail.thread', 'ir.needaction_mixin'] + + @api.one + @api.depends('inspection_lines', 'inspection_lines.success') + def _success(self): + self.success = all([x.success for x in self.inspection_lines]) + + @api.multi + def _links_get(self): + link_obj = self.env['res.request.link'] + return [(r.object, r.name) for r in link_obj.search([])] + + @api.one + @api.depends('object_id') + def _get_product(self): + if self.object_id and self.object_id._name == 'product.product': + self.product = self.object_id + else: + self.product = False + + @api.one + @api.depends('object_id') + def _get_qty(self): + self.qty = 1.0 + + name = fields.Char( + string='Inspection number', required=True, default='/', select=True, + readonly=True, states={'draft': [('readonly', False)]}, copy=False) + date = fields.Datetime( + string='Date', required=True, readonly=True, copy=False, + default=fields.Datetime.now(), + states={'draft': [('readonly', False)]}, select=True) + object_id = fields.Reference( + string='Reference', selection=_links_get, readonly=True, + states={'draft': [('readonly', False)]}, ondelete="set null") + product = fields.Many2one( + comodel_name="product.product", compute="_get_product", store=True, + help="Product associated with the inspection") + qty = fields.Float(string="Quantity", compute="_get_qty", store=True) + test = fields.Many2one( + comodel_name='qc.test', string='Test', readonly=True, select=True) + inspection_lines = fields.One2many( + comodel_name='qc.inspection.line', inverse_name='inspection_id', + string='Inspection lines', readonly=True, + states={'ready': [('readonly', False)]}) + internal_notes = fields.Text(string='Internal notes') + external_notes = fields.Text( + string='External notes', + states={'success': [('readonly', True)], + 'failed': [('readonly', True)]}) + state = fields.Selection( + [('draft', 'Draft'), + ('ready', 'Ready'), + ('waiting', 'Waiting supervisor approval'), + ('success', 'Quality success'), + ('failed', 'Quality failed'), + ('canceled', 'Cancelled')], + string='State', readonly=True, default='draft') + success = fields.Boolean( + compute="_success", string='Success', + help='This field will be marked if all tests have been succeeded.', + store=True) + auto_generated = fields.Boolean( + string='Auto-generated', readonly=True, copy=False, + help='If an inspection is auto-generated, it can be cancelled nor ' + 'removed') + company_id = fields.Many2one( + comodel_name='res.company', string='Company', readonly=True, + states={'draft': [('readonly', False)]}, + default=lambda self: self.env['res.company']._company_default_get( + 'qc.inspection')) + + @api.model + def create(self, vals): + if vals.get('name', '/') == '/': + vals['name'] = self.env['ir.sequence'].get('qc.inspection') + return super(QcInspection, self).create(vals) + + @api.multi + def unlink(self): + for inspection in self: + if inspection.auto_generated: + raise exceptions.Warning( + _("You cannot remove an auto-generated inspection")) + if inspection.state != 'draft': + raise exceptions.Warning( + _("You cannot remove an inspection that it's not in draft " + "state")) + return super(QcInspection, self).unlink() + + @api.multi + def action_draft(self): + self.write({'state': 'draft'}) + + @api.multi + def action_todo(self): + for inspection in self: + if not inspection.test: + raise exceptions.Warning( + _("You must set the test to perform first.")) + self.write({'state': 'ready'}) + + @api.multi + def action_confirm(self): + for inspection in self: + for line in inspection.inspection_lines: + if line.question_type == 'qualitative': + if not line.qualitative_value: + raise exceptions.Warning( + _("You should provide an answer for all " + "quantitative questions.")) + else: + if not line.uom_id: + raise exceptions.Warning( + _("You should provide a unit of measure for " + "qualitative questions.")) + if inspection.success: + inspection.state = 'success' + else: + inspection.state = 'waiting' + + @api.multi + def action_approve(self): + for inspection in self: + if inspection.success: + inspection.state = 'success' + else: + inspection.state = 'failed' + + @api.multi + def action_cancel(self): + self.write({'state': 'canceled'}) + + @api.multi + def set_test(self, test, force_fill=False): + for inspection in self: + header = self._prepare_inspection_header( + inspection.object_id, test) + del header['state'] # don't change current status + del header['auto_generated'] # don't change auto_generated flag + inspection.write(header) + self.inspection_lines.unlink() + inspection.inspection_lines = inspection._prepare_inspection_lines( + test, force_fill=force_fill) + + @api.multi + def _make_inspection(self, object_ref, test): + """Overridable hook method for creating inspection from test. + :param object_ref: Object instance + :param test: Test instance + :return: Inspection object + """ + inspection = self.create(self._prepare_inspection_header( + object_ref, test)) + inspection.set_test(test) + return inspection + + @api.multi + def _prepare_inspection_header(self, object_ref, test): + """Overridable hook method for preparing inspection header. + :param object_ref: Object instance + :param test: Test instance + :return: List of values for creating the inspection + """ + return { + 'object_id': object_ref and '%s,%s' % (object_ref._name, + object_ref.id) or False, + 'state': 'ready', + 'test': test.id, + 'auto_generated': True, + } + + @api.multi + def _prepare_inspection_lines(self, test, force_fill=False): + new_data = [] + for line in test.test_lines: + data = self._prepare_inspection_line( + test, line, fill=test.fill_correct_values or force_fill) + new_data.append((0, 0, data)) + return new_data + + @api.multi + def _prepare_inspection_line(self, test, line, fill=None): + data = { + 'name': line.name, + 'test_line': line.id, + 'notes': line.notes, + 'min_value': line.min_value, + 'max_value': line.max_value, + 'test_uom_id': line.uom_id.id, + 'uom_id': line.uom_id.id, + 'question_type': line.type, + 'possible_ql_values': [x.id for x in line.ql_values] + } + if fill: + if line.type == 'qualitative': + # Fill with the first correct value found + for value in line.ql_values: + if value.ok: + data['qualitative_value'] = value.id + break + else: + # Fill with a value inside the interval + data['quantitative_value'] = (line.min_value + + line.max_value) * 0.5 + return data + + +class QcInspectionLine(models.Model): + _name = 'qc.inspection.line' + _description = "Quality control inspection line" + + @api.one + @api.depends('question_type', 'uom_id', 'test_uom_id', 'max_value', + 'min_value', 'quantitative_value', 'qualitative_value', + 'possible_ql_values') + def quality_test_check(self): + if self.question_type == 'qualitative': + self.success = self.qualitative_value.ok + else: + if self.uom_id.id == self.test_uom_id.id: + amount = self.quantitative_value + else: + amount = self.env['product.uom']._compute_qty( + self.uom_id.id, self.quantitative_value, + self.test_uom_id.id) + self.success = self.max_value >= amount >= self.min_value + + @api.one + @api.depends('possible_ql_values', 'min_value', 'max_value', 'test_uom_id', + 'question_type') + def get_valid_values(self): + if self.question_type == 'qualitative': + self.valid_values = ", ".join([x.name for x in + self.possible_ql_values if x.ok]) + else: + self.valid_values = "%s-%s" % (self.min_value, self.max_value) + if self.env.ref("product.group_uom") in self.env.user.groups_id: + self.valid_values += " %s" % self.test_uom_id.name + + inspection_id = fields.Many2one( + comodel_name='qc.inspection', string='Inspection') + name = fields.Char(string="Question", readonly=True) + product = fields.Many2one( + comodel_name="product.product", related="inspection_id.product", + store=True) + test_line = fields.Many2one( + comodel_name='qc.test.question', string='Test question', + readonly=True) + possible_ql_values = fields.Many2many( + comodel_name='qc.test.question.value', string='Answers') + quantitative_value = fields.Float( + 'Quantitative value', digits=(16, 5), + help="Value of the result if it's a quantitative question.") + qualitative_value = fields.Many2one( + comodel_name='qc.test.question.value', string='Qualitative value', + help="Value of the result if it's a qualitative question.", + domain="[('id', 'in', possible_ql_values[0][2])]") + notes = fields.Text(string='Notes') + min_value = fields.Float( + string='Min', digits=(16, 5), readonly=True, + help="Minimum valid value if it's a quantitative question.") + max_value = fields.Float( + string='Max', digits=(16, 5), readonly=True, + help="Maximum valid value if it's a quantitative question.") + test_uom_id = fields.Many2one( + comodel_name='product.uom', string='Test UoM', readonly=True, + help="UoM for minimum and maximum values if it's a quantitative " + "question.") + test_uom_category = fields.Many2one( + comodel_name="product.uom.categ", related="test_uom_id.category_id", + store=True) + uom_id = fields.Many2one( + comodel_name='product.uom', string='UoM', + domain="[('category_id', '=', test_uom_category)]", + help="UoM of the inspection value if it's a quantitative question.") + question_type = fields.Selection( + [('qualitative', 'Qualitative'), + ('quantitative', 'Quantitative')], + string='Question type', readonly=True) + valid_values = fields.Char(string="Valid values", store=True, + compute="get_valid_values") + success = fields.Boolean( + compute="quality_test_check", string="Success?", store=True) diff --git a/quality_control/models/qc_test.py b/quality_control/models/qc_test.py new file mode 100644 index 000000000..9566c867f --- /dev/null +++ b/quality_control/models/qc_test.py @@ -0,0 +1,95 @@ +# -*- coding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## +from openerp import models, fields, api, exceptions, _ + + +class QcTest(models.Model): + """A test is a group of questions to with the values that make them valid. + """ + _name = 'qc.test' + _description = 'Quality control test' + + @api.multi + def _links_get(self): + link_obj = self.env['res.request.link'] + return [(r.object, r.name) for r in link_obj.search([])] + + active = fields.Boolean('Active', default=True) + name = fields.Char( + string='Name', required=True, translate=True, select=True) + test_lines = fields.One2many( + comodel_name='qc.test.question', inverse_name='test', + string='Questions', copy=True) + object_id = fields.Reference( + string='Reference object', selection=_links_get,) + fill_correct_values = fields.Boolean( + string='Pre-fill with correct values') + type = fields.Selection( + [('generic', 'Generic'), + ('related', 'Related')], + string='Type', select=True, required=True, default='generic') + category = fields.Many2one( + comodel_name='qc.test.category', string='Category') + company_id = fields.Many2one( + comodel_name='res.company', string='Company', + default=lambda self: self.env['res.company']._company_default_get( + 'qc.test')) + + +class QcTestQuestion(models.Model): + """Each test line is a question with its valid value(s).""" + _name = 'qc.test.question' + _description = 'Quality control question' + _order = 'sequence, id' + + @api.one + @api.constrains('ql_values') + def _check_valid_answers(self): + if self.type == 'quantitative': + return + for value in self.ql_values: + if value.ok: + return + raise exceptions.Warning( + _("There isn't any value with OK marked. You have to mark at " + "least one.")) + + @api.one + @api.constrains('min_value', 'max_value') + def _check_valid_range(self): + if self.type == 'qualitative': + return + if self.min_value > self.max_value: + raise exceptions.Warning( + _("Minimum value can't be higher than maximum value.")) + + sequence = fields.Integer( + string='Sequence', required=True, default="10") + test = fields.Many2one(comodel_name='qc.test', string='Test') + name = fields.Char( + string='Name', required=True, select=True, translate=True) + type = fields.Selection( + [('qualitative', 'Qualitative'), + ('quantitative', 'Quantitative')], string='Type', required=True) + ql_values = fields.One2many( + comodel_name='qc.test.question.value', inverse_name="test_line", + string='Qualitative values', copy=True) + notes = fields.Text(string='Notes') + min_value = fields.Float(string='Min', digits=(16, 5)) + max_value = fields.Float(string='Max', digits=(15, 5)) + uom_id = fields.Many2one(comodel_name='product.uom', string='Uom') + + +class QcTestQuestionValue(models.Model): + _name = 'qc.test.question.value' + _description = 'Possible values of qualitative questions.' + + test_line = fields.Many2one( + comodel_name="qc.test.question", string="Test question") + name = fields.Char( + string='Name', required=True, select=True, translate=True) + ok = fields.Boolean( + string='Correct answer?', + help="When this field is marked, the answer is considered correct.") diff --git a/quality_control/models/qc_test_category.py b/quality_control/models/qc_test_category.py new file mode 100644 index 000000000..264518e59 --- /dev/null +++ b/quality_control/models/qc_test_category.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## +from openerp import models, fields, api, exceptions, _ + + +class QcTestTemplateCategory(models.Model): + _name = 'qc.test.category' + _description = 'Test category' + + @api.one + @api.depends('name', 'parent_id') + def _get_complete_name(self): + if self.name: + names = [self.name] + parent = self.parent_id + while parent: + names.append(parent.name) + parent = parent.parent_id + self.complete_name = " / ".join(reversed(names)) + else: + self.complete_name = "" + + @api.constrains('parent_id') + def _check_recursion(self): + ids = self.ids + level = 100 + while ids: + parents = self.search([('id', 'in', ids), + ('parent_id', '!=', False)]) + ids = list(set([x.parent_id.id for x in parents])) + if not level: + raise exceptions.Warning( + _('Error ! You can not create recursive categories.')) + level -= 1 + + name = fields.Char('Name', required=True, translate=True) + parent_id = fields.Many2one( + comodel_name='qc.test.category', string='Parent category', select=True) + complete_name = fields.Char( + compute="_get_complete_name", string='Full name') + child_ids = fields.One2many( + comodel_name='qc.test.category', inverse_name='parent_id', + string='Child categories') + active = fields.Boolean( + string='Active', default=True, + help="This field allows you to hide the category without removing it.") diff --git a/quality_control/models/qc_trigger.py b/quality_control/models/qc_trigger.py new file mode 100644 index 000000000..039989fdc --- /dev/null +++ b/quality_control/models/qc_trigger.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## +from openerp import models, fields + + +class QcTrigger(models.Model): + _name = 'qc.trigger' + _description = 'Quality control trigger' + + name = fields.Char(string='Name', required=True, select=True, + translate=True) + active = fields.Boolean(string='Active', default=True) + company_id = fields.Many2one( + comodel_name='res.company', string='Company', + default=lambda self: self.env['res.company']._company_default_get( + 'qc.test')) diff --git a/quality_control/models/qc_trigger_line.py b/quality_control/models/qc_trigger_line.py new file mode 100644 index 000000000..ebba31595 --- /dev/null +++ b/quality_control/models/qc_trigger_line.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## +from openerp import models, fields + + +class QcTriggerLine(models.AbstractModel): + _name = "qc.trigger.line" + _description = "Abstract line for defining triggers" + + trigger = fields.Many2one(comodel_name="qc.trigger", required=True) + test = fields.Many2one(comodel_name="qc.test", required=True) + + def get_test_for_product(self, trigger, product): + """Overridable method for getting test associated to a product. + Each inherited model will complete this module to make the search by + product, template or category. + :param trigger: Trigger instance. + :param product: Product instance. + :return: Set of tests that matches to the given product and trigger. + """ + return set() + + +class QcTriggerProductCategoryLine(models.Model): + _inherit = "qc.trigger.line" + _name = "qc.trigger.product_category_line" + + product_category = fields.Many2one(comodel_name="product.category") + + def get_test_for_product(self, trigger, product): + tests = super(QcTriggerProductCategoryLine, + self).get_test_for_product(trigger, product) + category = product.categ_id + while category: + for trigger_line in category.qc_triggers: + if trigger_line.trigger.id == trigger.id: + tests.add(trigger_line.test) + category = category.parent_id + return tests + + +class QcTriggerProductTemplateLine(models.Model): + _inherit = "qc.trigger.line" + _name = "qc.trigger.product_template_line" + + product_template = fields.Many2one(comodel_name="product.template") + + def get_test_for_product(self, trigger, product): + tests = super(QcTriggerProductTemplateLine, + self).get_test_for_product(trigger, product) + for trigger_line in product.product_tmpl_id.qc_triggers: + if trigger_line.trigger.id == trigger.id: + tests.add(trigger_line.test) + return tests + + +class QcTriggerProductLine(models.Model): + _inherit = "qc.trigger.line" + _name = "qc.trigger.product_line" + + product = fields.Many2one(comodel_name="product.product") + + def get_test_for_product(self, trigger, product): + tests = super(QcTriggerProductLine, self).get_test_for_product( + trigger, product) + for trigger_line in product.qc_triggers: + if trigger_line.trigger.id == trigger.id: + tests.add(trigger_line.test) + return tests diff --git a/quality_control/models/quality_control.py b/quality_control/models/quality_control.py deleted file mode 100644 index fb003b9ba..000000000 --- a/quality_control/models/quality_control.py +++ /dev/null @@ -1,638 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (c) 2010 NaN Projectes de Programari Lliure, S.L. -# All Rights Reserved. -# http://www.NaN-tic.com -# -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability of assessing all potential -# consequences resulting from its eventual inadequacies and bugs -# End users who are looking for a ready-to-use solution with commercial -# garantees and support are strongly adviced to contract a Free Software -# Service Company -# -# This program is Free Software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -############################################################################## - -from openerp.tools.translate import _ -from openerp.osv import orm, fields -import time - - -class QcProofMethod(orm.Model): - """ - This model stores a method for doing a test. Examples of methods are: - "Eu.Pharm.v.v. (2.2.32)" or "HPLC" - """ - _name = 'qc.proof.method' - _description = 'Method' - - _columns = { - 'name': fields.char('Name', size=100, required=True, select="1", - translate=True), - 'active': fields.boolean('Active'), - } - - _defaults = { - 'active': True, - } - - -class QcPosibleValue(orm.Model): - """ - This model stores all possible values of qualitative proof. - """ - _name = 'qc.posible.value' - - _columns = { - 'name': fields.char('Name', size=200, required=True, select="1", - translate=True), - 'active': fields.boolean('Active'), - 'ok': fields.boolean('Correct answer', - help="When this field is marked, the answer " - "is considered correct."), - } - - _defaults = { - 'active': True, - } - - def search(self, cr, uid, args, offset=0, limit=None, order=None, - context=None, count=False): - if context is None: - context = {} - if context.get('proof_id'): - ctx = context.copy() - del ctx['proof_id'] - proof = self.pool['qc.proof'].browse(cr, uid, context['proof_id'], - ctx) - result = [x.id for x in proof.value_ids] - args = args[:] - args.append(('id', 'in', result)) - return super(QcPosibleValue, self).search(cr, uid, args, offset, limit, - order, context, count) - - -class QcProof(orm.Model): - """ - This model stores proofs which will be part of a test. Proofs are - classified between qualitative (such as color) and quantitative (such as - density). - - Proof must be related with method, and Poof-Method relation must be unique - - A name_search on thish model will search on 'name' field but also on any of - its synonyms. - """ - _name = 'qc.proof' - - def _synonyms(self, cr, uid, ids, field_name, arg, context=None): - result = {} - for proof in self.browse(cr, uid, ids, context=context): - texts = [] - for syn in proof.synonym_ids: - texts.append(syn.name) - result[proof.id] = ', '.join(texts) - return result - - _columns = { - 'name': fields.char('Name', size=200, required=True, select="1", - translate=True), - 'ref': fields.char('Code', size=30, select="1"), - 'active': fields.boolean('Active'), - 'synonym_ids': fields.one2many('qc.proof.synonym', 'proof_id', - 'Synonyms'), - 'type': fields.selection([('qualitative', 'Qualitative'), - ('quantitative', 'Quantitative')], 'Type', - select="1", required=True), - 'value_ids': fields.many2many('qc.posible.value', - 'qc_proof_posible_value_rel', 'proof_id', - 'posible_value_id', 'Posible Values'), - 'synonyms': fields.function(_synonyms, method=True, type='char', - string='Synonyms', store=False), - } - - _defaults = { - 'active': True, - } - - def name_search(self, cr, uid, name='', args=None, operator='ilike', - context=None, limit=None): - result = super(QcProof, self).name_search(cr, uid, name=name, - args=args, operator=operator, - context=context, limit=limit) - synonym_obj = self.pool['qc.proof.synonym'] - if name: - ids = [x[0] for x in result] - new_ids = [] - syns = synonym_obj.name_search(cr, uid, name=name, args=args, - operator=operator, context=context, - limit=limit) - syns = [x[0] for x in syns] - for syn in synonym_obj.browse(cr, uid, syns, context=context): - if syn.proof_id.id not in ids: - new_ids.append(syn.proof_id.id) - result += self.name_get(cr, uid, new_ids, context=context) - return result - -# def name_get(self, cr, uid, ids, context=None): -# result = [] -# for proof in self.browse(cr, uid, ids, context=context): -# text = proof.name -# if proof.synonym_ids: -# text += " [%s]" % proof.synonyms -# result.append((proof.id, text)) -# return result - - -class QcProofSynonym(orm.Model): - """ - Proofs may have synonyms. These are used because suppliers may use - different names for the same proof. - """ - _name = 'qc.proof.synonym' - - _columns = { - 'name': fields.char('Name', size=200, required=True, select="1", - translate=True), - 'proof_id': fields.many2one('qc.proof', 'Proof', required=True), - } - - -class QcTestTemplateCategory(orm.Model): - """ - This model is used to categorize proof templates. - """ - _name = 'qc.test.template.category' - _description = 'Test Template Category' - - def name_get(self, cr, uid, ids, context=None): - if not len(ids): - return [] - reads = self.read(cr, uid, ids, ['name', 'parent_id'], context=context) - res = [] - for record in reads: - name = record['name'] - if record['parent_id']: - name = record['parent_id'][1] + ' / ' + name - res.append((record['id'], name)) - return res - - def _name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None): - res = self.name_get(cr, uid, ids, context=context) - return dict(res) - - def _check_recursion(self, cr, uid, ids): - level = 100 - while len(ids): - cr.execute('SELECT DISTINCT parent_id FROM' - ' qc_test_template_category WHERE id IN (' + - ','.join(map(str, ids)) + ')') - ids = [x[0] for x in cr.fetchall() if x[0] is not None] - if not level: - return False - level -= 1 - return True - - _columns = { - 'name': fields.char('Category Name', required=True, size=64, - translate=True), - 'parent_id': fields.many2one('qc.test.template.category', - 'Parent Category', select=True), - 'complete_name': fields.function(_name_get_fnc, method=True, - type="char", string='Full Name'), - 'child_ids': fields.one2many('qc.test.template.category', 'parent_id', - 'Child Categories'), - 'active': fields.boolean('Active', - help="The active field allows you to hide the" - " category without removing it."), - } - - _constraints = [ - (_check_recursion, - _('Error ! You can not create recursive categories.'), ['parent_id']) - ] - - _defaults = { - 'active': 1, - } - - -class QcTestTemplateTrigger(orm.Model): - _name = 'qc.test.template.trigger' - _description = 'Test Template Trigger' - - _columns = { - 'name': fields.char('Name', size=64, required=True, readonly=False, - translate=True), - 'active': fields.boolean('Active', required=False), - } - - _defaults = { - 'active': 1, - } - - -class QcTestTemplate(orm.Model): - """ - A template is a group of proofs to with the values that make them valid. - """ - _name = 'qc.test.template' - _description = 'Test Template' - - def _links_get(self, cr, uid, context=None): - # TODO: Select models - link_obj = self.pool['res.request.link'] - ids = link_obj.search(cr, uid, [], context=context) - res = link_obj.read(cr, uid, ids, ['object', 'name'], context=context) - return [(r['object'], r['name']) for r in res] - - def _default_name(self, cr, uid, context=None): - if context and context.get('reference_model', False): - if 'reference_id' in context: - source = self.pool[context['reference_model']].browse( - cr, uid, context.get('active_id'), context=context) - if hasattr(source, 'name'): - return source.name - - def _default_object_id(self, cr, uid, context=None): - if context and context.get('reference_model', False): - return '%s,%d' % (context['reference_model'], - context['reference_id']) - else: - return False - - def _default_type(self, cr, uid, context=None): - if context and context.get('reference_model'): - return 'related' - else: - return False - - _columns = { - 'active': fields.boolean('Active', select="1"), - 'name': fields.char('Name', size=200, required=True, translate=True, - select="1"), - 'test_template_line_ids': fields.one2many('qc.test.template.line', - 'test_template_id', 'Lines'), - 'object_id': fields.reference('Reference Object', selection=_links_get, - size=128), - 'fill_correct_values': fields.boolean('Fill With Correct Values'), - 'type': fields.selection([('generic', 'Generic'), - ('related', 'Related')], 'Type', select="1"), - 'category_id': fields.many2one('qc.test.template.category', - 'Category'), - 'trig_on': fields.many2one('qc.test.template.trigger', 'Trigger'), - } - - _defaults = { - 'name': _default_name, - 'active': True, - 'object_id': _default_object_id, - 'type': _default_type, - } - - -class QcTestTemplateLine(orm.Model): - """ - Each test template line has a reference to a proof and the valid - value/values. - """ - _name = 'qc.test.template.line' - _description = 'Test Template Line' - _order = 'sequence asc' - _rec_name = 'sequence' - - def onchange_proof_id(self, cr, uid, ids, proof_id, context=None): - if not proof_id: - return {} - proof = self.pool['qc.proof'].browse(cr, uid, proof_id, - context=context) - return {'value': {'type': proof.type}} - - _columns = { - 'sequence': fields.integer('Sequence', required=True), - 'test_template_id': fields.many2one('qc.test.template', - 'Test Template', select="1"), - 'proof_id': fields.many2one('qc.proof', 'Question', required=True, - select="1"), - 'valid_value_ids': fields.many2many('qc.posible.value', - 'qc_template_value_rel', - 'template_line_id', 'value_id', - 'Answers'), - 'method_id': fields.many2one('qc.proof.method', 'Method', select="1"), - 'notes': fields.text('Notes'), - 'min_value': fields.float('Min', digits=(16, 5)), # Quantitative only - 'max_value': fields.float('Max', digits=(15, 5)), # Quantitative only - 'uom_id': fields.many2one('product.uom', 'Uom'), # Quantitative only - 'type': fields.selection([('qualitative', 'Qualitative'), - ('quantitative', 'Quantitative')], - 'Type', select="1"), - } - - _defaults = { - 'sequence': 1, - } - - -class QcTest(orm.Model): - """ - This model contains an instance of a test template. - """ - _name = 'qc.test' - _inherit = ['mail.thread', 'ir.needaction_mixin'] - - def _success(self, cr, uid, ids, field_name, arg, context=None): - result = {} - for test in self.browse(cr, uid, ids, context=context): - success = False - if len(test.test_line_ids): - success = True - proof = {} - for line in test.test_line_ids: - proof[line.proof_id.id] = (proof.get(line.proof_id.id, - False) - or line.success) - for p in proof: - if not proof[p]: - success = False - break - result[test.id] = success - return result - - def _links_get(self, cr, uid, context=None): - # TODO: Select models - link_obj = self.pool['res.request.link'] - ids = link_obj.search(cr, uid, [], context=context) - res = link_obj.read(cr, uid, ids, ['object', 'name'], context=context) - return [(r['object'], r['name']) for r in res] - - def _default_object_id(self, cr, uid, context=None): - if context and context.get('reference_model', False): - return '%s,%d' % (context['reference_model'], - context['reference_id']) - else: - return False - - _columns = { - 'name': fields.datetime('Date', required=True, readonly=True, - states={'draft': [('readonly', False)]}, - select="1"), - 'object_id': fields.reference('Reference', selection=_links_get, - size=128, readonly=True, - states={'draft': [('readonly', False)]}, - select="1"), - 'test_template_id': fields.many2one('qc.test.template', 'Test', - states={'success': - [('readonly', True)], - 'failed': - [('readonly', True)]}, - select="1"), - 'test_line_ids': fields.one2many('qc.test.line', 'test_id', - 'Test Lines', - states={'success': - [('readonly', True)], - 'failed': - [('readonly', True)]}), - 'test_internal_note': fields.text('Internal Note', - states={'success': - [('readonly', True)], - 'failed': - [('readonly', True)]}), - 'test_external_note': fields.text('External Note', - states={'success': - [('readonly', True)], - 'failed': - [('readonly', True)]}), - 'state': fields.selection([ - ('draft', 'Draft'), - ('waiting', 'Waiting Supervisor Approval'), - ('success', 'Quality Success'), - ('failed', 'Quality Failed'), - ('canceled', 'Canceled'), - ], 'State', readonly=True, select="1"), - 'success': fields.function(_success, method=True, type='boolean', - string='Success', - help='This field will be active if all' - ' tests have succeeded.', select="1", - store=True), - 'enabled': fields.boolean('Enabled', readonly=True, - help='If a quality control test is not' - ' enabled it means it can not be moved from' - ' "Quality Success" or "Quality Failed"' - ' state.', select="1"), - } - _defaults = { - 'name': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), - 'state': 'draft', - 'object_id': _default_object_id, - 'enabled': True, - } - - def copy(self, cr, uid, copy_id, default=None, context=None): - if context is None: - context = {} - if default is None: - default = {} - default['name'] = time.strftime('%Y-%m-%d %H:%M:%S') - return super(QcTest, self).copy(cr, uid, copy_id, default, - context=context) - - def create(self, cr, uid, datas, context=None): - if context and context.get('reference_model', False): - datas['object_id'] = (context['reference_model'] + "," + - str(context['reference_id'])) - return super(orm.Model, self).create(cr, uid, datas, context=context) - - def qc_test_success(self, cr, uid, ids, context=None): - self.write(cr, uid, ids, { - 'state': 'success' - }, context=context) - return True - - def qc_test_failed(self, cr, uid, ids, context=None): - self.write(cr, uid, ids, { - 'state': 'failed' - }, context=context) - return True - - def test_state(self, cr, uid, ids, mode, *args): - quality_check = False - if mode == 'failed': - return not quality_check - if mode == 'success': - return quality_check - return False - - def set_test_template(self, cr, uid, ids, template_id, force_fill=False, - context=None): - if context is None: - context = {} - test_obj = self.pool['qc.test'] - test_line_obj = self.pool['qc.test.line'] - for test_id in ids: - test_obj.write(cr, uid, test_id, {'test_template_id': template_id}, - context) - test = test_obj.browse(cr, uid, test_id, context=context) - if len(test.test_line_ids) > 0: - test_line_obj.unlink(cr, uid, - [x.id for x in test.test_line_ids], - context=context) - test_lines = self._prepare_test_lines( - cr, uid, test, force_fill=force_fill, context=context) - if test_lines: - test_obj.write(cr, uid, id, {'test_line_ids': test_lines}, - context) - - def _prepare_test_lines(self, cr, uid, test, force_fill=False, - context=None): - new_data = [] - fill = test.test_template_id.fill_correct_values - for line in test.test_template_id.test_template_line_ids: - data = self._prepare_test_line( - cr, uid, test, line, fill=fill or force_fill, context=context) - new_data.append((0, 0, data)) - return new_data - - def _prepare_test_line(self, cr, uid, test, line, fill=None, context=None): - data = {} - data = {'test_id': test.id, - 'method_id': line.method_id.id, - 'proof_id': line.proof_id.id, - 'test_template_line_id': line.id, - 'notes': line.notes, - 'min_value': line.min_value, - 'max_value': line.max_value, - 'uom_id': line.uom_id.id, - 'test_uom_id': line.uom_id.id, - 'proof_type': line.type, - } - if fill: - if line.type == 'qualitative': - # Fill with the first correct value found. - data['actual_value_ql'] = ( - len(line.valid_value_ids) and - line.valid_value_ids[0] and - line.valid_value_ids[0].id or False) - else: - # Fill with value inside range. - data['actual_value_qt'] = line.min_value - data['test_uom_id'] = line.uom_id.id - data['valid_value_ids'] = [(6, 0, [x.id for x in - line.valid_value_ids])] - return data - - -class QcTestLine(orm.Model): - """ - Each test line has a value and a reference to a proof template line. - """ - _name = 'qc.test.line' - _rec_name = 'proof_id' - - def quality_test_check(self, cr, uid, ids, field_name, field_value, - context=None): - res = {} - lines = self.browse(cr, uid, ids, context=None) - for line in lines: - if line.proof_type == 'qualitative': - res[line.id] = self.quality_test_qualitative_check( - cr, uid, line, context=None) - else: - res[line.id] = self.quality_test_quantitative_check( - cr, uid, line, context=None) - return res - - def quality_test_qualitative_check(self, cr, uid, test_line, context=None): - if test_line.actual_value_ql in test_line.valid_value_ids: - return test_line.actual_value_ql.ok - else: - return False - - def quality_test_quantitative_check(self, cr, uid, test_line, - context=None): - amount = self.pool['product.uom']._compute_qty( - cr, uid, test_line.uom_id.id, test_line.actual_value_qt, - test_line.test_uom_id.id) - if amount >= test_line.min_value and amount <= test_line.max_value: - return True - else: - return False - - _columns = { - 'test_id': fields.many2one('qc.test', 'Test'), - 'test_template_line_id': fields.many2one('qc.test.template.line', - 'Test Template Line', - readonly=True), - 'proof_id': fields.many2one('qc.proof', 'Question', readonly=True), - 'method_id': fields.many2one('qc.proof.method', 'Method', - readonly=True), - 'valid_value_ids': fields.many2many('qc.posible.value', - 'qc_test_value_rel', - 'test_line_id', 'value_id', - 'Answers'), - 'actual_value_qt': fields.float('Qt.Value', digits=(16, 5), - help="Value of the result if it is a" - " quantitative proof."), - 'actual_value_ql': fields.many2one('qc.posible.value', 'Ql.Value', - help="Value of the result if it is" - " a qualitative proof."), - 'notes': fields.text('Notes', readonly=True), - 'min_value': fields.float('Min', digits=(16, 5), readonly=True, - help="Minimum valid value if it is a" - " quantitative proof."), - 'max_value': fields.float('Max', digits=(16, 5), readonly=True, - help="Maximum valid value if it is a" - " quantitative proof."), - 'uom_id': fields.many2one('product.uom', 'Uom', readonly=True, - help="UoM for minimum and maximum values if" - " it is a quantitative proof."), - 'test_uom_id': fields.many2one('product.uom', 'Uom Test', - help="UoM of the value of the result" - " if it is a quantitative proof."), - 'proof_type': fields.selection([('qualitative', 'Qualitative'), - ('quantitative', 'Quantitative')], - 'Proof Type', readonly=True), - 'success': fields.function(quality_test_check, type='boolean', - method=True, string="Success?", select="1"), - } - - def onchange_actual_value_qt(self, cr, uid, ids, uom_id, test_uom_id, - actual_value_qt, min_value, max_value, - context=None): - res = {} - if actual_value_qt: - amount = self.pool['product.uom']._compute_qty(cr, uid, uom_id, - actual_value_qt, - test_uom_id) - if amount >= min_value and amount <= max_value: - res['success'] = True - else: - res['success'] = False - return {'value': res} - - def onchange_actual_value_ql(self, cr, uid, ids, actual_value_ql, - valid_value_ids, context=None): - res = {} - value_obj = self.pool['qc.posible.value'] - if actual_value_ql: - valid = valid_value_ids[0][2] - if actual_value_ql in valid: - value = value_obj.browse(cr, uid, actual_value_ql, context) - res['success'] = value.ok - else: - res['success'] = False - return {'value': res} diff --git a/quality_control/security/ir.model.access.csv b/quality_control/security/ir.model.access.csv index e1396873f..42ef2d392 100644 --- a/quality_control/security/ir.model.access.csv +++ b/quality_control/security/ir.model.access.csv @@ -1,13 +1,17 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_user_qc_test,qc_test,quality_control.model_qc_test,quality_control.group_quality_control_user,1,1,1,1 -access_user_qc_test_line,qc_test_line,quality_control.model_qc_test_line,quality_control.group_quality_control_user,1,1,1,1 -access_user_qc_test_template,qc_test_template user,quality_control.model_qc_test_template,quality_control.group_quality_control_user,1,0,0,0 -access_user_qc_test_template_line,qc_test_template_line user,quality_control.model_qc_test_template_line,quality_control.group_quality_control_user,1,0,0,0 -access_manager_qc_test_template,qc_test_template manager,quality_control.model_qc_test_template,quality_control.group_quality_control_manager,1,1,1,1 -access_manager_qc_test_template_line,qc_test_template_line manager,quality_control.model_qc_test_template_line,quality_control.group_quality_control_manager,1,1,1,1 -access_manager_qc_proof_method,qc_proof_method,quality_control.model_qc_proof_method,quality_control.group_quality_control_manager,1,1,1,1 -access_manager_qc_posible_value,qc_posible_value,quality_control.model_qc_posible_value,quality_control.group_quality_control_manager,1,1,1,1 -access_manager_qc_proof,qc_proof,quality_control.model_qc_proof,quality_control.group_quality_control_manager,1,1,1,1 -access_manager_qc_proof_synonym,qc_proof_synonym,quality_control.model_qc_proof_synonym,quality_control.group_quality_control_manager,1,1,1,1 -access_manager_qc_test_template_category,qc_test_template_category,quality_control.model_qc_test_template_category,quality_control.group_quality_control_manager,1,1,1,1 -access_manager_qc_test_template_trigger,qc_test_template_trigger,quality_control.model_qc_test_template_trigger,quality_control.group_quality_control_manager,1,1,1,1 +access_user_qc_inspection,qc_inspection,quality_control.model_qc_inspection,quality_control.group_quality_control_user,1,1,1,1 +access_user_qc_inspection_line,qc_inspection_line,quality_control.model_qc_inspection_line,quality_control.group_quality_control_user,1,1,1,1 +access_user_qc_test,qc_test user,quality_control.model_qc_test,quality_control.group_quality_control_user,1,0,0,0 +access_user_qc_test_question,qc_test_question user,quality_control.model_qc_test_question,quality_control.group_quality_control_user,1,0,0,0 +access_manager_qc_test,qc_test manager,quality_control.model_qc_test,quality_control.group_quality_control_manager,1,1,1,1 +access_manager_qc_test_question,qc_test_question manager,quality_control.model_qc_test_question,quality_control.group_quality_control_manager,1,1,1,1 +access_manager_qc_test_question_value,qc_test_question_value,quality_control.model_qc_test_question_value,quality_control.group_quality_control_manager,1,1,1,1 +access_manager_qc_test_category,qc_test_category,quality_control.model_qc_test_category,quality_control.group_quality_control_manager,1,1,1,1 +access_manager_qc_trigger_user,qc_trigger user,quality_control.model_qc_trigger,quality_control.group_quality_control_user,1,0,0,0 +access_manager_qc_trigger_manager,qc_trigger manager,quality_control.model_qc_trigger,quality_control.group_quality_control_manager,1,1,1,1 +access_manager_qc_trigger_product_category_line_user,qc_trigger product_category line user,quality_control.model_qc_trigger_product_category_line,,1,0,0,0 +access_manager_qc_trigger_product_category_line_manager,qc_trigger product_category line manager,quality_control.model_qc_trigger_product_category_line,quality_control.group_quality_control_user,1,1,1,1 +access_manager_qc_trigger_product_template_line_user,qc_trigger product_template line user,quality_control.model_qc_trigger_product_template_line,,1,0,0,0 +access_manager_qc_trigger_product_template_line_manager,qc_trigger product_template line manager,quality_control.model_qc_trigger_product_template_line,quality_control.group_quality_control_user,1,1,1,1 +access_manager_qc_trigger_product_line_user,qc_trigger product line user,quality_control.model_qc_trigger_product_line,,1,0,0,0 +access_manager_qc_trigger_product_line_manager,qc_trigger product line manager,quality_control.model_qc_trigger_product_line,quality_control.group_quality_control_user,1,1,1,1 diff --git a/quality_control/security/quality_control_security.xml b/quality_control/security/quality_control_security.xml index 2efdaaf2f..57bca9d5e 100644 --- a/quality_control/security/quality_control_security.xml +++ b/quality_control/security/quality_control_security.xml @@ -1,6 +1,10 @@ - + + + + Quality control + User @@ -14,5 +18,26 @@ + + Quality control test multi-company + + + ['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])] + + + + Quality control inspection multi-company + + + ['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])] + + + + Quality control trigger multi-company + + + ['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])] + + diff --git a/quality_control/static/description/icon.png b/quality_control/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..e0aa80bcee2e5b2f7ef001921c947ec999f9578d GIT binary patch literal 7121 zcmV;?8!qIDP)gH?Arx10earlt+Dk!?GG zemCBsD`0rrV#8~Dw`A9e)s0C@^9*bhmJp+5AoRWd9s{auHh%K1tr^u0Q{DyKQU(w= zGcAY{Yy|*DN|&N5MC=Wo$LgJ%vT6We)~s2^W{dYi;_xRBhDg<9z+QvJ|IWO;kIlL( z?;>s)14v3rGFS{jIbfJ3vx*HsF@R=(Mgz=WUN!opAUAuFIxXD~-qi}|MZ~c2Z-F6A zK@|=_UjY39W|UuzjU6x~y0N0HbdN$6-I80u09bs=!sP%hb>cIp_Zu8_sIsi|loOxn z5Zt#5NKfYy3X1L(2zN1{7Z|(D7+ofTT_#Sr%n@v0Tp$rW1R&7`8d@1+|9~KT3UKEE zzy|cim zS1TaKl;j0-ZlRA40O7>ppGZ%4yT7;FDFgsu^pLAn&>I4cO4xN|l&kgVirX1LQc{wE zfxFAqdN>4uOLDaeU2!`D=;VXO0Tk$JJsbl~cC`jwaXSNG98z4ZgQFl|lB;#-iow+i z*h49LPfonOy)d9(1o}mWqhCZgLV^R~;o$)0BY-D>Dz%R54(hIlo15BE=Aktt(F1lUF>7J0_Ak3LL z4KtII&_6OP~{w&F-}saA0-JS_fyatG&-%MD;k>ikd!?k6C620(}! z83PAI;<1PC$DLE-z%j?a(wVYz_#$&Ha<=S%AP8#3)Pdo1FfOAYF17&a>8b^3!6gQe zn3^`oO13l(xR-#*P&pX&F?r)>iyp*+yYB+eJAYZDr1T_S|NCm3JgvD)KhMCv76jqT z!Y$dm0gw*r$- z7M&dy2#@aCoOwtGVLd<184m$~Dai}oV+@aLmE-H{gJr+{FC^2_aL>#(8OYy|)q4IE5H9^nB-4D4;f@V-8nIJg%Egm}w-M(u@5cyYxl96feI z@jHo72UtfJ2ho83rgL|96BnFy1&m$r32QYei;=tjf>K^(XjG>~ktn@#cgvh`tegF<=(lV+U z6B~uU{`vRtF_|RGTyE~ftLx8V{gI2RKX`W>JKut*zc`LTy-oPTy+bf*NPuM7hwh&b zgNFfsfA?e6&m%xIa8+-d(gH*bi?uSMC)L!AjUItjE0@FME!`hy@4tX2K0Suws%F(X z%B8W*f^QC8L}i^BlZOPr(;z;9iH#Zoo;Tp2%9el;GAheTcWcpA4o)$Esx!yx`wxlw zIRHN;^}_muV%5s!@b?q%e_PB}{66C(-p{KG zap`hBPM$7P{s4w|D$7cB8BunJ6BmP6zLL^LqbFW@={d=1UPWCy?)&>8Y%IE@N}FCL z1O7OF7*;(Lg~%W;RWhm@%y{_SBgouWD_Q30Cm+YC80F4Qf#Z*kUOS&bc+%2g|+0H+xMBUH&PJ88mL%$u7kdhdK=2OfRD2sMozs&yIK$Ap=q zdVl}_=~2NL5-L5w>_02M{cz@tM8r+J zL#{YeV(Pv9dM>6Nrx-v|Qj&p4UXbUH(&nL0sJN~CA@dYY)U;~SB|N~0xno1^uHQW_ z6d`_|nq*sSgx{_yl{C;Ne!d7E26;1Y8}UmtDI*hy8^Ektvy7b{fu91H&{Nsqpg{ci z{`sQ!zCC;qn^X??uIG`22pD+#*2UAn;ep9vn&mgNTJS>VNzr=)`bA*wtYo>Oo=!+z zc(-PSdcdIu5SP4g+!d?$VFvb~obvb0n+;D-54-CPtro2K=8R^20)0Gi-$dz;{NUtp zczbG}85f*vz}kc2JINn@V7}Z|z=Mdg6H*tXJ2ITyVS?jR7W|xJlnqr?glV%#{A$Z$qTXpybD0~&^mcq0{ndK9X{0!W_-O@dY&y8A0v++#q}H| zv}kGsI8OT-*`?-AtSJ;<%$q-VrXpDcJkUyQ`BSDZ7@%3PF6e3iYWxM=xPAo9UhASj8j^#Z=c?XjUHily{*%REQz_b5^gK^4J10B>Mwta7aQq^HA}{#s=gi74IQYeH>0}2jH-GwYMVL~ zwMgF_x`2D`u%C8L{=qnW^7+@Y<$MoeMr!KAJ~=s`X`2s!hpq;|h@By(yt%$(Y^><@ z++zD*&ozei@xkmdy%82*L|C8^eR~-Z>TiUH$P`ZvWBU7HOn-a#txX`*Hg%x7!Hnwq z4pcRmarR;xwj8SyHHj`!zcOn`J)7Z zu=`9SW{$eixn(f$h>04G{Rfrq7^khfc4f4yP+b&V#{hYG8MOpjrld|Ue?RmN39`Fh zdcFm%9pcS@-(E(SeEjb4_m=)GNx6rI3{*U*7Z`_Ulve5v-KT-!0fzSh$j+Z5wSnV! zH!k0bx^`S>Qok6aH|HBW@UK1MtAW5(V-}--KZToD2w&uH%08m3QupX?02vt>HlFbh zf*>nACo)3ZGgp48O|njhRlvjV9>KZGy0wI=IbPF>2j4o>?E+Q#C2>9bDcHTlfF>(h zpHi$~4>-gVxFaXyEEs!DPT7C}@!>*sL-)V%^Nk&N)B7l*WPpu7n`U0sB_7E8C~ z8rv+Q-B~~{nVIPTfY{1CTh?ly6L-O3u3*8&eJH1#x0iS{PHRWcuHU*A3l^;|!r^mQ zlqshJTT1G%_`~Aw_ZIYom;rPb=Xe8zW-?jcQlg(+9A*GlQ>s#rU&iDuZUAC_bTOLE zRxJLg7zHOAlqslz>;o6@+s{iC#UZwc7>daxd*jLeg0*WM67lLV14x)NCs0=QO^FzL zC86Ezoi;r2X$f+=@f+yHC;8P_o_SK$MibR=knassEZR|6yu=swyU^AqK0xwOIL))z z2v2`;99jFdFC0m+YU5eFx~@#sz5`z``)Q)oyW2sS5Eqvwf1jEH9AW_D$3N~tBrkJk zyII^5W>PWF7X(6j)+v0|&6G?nudP3e54Xz>YqUe`ecIY(&td|2UqSP}N--Q_0A7KY zehry%09USvcWse@>O!>z0$$&6R`=aOn@iMpF99YGQOA|kyNf|YFU6YeNN)tMPcw`%p+a35)$Zc z0L*5434pzCR|2U&!mvK-4Im~$Q4GE;m&^Tw)HLU-TK(&rh|#KPE!`$C6^C1_O}VNLpS|sZeJ z6Q|Usl<|sa@>2XGlR{SmAdsrm7*boPlVgHmQW&NkN7`G~ zhzH&}gcq|<-4IaHY_?+6##+x5CVOA9{2bfd4vbpdk`z@%y{ba zQatv-Q5>t5w#k~t4m|hO3H;*YVw}2Q-_1q_dCOj-SUP(!{6zf!H5V>o)0XYBWB@oT zFfOrhbJhz74y^7z=s+b7-5Z#{DfI{EbzK?mS+yUVj$W4S9xgc9fQ5fMgg^cJH0rwqdlimxg`Qhs#}n;uNDFU2A<*VE$48ky!#M` z5I;|Rw0M+gOHosM5wHCBJFwY$HULJnupl>Eb5`mepX2BU0Knwr`B6M$vIZ~S-dJ2C440cL_ z2#%AV^RB(!jQ@W7Bhh=lUIu)$cr?NS6dd&FBp3r;P8%-y@plyLk^Aw1tAl5!M4ULq z02pUbl+k%d!5(CPvq|(`sJ|!Pd?ZHHyXH!sOc^LSTdBEl5i4GQTZyHaF^s!oP_~W17Ky!=i88HBO z+4x}l?NScFIR-#byrtPmjC$;basmSK^VK5_U%8v8IP$W9N!v* z`g>y4Ls59^Cou^2m0lfOw`nUr_~Z*MkBZV#SuRf5VcCD^$asLM%7_2}Rp)E4_rPJ? z89xbLUg9$Ve{TckjtxcJut3zeSWr=??^Lm0uor$ab0A*2Z@6TH&o$op@Sk}5{ZF+% zvZk`ERI`wtaMF1Jv0$J_w8*$zSC4%Mix4;Q4*2>=hl_;;7%^vTDDJ(Z4+2ddsB5vH zp;et1)!*BISz~%*>72n>I%f!CBmH3LCV!C4X2aVbe1y}n>w)TbmI+2#n8r zswYMb5x#+dmkYOMozp|Vo^Z*raq%hlgoF6W zU~B?_sQ}{D=n@ndfL|_t1gSF;C694&B<1I-@cNspap*{iS`jrM>>!{39BnJi$rg`| zb0981I1&I7QWs7lqHF-Fa8~@F{^m>-hX^?a zw=w_#h)-E?0>E%r>){~I7UX8>n(9?6&UK*6fCyi?S_cOrI~dSexSatQIQ}C5E*%*= z42F%aR-r3yX8=2LGR}hB@0X$jHs;Zh<7y?k;&uiA0K`F2_{_}!12*TcTj#t?Rx)u* z11QYN`kDb>x>^qzv@@WPKwH3Y2GU*EMF{GS&UG|Si91t6SOEXy^NqGVBHYC>coV1= zU=@sTobfnr1z*m{8V+KM81Nf7X=U?!7&1AYU$S#U#`h;#rKUdY(_(9l2FFHlOc+VT z1%re$9M9J5%+1z6agh$V-84`Q@u~A400PY zYY0F9qs0euGsN@1--O%}UBETITUFcvKq^?zN`%$m=*7aE>>KuH$EPfu4Mu+hp}P?F zmkM&Tmg}al8*oz@!0@NGg?M@xVnGxIzB8-%KPhREm&N1CQUJ@)<;Xh*Y|4)xJzH$~cJwpbA_b0%7l4xntNCQnYcpM!!dxLY zg#iqIYFmhh2VV-{`VE8sDp{HMfLQs2)P<7-qF*wGFc8i#CcK}Y^X~(4pO=_=Z$E+f z7l~mO2s~r>+R*9$yS%)QMU(o(EZeaGz+Kl}D(~%O8w2AmEht_&HQNH@BmWX3MwZp4*{3sh~d%Ub+9483-(n&Q?DBe!=1af0m!GK= zk7iHHH~M_PW# z+PeY9ZX19ahW={35yVDom!zRDXH5G*5biw?bXx=P^z|DH>A()z2%P%SJPA6?1c1J= z&u>?^JJkuetpPC7rSEJvT{fvan+5PN81ygzKyY7wfZG~?PJ^eS1FI*f&a;2yFH@=k zXb$HlaJLOWIh^*sQDvMT8lhDV=`o5YT?T^Vkxp*;w{}aV zEN1Qw=&)2xOuI8j%OLVPdX4JHbIY6uZfO7@U8YX0v8OI+K5@efOb?GB1i|2z-GF-< zfIfq!Lm3%A)Vy`;(2B%Mka_S`w=nng2)d^M=<&xQ=re`8iXN@NZ3B=))bDqML4MSY zB&5f3?loEZ#0HEV`m6PBch-&D831P!4*^$-LEv>X0A0obMsFX#SRLf(irX0gIFd2| zGk`n-O9!Jx0J__t*<56bSAI-~1jITHq5DIe8UXf7F!mM$E0!v2Bf;&KhTSnH@LD{5 z6M&rn%jba2BhS_^W2VoAmjoFx066@Khl|QiKdRPNUn=nw&M(dp(3}dIA%*Z zx?ak34NIV(5gX8-uWEnolu zQ2cW81r96;z#af~M^`3@A2_H1!Du^xt69JbJ-mf!MX$wQ?5WPpz%5|_0C05W)CP1I zW&`xDBesT>q)%%h(3`xqJ@s( + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/quality_control/views/product_category_view.xml b/quality_control/views/product_category_view.xml new file mode 100644 index 000000000..a8013ce30 --- /dev/null +++ b/quality_control/views/product_category_view.xml @@ -0,0 +1,25 @@ + + + + + + product.category.qc + product.category + + + + + + + + + + + + + + + + + + diff --git a/quality_control/views/product_template_view.xml b/quality_control/views/product_template_view.xml new file mode 100644 index 000000000..b60c74b14 --- /dev/null +++ b/quality_control/views/product_template_view.xml @@ -0,0 +1,25 @@ + + + + + + product.template.qc + product.template + + + + + + + + + + + + + + + + + + diff --git a/quality_control/views/qc_inspection_view.xml b/quality_control/views/qc_inspection_view.xml new file mode 100644 index 000000000..03e0506a1 --- /dev/null +++ b/quality_control/views/qc_inspection_view.xml @@ -0,0 +1,245 @@ + + + + + + qc.inspection.form + qc.inspection + +
+
+
+ +

+

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+
+
+
+ + + qc.inspection.tree + qc.inspection + + + + + + + + + + + + + qc.inspection.search + qc.inspection + + + + + + + + + + + + + + + + + + + + + + + + + + Inspections + qc.inspection + form + tree,form + + + + + + qc.inspection.line.tree + qc.inspection.line + + + + + + + + + + + + + + + + + + + qc.inspection.line.search + qc.inspection.line + + + + + + + + + + + + + + + + + + + + + + + + Inspection lines + qc.inspection.line + form + tree,form + + + +
+
+ diff --git a/quality_control/views/qc_menus.xml b/quality_control/views/qc_menus.xml new file mode 100644 index 000000000..b4145b022 --- /dev/null +++ b/quality_control/views/qc_menus.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + diff --git a/quality_control/views/qc_test_category_view.xml b/quality_control/views/qc_test_category_view.xml new file mode 100644 index 000000000..94765388b --- /dev/null +++ b/quality_control/views/qc_test_category_view.xml @@ -0,0 +1,33 @@ + + + + + + qc.test.category.tree + qc.test.category + + + + + + + + + + + + Test categories + qc.test.category + form + tree,form + + + + + + diff --git a/quality_control/views/qc_test_view.xml b/quality_control/views/qc_test_view.xml new file mode 100644 index 000000000..c753fe958 --- /dev/null +++ b/quality_control/views/qc_test_view.xml @@ -0,0 +1,127 @@ + + + + + + qc.test.form + qc.test + +
+ + +
+
+
+ + + qc.test.tree + qc.test + + + + + + + + + + + + + Tests + qc.test + form + tree,form + + + + qc.test.question.form + qc.test.question + +
+
+ + + +
+
+ diff --git a/quality_control/views/qc_trigger_view.xml b/quality_control/views/qc_trigger_view.xml new file mode 100644 index 000000000..254dccf92 --- /dev/null +++ b/quality_control/views/qc_trigger_view.xml @@ -0,0 +1,34 @@ + + + + + + qc.trigger.form + qc.trigger + +
+ + + + + + + +
+
+
+ + + qc.trigger.tree + qc.trigger + + + + + + + + +
+
+ diff --git a/quality_control/views/quality_control_view.xml b/quality_control/views/quality_control_view.xml deleted file mode 100644 index a09275c3d..000000000 --- a/quality_control/views/quality_control_view.xml +++ /dev/null @@ -1,552 +0,0 @@ - - - - - - - - - - - qc.proof.method.form - qc.proof.method - -
- - - - -
-
-
- - qc.proof.method.tree - qc.proof.method - - - - - - - - Methods - qc.proof.method - form - tree,form - - - - - - - qc.posible.value.form - qc.posible.value - -
- - - - - -
-
-
- - qc.posible_value.tree - qc.posible.value - - - - - - - - - Posible Values - qc.posible.value - form - tree,form - - - - - - - qc.test.template.trigger.form - qc.test.template.trigger - -
- - - - -
-
-
- - qc.test.template.trigger.tree - qc.test.template.trigger - - - - - - - - Template Trigger - qc.test.template.trigger - form - tree,form - - - - - - - qc.proof.synonym - qc.proof.synonym - -
- - - - -
-
-
- - qc.proof.synonym.tree - qc.proof.synonym - - - - - - - - - Synonym - qc.proof.synonym - form - tree,form - - - - - - - qc.proof.form - qc.proof - -
- - - - - - - - - - - - - - -
-
-
- - qc.proof.tree - qc.proof - - - - - - - - - - Proof - qc.proof - form - tree,form - - - - - - qc.test.template.category.form - qc.test.template.category - -
- - - - - - - - - - -
-
-
- - - qc.test.template.category.tree - qc.test.template.category - - - - - - - - - - - - Test Template Category - qc.test.template.category - form - tree,form - - - - - - - - - qc.test.template.form - qc.test.template - 8 - -
- -

- -

- - - - - - - - - - - - - -
-
-
-
- - qc.test.template_tree - qc.test.template - - - - - - - - - - - - Test Template - qc.test.template - form - tree,form - - - - - - - qc.test.template.line.form - qc.test.template.line - form - -
- - - - - - - - - - - - - - - - - - -
-
- - qc.test.template,line.tree - qc.test.template.line - tree - - - - - - - - - - - - - - - - - Test Template Line - qc.test.template.line - form - tree,form - - - - - - - - qc.test.form - qc.test - form - -
-
-
- -
-
-
-
- - - - - - - - - - - - - - - -
- - - - -
-
-
- - -
-
-
-
- - qc.test.tree - qc.test - tree - - - - - - - - - - - qc.test.extended.search.vieww - qc.test - - - - - - - - - - - - - - - - - - - - - - - Test - qc.test - form - tree,form - - - - - - - qc.test.line.form - qc.test.line - form - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- - qc.test.line.tree - qc.test.line - tree - - - - - - - - - - - - - - - - - - Test Line - qc.test.line - form - tree,form - - - - -
-
- diff --git a/quality_control/wizard/__init__.py b/quality_control/wizard/__init__.py index 7e105bf3f..64c91e557 100644 --- a/quality_control/wizard/__init__.py +++ b/quality_control/wizard/__init__.py @@ -1,31 +1,5 @@ # -*- encoding: utf-8 -*- ############################################################################## -# -# Copyright (c) 2010 NaN Projectes de Programari Lliure, S.L. -# All Rights Reserved. -# http://www.NaN-tic.com -# -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability of assessing all potential -# consequences resulting from its eventual inadequacies and bugs -# End users who are looking for a ready-to-use solution with commercial -# garantees and support are strongly adviced to contract a Free Software -# Service Company -# -# This program is Free Software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# +# For copyright and license notices, see __openerp__.py file in root directory ############################################################################## - from . import qc_test_wizard diff --git a/quality_control/wizard/qc_test_wizard.py b/quality_control/wizard/qc_test_wizard.py index 6a8b03a21..0545f1429 100644 --- a/quality_control/wizard/qc_test_wizard.py +++ b/quality_control/wizard/qc_test_wizard.py @@ -1,70 +1,23 @@ # -*- coding: utf-8 -*- ############################################################################## -# -# Copyright (c) 2010 NaN Projectes de Programari Lliure, S.L. -# All Rights Reserved. -# http://www.NaN-tic.com -# -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability of assessing all potential -# consequences resulting from its eventual inadequacies and bugs -# End users who are looking for a ready-to-use solution with commercial -# garantees and support are strongly adviced to contract a Free Software -# Service Company -# -# This program is Free Software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# +# For copyright and license notices, see __openerp__.py file in root directory ############################################################################## - -from openerp.osv import orm, fields +from openerp import models, fields, api -class QcTestWizard(orm.TransientModel): +class QcInspectionSetTest(models.TransientModel): + """This wizard is responsible for setting the test for a given + inspection. This will not only fill in the 'test' field, but will + also fill in all lines of the inspection with the corresponding lines of + the template. """ - This wizard is responsible for setting the proof template for a given test. - This will not only fill in the 'test_template_id' field, but will also fill - in all lines of the test with the corresponding lines of the template. - """ - _name = 'qc.test.set.template.wizard' + _name = 'qc.inspection.set.test' - def _default_test_template_id(self, cr, uid, context=None): - test = self.pool['qc.test'].browse( - cr, uid, context.get('active_id', False), context=context) - cond = [('object_id', '=', test.object_id.id)] - ids = self.pool['qc.test.template'].search(cr, uid, cond, - context=context) - return ids and ids[0] or False + test = fields.Many2one(comodel_name='qc.test', string='Test') - _columns = { - 'test_template_id': fields.many2one('qc.test.template', 'Template'), - } - - _defaults = { - 'test_template_id': _default_test_template_id, - } - - def action_create_test(self, cr, uid, ids, context=None): - wizard = self.browse(cr, uid, ids[0], context=context) - self.pool['qc.test'].set_test_template(cr, uid, [context['active_id']], - wizard.test_template_id.id, - context=context) - return { - 'type': 'ir.actions.act_window_close', - } - - def action_cancel(self, cr, uid, ids, context=None): - return { - 'type': 'ir.actions.act_window_close', - } + @api.multi + def action_create_test(self): + inspection_obj = self.env['qc.inspection'] + inspection_obj.browse(self.env.context['active_id']).set_test( + self.test) + return True diff --git a/quality_control/wizard/qc_test_wizard_view.xml b/quality_control/wizard/qc_test_wizard_view.xml index e88c6bc35..4c86f4738 100644 --- a/quality_control/wizard/qc_test_wizard_view.xml +++ b/quality_control/wizard/qc_test_wizard_view.xml @@ -1,31 +1,32 @@ - - - qc.test.set.template.wizard - qc.test.set.template.wizard + + qc.inspection.set.test.form + qc.inspection.set.test -
+ - +
- - Select Test Template + + Select test ir.actions.act_window - qc.test.set.template.wizard + qc.inspection.set.test form form new diff --git a/quality_control/workflow/test_workflow.xml b/quality_control/workflow/test_workflow.xml deleted file mode 100644 index 0dcb9a7f5..000000000 --- a/quality_control/workflow/test_workflow.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - quality.control.basic - qc.test - True - - - - - - True - draft - function - write({'state': 'draft'}) - subflow.draft - - - - canceled - function - write({'state': 'canceled'}) - subflow.waiting - - - - waiting - function - write({'state': 'waiting'}) - subflow.waiting - - - - success - function - write({'state': 'success'}) - subflow.success - - - - failed - function - write({'state': 'failed'}) - subflow.failed - - - - - - - confirm - - - - - not success - approve - - - - - success - approve - - - - - cancel - - - - - enabled - cancel - - - - - enabled - cancel - - - - - enabled - draft - - -