mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
New module <quality_control_hr> closes #662 * Changes in access rules * Trigger line instead of test and user
This commit is contained in:
@@ -6,8 +6,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 8.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-10 22:13+0000\n"
|
||||
"PO-Revision-Date: 2014-12-10 22:13+0000\n"
|
||||
"POT-Creation-Date: 2015-02-24 16:01+0000\n"
|
||||
"PO-Revision-Date: 2015-02-24 16:01+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -47,8 +47,8 @@ msgid "Approve"
|
||||
msgstr "Aprobar"
|
||||
|
||||
#. module: quality_control
|
||||
#: field:qc.inspection,auto_generated:0
|
||||
#: view:qc.inspection:quality_control.qc_inspection_search_view
|
||||
#: field:qc.inspection,auto_generated:0
|
||||
msgid "Auto-generated"
|
||||
msgstr "Auto-generada"
|
||||
|
||||
@@ -61,13 +61,18 @@ msgstr "Cancelar"
|
||||
#. module: quality_control
|
||||
#: selection:qc.inspection,state:0
|
||||
msgid "Cancelled"
|
||||
msgstr ""
|
||||
msgstr "Cancelado"
|
||||
|
||||
#. module: quality_control
|
||||
#: field:qc.test,category:0
|
||||
msgid "Category"
|
||||
msgstr "Categoría"
|
||||
|
||||
#. module: quality_control
|
||||
#: field:qc.test.category,child_ids:0
|
||||
msgid "Child categories"
|
||||
msgstr "Categorías hijas"
|
||||
|
||||
#. module: quality_control
|
||||
#: field:qc.inspection,company_id:0
|
||||
#: field:qc.test,company_id:0
|
||||
@@ -80,6 +85,11 @@ msgstr "Compañía"
|
||||
msgid "Confirm"
|
||||
msgstr "Confirmar"
|
||||
|
||||
#. module: quality_control
|
||||
#: help:qc.inspection.line,test_uom_category:0
|
||||
msgid "Conversion between Units of Measure can only occur if they belong to the same category. The conversion will be made based on the ratios."
|
||||
msgstr "La conversión entre las unidades de medidas sólo pueden ocurrir si pertenecen a la misma categoría. La conversión se basará en los ratios establecidos."
|
||||
|
||||
#. module: quality_control
|
||||
#: view:qc.inspection:quality_control.qc_inspection_search_view
|
||||
#: view:qc.inspection.line:quality_control.qc_inspection_line_search_view
|
||||
@@ -140,7 +150,7 @@ msgstr "Borrador"
|
||||
#. module: quality_control
|
||||
#: model:ir.model,name:quality_control.model_qc_inspection
|
||||
msgid "Email Thread"
|
||||
msgstr "Inspeción creada"
|
||||
msgstr "Hilo de mensajes"
|
||||
|
||||
#. module: quality_control
|
||||
#: code:addons/quality_control/models/qc_test_category.py:35
|
||||
@@ -176,6 +186,22 @@ msgstr "Agrupar por..."
|
||||
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 chatter (nº de mensajes, ...). Este resumen está directamente en formato html para ser insertado en vistas kanban."
|
||||
|
||||
#. module: quality_control
|
||||
#: 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.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 "ID"
|
||||
|
||||
#. module: quality_control
|
||||
#: help:qc.inspection,auto_generated:0
|
||||
msgid "If an inspection is auto-generated, it can be cancelled nor removed"
|
||||
@@ -352,6 +378,7 @@ msgid "Pre-fill with correct values"
|
||||
msgstr "Pre-rellenar con valores correctos"
|
||||
|
||||
#. module: quality_control
|
||||
#: 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
|
||||
@@ -362,10 +389,14 @@ msgstr "Producto"
|
||||
|
||||
#. module: quality_control
|
||||
#: 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
|
||||
#: model:ir.model,name:quality_control.model_product_template
|
||||
msgid "Product Template"
|
||||
msgstr "Plantilla de producto"
|
||||
|
||||
#. module: quality_control
|
||||
#: help:qc.inspection,product:0
|
||||
#: help:qc.inspection.line,product:0
|
||||
@@ -406,6 +437,11 @@ msgstr "Valores cualitativos"
|
||||
msgid "Quality control"
|
||||
msgstr "Control de calidad"
|
||||
|
||||
#. module: quality_control
|
||||
#: model:ir.model,name:quality_control.model_qc_inspection_line
|
||||
msgid "Quality control inspection line"
|
||||
msgstr "Línea de inspección del control de calidad"
|
||||
|
||||
#. module: quality_control
|
||||
#: model:ir.model,name:quality_control.model_qc_test_question
|
||||
msgid "Quality control question"
|
||||
@@ -453,6 +489,11 @@ msgstr "Cuantitativa"
|
||||
msgid "Quantitative value"
|
||||
msgstr "Valor cuantitativo"
|
||||
|
||||
#. module: quality_control
|
||||
#: field:qc.inspection,qty:0
|
||||
msgid "Quantity"
|
||||
msgstr "Cantidad"
|
||||
|
||||
#. module: quality_control
|
||||
#: view:qc.inspection.line:quality_control.qc_inspection_line_search_view
|
||||
#: field:qc.inspection.line,name:0
|
||||
@@ -502,6 +543,16 @@ msgstr "Referenciado"
|
||||
msgid "Related"
|
||||
msgstr "Relativo"
|
||||
|
||||
#. module: quality_control
|
||||
#: view:qc.inspection:quality_control.qc_inspection_search_view
|
||||
#: field:qc.inspection,user:0
|
||||
#: field:qc.trigger.line,user:0
|
||||
#: field:qc.trigger.product_category_line,user:0
|
||||
#: field:qc.trigger.product_line,user:0
|
||||
#: field:qc.trigger.product_template_line,user:0
|
||||
msgid "Responsible"
|
||||
msgstr "Responsable"
|
||||
|
||||
#. module: quality_control
|
||||
#: view:qc.inspection:quality_control.qc_inspection_search_view
|
||||
msgid "Search inspection"
|
||||
@@ -512,6 +563,11 @@ msgstr "Buscar inspección"
|
||||
msgid "Search inspection line"
|
||||
msgstr "Buscar línea de inspección"
|
||||
|
||||
#. module: quality_control
|
||||
#: model:res.groups,name:quality_control.group_quality_control_user
|
||||
msgid "See Own Inspections"
|
||||
msgstr "Mostrar las inspecciones propias"
|
||||
|
||||
#. module: quality_control
|
||||
#: 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
|
||||
@@ -554,9 +610,9 @@ msgstr "Resumen"
|
||||
#. module: quality_control
|
||||
#: view:qc.inspection:quality_control.qc_inspection_search_view
|
||||
#: field:qc.inspection,test:0
|
||||
#: field:qc.inspection.set.test,test:0
|
||||
#: view:qc.test:quality_control.qc_test_form_view
|
||||
#: 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
|
||||
@@ -626,6 +682,11 @@ msgstr "Disparador"
|
||||
msgid "Type"
|
||||
msgstr "Tipo"
|
||||
|
||||
#. module: quality_control
|
||||
#: field:qc.inspection.line,test_uom_category:0
|
||||
msgid "Unit of Measure Category"
|
||||
msgstr "Categoría de unidad de medida"
|
||||
|
||||
#. module: quality_control
|
||||
#: field:qc.inspection,message_unread:0
|
||||
msgid "Unread Messages"
|
||||
@@ -651,11 +712,6 @@ msgstr "UdM del valor de inspección si es una pregunta cuantitativa."
|
||||
msgid "Uom"
|
||||
msgstr "UdM"
|
||||
|
||||
#. module: quality_control
|
||||
#: model:res.groups,name:quality_control.group_quality_control_user
|
||||
msgid "User"
|
||||
msgstr "Usuario"
|
||||
|
||||
#. module: quality_control
|
||||
#: field:qc.inspection.line,valid_values:0
|
||||
msgid "Valid values"
|
||||
@@ -682,32 +738,42 @@ 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
|
||||
#: code:addons/quality_control/models/qc_inspection.py:92
|
||||
#: code:addons/quality_control/models/qc_inspection.py:93
|
||||
#: code:addons/quality_control/models/qc_inspection.py:97
|
||||
#, python-format
|
||||
msgid "You cannot remove an auto-generated inspection"
|
||||
msgstr "No puede eliminar una inspección auto-generada."
|
||||
|
||||
#. module: quality_control
|
||||
#: code:addons/quality_control/models/qc_inspection.py:95
|
||||
#: code:addons/quality_control/models/qc_inspection.py:96
|
||||
#: code:addons/quality_control/models/qc_inspection.py:100
|
||||
#, 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
|
||||
#: code:addons/quality_control/models/qc_inspection.py:109
|
||||
#: code:addons/quality_control/models/qc_inspection.py:113
|
||||
#, 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
|
||||
#: code:addons/quality_control/models/qc_inspection.py:124
|
||||
#: code:addons/quality_control/models/qc_inspection.py:128
|
||||
#, 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
|
||||
#: code:addons/quality_control/models/qc_inspection.py:119
|
||||
#: code:addons/quality_control/models/qc_inspection.py:123
|
||||
#, python-format
|
||||
msgid "You should provide an answer for all quantitative questions."
|
||||
msgstr "Debe proveer una respuesta para todas las preguntas cuantitativas."
|
||||
|
||||
#. module: quality_control
|
||||
#: view:qc.inspection.set.test:quality_control.view_qc_test_set_test_form
|
||||
msgid "or"
|
||||
msgstr "o"
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 8.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-12-10 22:13+0000\n"
|
||||
"PO-Revision-Date: 2014-12-10 22:13+0000\n"
|
||||
"POT-Creation-Date: 2015-02-24 16:08+0000\n"
|
||||
"PO-Revision-Date: 2015-02-24 16:08+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -47,8 +47,8 @@ msgid "Approve"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control
|
||||
#: field:qc.inspection,auto_generated:0
|
||||
#: view:qc.inspection:quality_control.qc_inspection_search_view
|
||||
#: field:qc.inspection,auto_generated:0
|
||||
msgid "Auto-generated"
|
||||
msgstr ""
|
||||
|
||||
@@ -68,6 +68,11 @@ msgstr ""
|
||||
msgid "Category"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control
|
||||
#: field:qc.test.category,child_ids:0
|
||||
msgid "Child categories"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control
|
||||
#: field:qc.inspection,company_id:0
|
||||
#: field:qc.test,company_id:0
|
||||
@@ -80,6 +85,11 @@ msgstr ""
|
||||
msgid "Confirm"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control
|
||||
#: help:qc.inspection.line,test_uom_category:0
|
||||
msgid "Conversion between Units of Measure can only occur if they belong to the same category. The conversion will be made based on the ratios."
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control
|
||||
#: view:qc.inspection:quality_control.qc_inspection_search_view
|
||||
#: view:qc.inspection.line:quality_control.qc_inspection_line_search_view
|
||||
@@ -379,7 +389,6 @@ msgstr ""
|
||||
|
||||
#. module: quality_control
|
||||
#: model:ir.model,name:quality_control.model_product_category
|
||||
#: field:qc.inspection.line,test_uom_category:0
|
||||
msgid "Product Category"
|
||||
msgstr ""
|
||||
|
||||
@@ -428,6 +437,11 @@ msgstr ""
|
||||
msgid "Quality control"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control
|
||||
#: model:ir.model,name:quality_control.model_qc_inspection_line
|
||||
msgid "Quality control inspection line"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control
|
||||
#: model:ir.model,name:quality_control.model_qc_test_question
|
||||
msgid "Quality control question"
|
||||
@@ -475,6 +489,11 @@ msgstr ""
|
||||
msgid "Quantitative value"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control
|
||||
#: field:qc.inspection,qty:0
|
||||
msgid "Quantity"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control
|
||||
#: view:qc.inspection.line:quality_control.qc_inspection_line_search_view
|
||||
#: field:qc.inspection.line,name:0
|
||||
@@ -524,6 +543,16 @@ msgstr ""
|
||||
msgid "Related"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control
|
||||
#: view:qc.inspection:quality_control.qc_inspection_search_view
|
||||
#: field:qc.inspection,user:0
|
||||
#: field:qc.trigger.line,user:0
|
||||
#: field:qc.trigger.product_category_line,user:0
|
||||
#: field:qc.trigger.product_line,user:0
|
||||
#: field:qc.trigger.product_template_line,user:0
|
||||
msgid "Responsible"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control
|
||||
#: view:qc.inspection:quality_control.qc_inspection_search_view
|
||||
msgid "Search inspection"
|
||||
@@ -534,6 +563,11 @@ msgstr ""
|
||||
msgid "Search inspection line"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control
|
||||
#: model:res.groups,name:quality_control.group_quality_control_user
|
||||
msgid "See Own Inspections"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control
|
||||
#: 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
|
||||
@@ -573,14 +607,10 @@ msgstr ""
|
||||
msgid "Summary"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control
|
||||
#: field:qc.inspection.set.test,test:0
|
||||
msgid "Template"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control
|
||||
#: view:qc.inspection:quality_control.qc_inspection_search_view
|
||||
#: field:qc.inspection,test:0
|
||||
#: field:qc.inspection.set.test,test:0
|
||||
#: view:qc.test:quality_control.qc_test_form_view
|
||||
#: field:qc.test.question,test:0
|
||||
#: field:qc.trigger.line,test:0
|
||||
@@ -652,6 +682,11 @@ msgstr ""
|
||||
msgid "Type"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control
|
||||
#: field:qc.inspection.line,test_uom_category:0
|
||||
msgid "Unit of Measure Category"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control
|
||||
#: field:qc.inspection,message_unread:0
|
||||
msgid "Unread Messages"
|
||||
@@ -677,11 +712,6 @@ msgstr ""
|
||||
msgid "Uom"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control
|
||||
#: model:res.groups,name:quality_control.group_quality_control_user
|
||||
msgid "User"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control
|
||||
#: field:qc.inspection.line,valid_values:0
|
||||
msgid "Valid values"
|
||||
@@ -708,32 +738,42 @@ msgid "When this field is marked, the answer is considered correct."
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control
|
||||
#: code:addons/quality_control/models/qc_inspection.py:92
|
||||
#: code:addons/quality_control/models/qc_inspection.py:93
|
||||
#: code:addons/quality_control/models/qc_inspection.py:97
|
||||
#, python-format
|
||||
msgid "You cannot remove an auto-generated inspection"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control
|
||||
#: code:addons/quality_control/models/qc_inspection.py:95
|
||||
#: code:addons/quality_control/models/qc_inspection.py:96
|
||||
#: code:addons/quality_control/models/qc_inspection.py:100
|
||||
#, 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
|
||||
#: code:addons/quality_control/models/qc_inspection.py:109
|
||||
#: code:addons/quality_control/models/qc_inspection.py:113
|
||||
#, python-format
|
||||
msgid "You must set the test to perform first."
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control
|
||||
#: code:addons/quality_control/models/qc_inspection.py:123
|
||||
#: code:addons/quality_control/models/qc_inspection.py:124
|
||||
#: code:addons/quality_control/models/qc_inspection.py:128
|
||||
#, 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
|
||||
#: code:addons/quality_control/models/qc_inspection.py:119
|
||||
#: code:addons/quality_control/models/qc_inspection.py:123
|
||||
#, python-format
|
||||
msgid "You should provide an answer for all quantitative questions."
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control
|
||||
#: view:qc.inspection.set.test:quality_control.view_qc_test_set_test_form
|
||||
msgid "or"
|
||||
msgstr ""
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ from openerp import models, fields, api, exceptions, _
|
||||
|
||||
class QcInspection(models.Model):
|
||||
_name = 'qc.inspection'
|
||||
_description = 'Quality control inspection'
|
||||
_inherit = ['mail.thread', 'ir.needaction_mixin']
|
||||
|
||||
@api.one
|
||||
@@ -78,6 +79,9 @@ class QcInspection(models.Model):
|
||||
states={'draft': [('readonly', False)]},
|
||||
default=lambda self: self.env['res.company']._company_default_get(
|
||||
'qc.inspection'))
|
||||
user = fields.Many2one(
|
||||
comodel_name='res.users', string='Responsible',
|
||||
track_visibility='always', default=lambda self: self.env.user)
|
||||
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
@@ -141,41 +145,43 @@ class QcInspection(models.Model):
|
||||
self.write({'state': 'canceled'})
|
||||
|
||||
@api.multi
|
||||
def set_test(self, test, force_fill=False):
|
||||
def set_test(self, trigger_line, force_fill=False):
|
||||
for inspection in self:
|
||||
header = self._prepare_inspection_header(
|
||||
inspection.object_id, test)
|
||||
inspection.object_id, trigger_line)
|
||||
del header['state'] # don't change current status
|
||||
del header['auto_generated'] # don't change auto_generated flag
|
||||
del header['user'] # don't change current user
|
||||
inspection.write(header)
|
||||
self.inspection_lines.unlink()
|
||||
inspection.inspection_lines = inspection._prepare_inspection_lines(
|
||||
test, force_fill=force_fill)
|
||||
trigger_line.test, force_fill=force_fill)
|
||||
|
||||
@api.multi
|
||||
def _make_inspection(self, object_ref, test):
|
||||
def _make_inspection(self, object_ref, trigger_line):
|
||||
"""Overridable hook method for creating inspection from test.
|
||||
:param object_ref: Object instance
|
||||
:param test: Test instance
|
||||
:param trigger_line: Trigger line instance
|
||||
:return: Inspection object
|
||||
"""
|
||||
inspection = self.create(self._prepare_inspection_header(
|
||||
object_ref, test))
|
||||
inspection.set_test(test)
|
||||
object_ref, trigger_line))
|
||||
inspection.set_test(trigger_line)
|
||||
return inspection
|
||||
|
||||
@api.multi
|
||||
def _prepare_inspection_header(self, object_ref, test):
|
||||
def _prepare_inspection_header(self, object_ref, trigger_line):
|
||||
"""Overridable hook method for preparing inspection header.
|
||||
:param object_ref: Object instance
|
||||
:param test: Test instance
|
||||
:param trigger_line: Trigger line 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,
|
||||
'test': trigger_line.test.id,
|
||||
'user': trigger_line.user.id,
|
||||
'auto_generated': True,
|
||||
}
|
||||
|
||||
|
||||
@@ -11,14 +11,18 @@ class QcTriggerLine(models.AbstractModel):
|
||||
|
||||
trigger = fields.Many2one(comodel_name="qc.trigger", required=True)
|
||||
test = fields.Many2one(comodel_name="qc.test", required=True)
|
||||
user = fields.Many2one(
|
||||
comodel_name='res.users', string='Responsible',
|
||||
track_visibility='always', default=lambda self: self.env.user)
|
||||
|
||||
def get_test_for_product(self, trigger, product):
|
||||
"""Overridable method for getting test associated to a product.
|
||||
def get_trigger_line_for_product(self, trigger, product):
|
||||
"""Overridable method for getting trigger_line 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 of trigger_lines that matches to the given product and
|
||||
trigger.
|
||||
"""
|
||||
return set()
|
||||
|
||||
@@ -29,16 +33,17 @@ class QcTriggerProductCategoryLine(models.Model):
|
||||
|
||||
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)
|
||||
def get_trigger_line_for_product(self, trigger, product):
|
||||
trigger_lines = super(QcTriggerProductCategoryLine,
|
||||
self).get_trigger_line_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)
|
||||
trigger_lines.add(trigger_line)
|
||||
category = category.parent_id
|
||||
return tests
|
||||
return trigger_lines
|
||||
|
||||
|
||||
class QcTriggerProductTemplateLine(models.Model):
|
||||
@@ -47,13 +52,14 @@ class QcTriggerProductTemplateLine(models.Model):
|
||||
|
||||
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)
|
||||
def get_trigger_line_for_product(self, trigger, product):
|
||||
trigger_lines = super(QcTriggerProductTemplateLine,
|
||||
self).get_trigger_line_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
|
||||
trigger_lines.add(trigger_line)
|
||||
return trigger_lines
|
||||
|
||||
|
||||
class QcTriggerProductLine(models.Model):
|
||||
@@ -62,10 +68,11 @@ class QcTriggerProductLine(models.Model):
|
||||
|
||||
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)
|
||||
def get_trigger_line_for_product(self, trigger, product):
|
||||
trigger_lines = super(QcTriggerProductLine,
|
||||
self).get_trigger_line_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
|
||||
trigger_lines.add(trigger_line)
|
||||
return trigger_lines
|
||||
|
||||
@@ -11,8 +11,9 @@
|
||||
<group name="qc" string="Quality control">
|
||||
<field name="qc_triggers" nolabel="1">
|
||||
<tree string="Quality control triggers" editable="bottom">
|
||||
<field name="trigger" widget="selection"/>
|
||||
<field name="test"/>
|
||||
<field name="trigger" widget="selection" />
|
||||
<field name="test" />
|
||||
<field name="user" />
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<tree string="Quality control triggers" editable="bottom">
|
||||
<field name="trigger" widget="selection"/>
|
||||
<field name="test"/>
|
||||
<field name="user" />
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
|
||||
@@ -39,21 +39,22 @@
|
||||
statusbar_colors='{"success": "blue", "failed": "red"}' />
|
||||
</header>
|
||||
<sheet>
|
||||
<h1>
|
||||
<label string="Inspection "/>
|
||||
<field name="name" class="oe_inline"/>
|
||||
</h1>
|
||||
<div class="oe_right oe_button_box" name="buttons">
|
||||
<button class="oe_inline oe_stat_button"
|
||||
type="action"
|
||||
name="%(action_qc_inspection_set_test)d"
|
||||
icon="fa-bookmark-o"
|
||||
states="draft"
|
||||
string="Set test"/>
|
||||
string="Set test" />
|
||||
</div>
|
||||
<h1>
|
||||
<label string="Inspection "/>
|
||||
<field name="name" class="oe_inline"/>
|
||||
</h1>
|
||||
<group>
|
||||
<group>
|
||||
<field name="test"/>
|
||||
<field name="test" />
|
||||
<field name="user" />
|
||||
<field name="object_id" />
|
||||
<field name="product" />
|
||||
</group>
|
||||
@@ -109,6 +110,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Inspections">
|
||||
<field name="name" />
|
||||
<field name="user" />
|
||||
<field name="test" />
|
||||
<field name="product" />
|
||||
<field name="success" />
|
||||
@@ -124,6 +126,7 @@
|
||||
<search string="Search inspection">
|
||||
<group>
|
||||
<field name="name" />
|
||||
<field name="user" />
|
||||
<field name="object_id" />
|
||||
<field name="product" />
|
||||
<field name="test" />
|
||||
@@ -141,6 +144,9 @@
|
||||
<filter string="Test"
|
||||
domain="[]"
|
||||
context="{'group_by': 'test'}" />
|
||||
<filter string="Responsible"
|
||||
domain="[]"
|
||||
context="{'group_by': 'user'}" />
|
||||
<filter string="Product"
|
||||
domain="[]"
|
||||
context="{'group_by': 'product'}" />
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<menuitem parent="qc_menu"
|
||||
name="Tests"
|
||||
id="qc_menu_test_parent"
|
||||
groups="group_quality_control_manager"
|
||||
sequence="20" />
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -120,6 +120,7 @@
|
||||
parent="qc_menu_test_parent"
|
||||
id="qc_test_menu"
|
||||
action="action_qc_test"
|
||||
groups="group_quality_control_manager"
|
||||
sequence="20" />
|
||||
|
||||
</data>
|
||||
|
||||
Reference in New Issue
Block a user