[IMP] nan_prodlot_quality_control: finalized (re)implementation of Quality Control for Production Lots, with complet YAML tests included.

This commit is contained in:
Guillem Barba 2012-02-23 17:43:31 +01:00 committed by Àngel Àlvarez
parent 5b83f0eb07
commit 472943335e
16 changed files with 3614 additions and 84 deletions

View File

@ -65,7 +65,15 @@
'prodlot_workflow.xml',
'security/ir.model.access.csv',
],
"demo_xml" : [],
"demo_xml" : [
'prodlot_quality_control_demo.xml',
],
"test": [
'test/prodlot_without_quality_control.yml',
'test/prodlot_with_one_qc_test.yml',
'test/prodlot_with_two_qc_test.yml',
'test/prodlot_with_two_qc_test_diff_trigger.yml',
],
"active": False,
"installable": True,
}

476
i18n/ca.po Normal file
View File

@ -0,0 +1,476 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * nan_prodlot_quality_control
#
# Guillem Barba <guillem@nan-tic.com>, 2012.
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 6.0.2\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2012-02-23 16:42+0000\n"
"PO-Revision-Date: 2012-02-23 15:48+0100\n"
"Last-Translator: Guillem Barba <guillem@nan-tic.com>\n"
"Language-Team: Catalan <>\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
"X-Generator: Lokalize 1.2\n"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_stock_production_lot
msgid "Production lot"
msgstr "Lot de producció"
#. module: nan_prodlot_quality_control
#: field:product.qc.trigger.template,template_type:0
#: field:stock.production.lot.qc.trigger.test,template_type:0
msgid "Template's Type"
msgstr "Tipus plantilla"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
msgid "Next Test"
msgstr "Següent test"
#. module: nan_prodlot_quality_control
#: view:res.company.qc.trigger.template:0
msgid "QC Template Triggers by Company"
msgstr "Disparadors de plantilles de qualitat per Companyia"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
msgid "Confirm"
msgstr "Confirma"
#. module: nan_prodlot_quality_control
#: selection:product.qc.trigger.template,template_type:0
#: selection:stock.production.lot.qc.trigger.test,template_type:0
msgid "Generic"
msgstr "Genèrica"
#. module: nan_prodlot_quality_control
#: constraint:res.company:0
msgid "Error! You can not create recursive companies."
msgstr "Error! No podeu crear companyies recursives."
#. module: nan_prodlot_quality_control
#: sql_constraint:res.company.qc.trigger.template:0
msgid "The QC Trigger Tag must be unique for each Company!"
msgstr ""
"L'etiqueta disparadora de Control de Qualitat ha de ser única per cada "
"Companyia!"
#. module: nan_prodlot_quality_control
#: field:stock.production.lot,current_qc_test_trigger_id:0
msgid "Current QC Test Trigger"
msgstr "Disparador de test de qualitat actual"
#. module: nan_prodlot_quality_control
#: help:product.qc.trigger.template,trigger_id:0
#: help:stock.production.lot.qc.trigger.test,trigger_id:0
msgid ""
"The Quality Control Trigger Tag which defines when must to be created a Test "
"(using the specified template) for a Production Lot of this Product."
msgstr ""
"L'etiqueta de disparador de control de qualitat que defineix quan s'ha de "
"crear un test (utilitzant la plantilla especificada) per als lots de "
"producció d'aquest producte."
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0 field:stock.production.lot,state:0
msgid "State"
msgstr "Estat"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
msgid "Quality Control"
msgstr "Control de qualitat"
#. module: nan_prodlot_quality_control
#: field:stock.production.lot.qc.trigger.test,prodlot_id:0
msgid "Lot"
msgstr "Lot"
#. module: nan_prodlot_quality_control
#: view:product.product:0 view:res.company:0
msgid "Quality Control Trigger"
msgstr "Disparador control de qualitat"
#. module: nan_prodlot_quality_control
#: field:stock.production.lot.qc.trigger.test,test_id:0
msgid "Test"
msgstr "Test"
#. module: nan_prodlot_quality_control
#: model:qc.test.template,name:nan_prodlot_quality_control.qc_test_template_generic0
msgid "Generic Template for Input Lots"
msgstr "Plantilla genèrica per Lots d'entrada"
#. module: nan_prodlot_quality_control
#: model:product.template,name:nan_prodlot_quality_control.product_w_2qctest0_product_template
msgid "Product with Two QC Test"
msgstr "Producte amb dos Tests de qualitat"
#. module: nan_prodlot_quality_control
#: help:stock.production.lot,qc_test_trigger_ids:0
msgid ""
"Defines the Quality Control Tests that this Production Lot must to pass in "
"certain situations defined by the Trigger Tag."
msgstr ""
"Defineix els tests de control de qualitat que aquest lot de producció ha de "
"passar en certes situacions definides per les etiquetes de disparadors."
#. module: nan_prodlot_quality_control
#: field:stock.production.lot.qc.trigger.test,test_success:0
msgid "Test success?"
msgstr "Test exitós?"
#. module: nan_prodlot_quality_control
#: view:qc.trigger:0
msgid "Trigger Tag"
msgstr "Etiqueta de disparador"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
msgid "Force Cancel"
msgstr "Forçar cancel·lació"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_product_product
#: field:product.qc.trigger.template,product_id:0 view:stock.production.lot:0
msgid "Product"
msgstr "Producte"
#. module: nan_prodlot_quality_control
#: help:res.company.qc.trigger.template,trigger_id:0
msgid ""
"The Quality Control Trigger Tag which defines when must to be created a Test "
"(using the specified template) for a Production Lot."
msgstr ""
"L'etiqueta de disparador de control de qualitat que defineix quan s'ha de "
"crear el test (utilitzant la plantilla especificada) per un lot de producció."
#. module: nan_prodlot_quality_control
#: model:product.template,name:nan_prodlot_quality_control.product_wo_qc0_product_template
msgid "Product without Quality Control"
msgstr "Producte sense control de qualitat"
#. module: nan_prodlot_quality_control
#: help:res.company,qc_template_trigger_ids:0
msgid ""
"Defines when a Production Lot must to pass a Quality Control Test (based on "
"the defined Template).\n"
"It defines the default Template Triggers which will be used when a Product "
"is created. Only the Product's field define the final behavior of its lots: "
"which template to use or don't require any test if there aren't any trigger "
"defined."
msgstr ""
"Defineix quan un lot de producció ha de passar un test de qualitat (basat en "
"la plantilla especificada).\n"
"TODOIt defines the default Template Triggers which will be used when a "
"Product is created. Only the Product's field define the final behavior of "
"its lots: which template to use or don't require any test if there aren't "
"any trigger defined."
#. module: nan_prodlot_quality_control
#: field:product.qc.trigger.template,company_id:0
#: field:res.company.qc.trigger.template,company_id:0
msgid "Company"
msgstr "Companyia"
#. module: nan_prodlot_quality_control
#: help:product.product,qc_template_trigger_ids:0
msgid ""
"Defines when a Production Lot must to pass a Quality Control Test (based on "
"the defined Template).\n"
"It gets its default value for generic templates from the Company."
msgstr ""
"Defineix quan un Lot de producció ha de passar un test de qualitat (basat en "
"la plantilla especificada).\n"
"Agafa de la companyia els valors per defecte per plantilles genèriques."
#. module: nan_prodlot_quality_control
#: view:stock.production.lot.qc.trigger.test:0
msgid "QC Test Triggers by Lot"
msgstr "Disparadors de tests de qualitat per Lot"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot.qc.trigger.test:0
msgid "QC Test Trigger by Lot"
msgstr "Disparador de test de qualitat per Lot"
#. module: nan_prodlot_quality_control
#: constraint:product.product:0
msgid "Error: Invalid ean code"
msgstr "Error: Codi EAN invàlid"
#. module: nan_prodlot_quality_control
#: field:product.product,qc_template_trigger_ids:0
#: field:product.product,qc_trigger_ids:0
#: field:res.company,qc_template_trigger_ids:0
#: field:stock.production.lot,qc_trigger_ids:0
msgid "QC Triggers"
msgstr "Disparadors de qualitat"
#. module: nan_prodlot_quality_control
#: field:stock.production.lot,active:0
msgid "Active"
msgstr "Actiu"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_res_company_qc_trigger_template
msgid "Quality Control Template Triggers by Company"
msgstr "Disparadors de plantilles de qualitat per Companyia"
#. module: nan_prodlot_quality_control
#: field:product.qc.trigger.template,template_id:0
#: field:res.company.qc.trigger.template,template_id:0
msgid "Template"
msgstr "Plantilla"
#. module: nan_prodlot_quality_control
#: view:res.company:0
msgid "Configuration"
msgstr "Configuració"
#. module: nan_prodlot_quality_control
#: model:product.template,name:nan_prodlot_quality_control.product_w_1qctest0_product_template
msgid "Product with One QC Test"
msgstr "Producte amb un test de qualitat"
#. module: nan_prodlot_quality_control
#: code:addons/nan_prodlot_quality_control/stock.py:516
#, python-format
msgid ""
"You are trying to cancel the Production Lots with IDs '%(lot_ids)s' which "
"are associated to QC Test workflow, and it is not allowed.\n"
"Please, use the 'Force Cancel' button or function to cancel a Lot in "
"'Pending Test' or 'Test Failed' state."
msgstr ""
"Està intentant cancel·lar els Lots amb ID '%(lot_ids)s' els quals estan "
"associats a fluxes de tests de qualitat, i això no està permès.\n"
"Si us plau, utilitza el botó 'Força cancel·lació' o la funció corresponent "
"per cancel·lar els Lots en estat 'Pendent del test' o 'Test fallit'."
#. module: nan_prodlot_quality_control
#: model:ir.actions.act_window,name:nan_prodlot_quality_control.action_qc_test_prodlot_view
#: model:ir.ui.menu,name:nan_prodlot_quality_control.qc_test_prodlot_menu
msgid "Production Lot Tests"
msgstr "Tests de Lots de producció"
#. module: nan_prodlot_quality_control
#: sql_constraint:qc.trigger:0
msgid "The Name of the Quality Control Trigger Tags must be unique!"
msgstr "El nom de les etiquetes de disparadors de qualitat ha de ser únic!"
#. module: nan_prodlot_quality_control
#: field:qc.trigger,name:0
msgid "Name"
msgstr "Nom"
#. module: nan_prodlot_quality_control
#: sql_constraint:stock.production.lot.qc.trigger.test:0
msgid ""
"The tuple QC Trigger Tag and Template Type must be unique for each "
"Production Lot!"
msgstr ""
"La combinació Etiqueta de disparador de qualitat i Tipus de plantilla ha de "
"ser única per cada Lot de producció!"
#. module: nan_prodlot_quality_control
#: model:qc.test.template,name:nan_prodlot_quality_control.qc_test_template_related0
msgid "Specific Template for Input Lots"
msgstr "Plantilla específica per Lots d'entrada"
#. module: nan_prodlot_quality_control
#: code:addons/nan_prodlot_quality_control/quality_control.py:74
#, python-format
msgid "Error canceling Test!"
msgstr "Error cancel·lant un test!"
#. module: nan_prodlot_quality_control
#: code:addons/nan_prodlot_quality_control/stock.py:515
#, python-format
msgid "Error Cancelling Lot with subflow!"
msgstr "Error cancel·lant un Lot amb subflux!"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_qc_trigger
msgid "Quality Control Trigger Tag"
msgstr "Etiqueta de disparador de qualitat"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_res_company
msgid "Companies"
msgstr "Companyies"
#. module: nan_prodlot_quality_control
#: view:product.qc.trigger.template:0
msgid "QC Template Trigger by Product"
msgstr "Disparadors de plantilles de qualitat per producte"
#. module: nan_prodlot_quality_control
#: field:product.qc.trigger.template,trigger_id:0
#: field:res.company.qc.trigger.template,trigger_id:0
#: field:stock.production.lot.qc.trigger.test,trigger_id:0
msgid "Trigger"
msgstr "Disparador"
#. module: nan_prodlot_quality_control
#: model:qc.posible.value,name:nan_prodlot_quality_control.qc_posible_value_no0
msgid "No"
msgstr "No"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_product_qc_trigger_template
msgid "Quality Control Template Triggers by Product"
msgstr "Disparadors de plantilles de qualitat per producte"
#. module: nan_prodlot_quality_control
#: model:ir.actions.act_window,name:nan_prodlot_quality_control.act_trigger_tag_view
#: model:ir.ui.menu,name:nan_prodlot_quality_control.menu_action_trigger_tag
#: view:qc.trigger:0
msgid "Trigger Tags"
msgstr "Etiqueta de disparador"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
msgid "Set To Draft"
msgstr "Canvia a esborrany"
#. module: nan_prodlot_quality_control
#: view:res.company.qc.trigger.template:0
msgid "QC Template Trigger by Company"
msgstr "Disparadors de plantilles de qualitat per Companyia"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_stock_production_lot_qc_trigger_test
msgid "Quality Control Test Triggers by Lot"
msgstr "Disparadors de tests de qualitat per Lot"
#. module: nan_prodlot_quality_control
#: code:addons/nan_prodlot_quality_control/stock.py:292
#, python-format
msgid "Error setting next test!"
msgstr "Error establint el següent test!"
#. module: nan_prodlot_quality_control
#: model:qc.posible.value,name:nan_prodlot_quality_control.qc_posible_value_yes0
msgid "Yes"
msgstr "Sí"
#. module: nan_prodlot_quality_control
#: sql_constraint:stock.production.lot:0
msgid ""
"The combination of serial number and internal reference must be unique !"
msgstr ""
"La combinació del número de serie i la referència interna ha de ser única!"
#. module: nan_prodlot_quality_control
#: model:product.template,name:nan_prodlot_quality_control.product_w_2qctest_diff_trigger0_product_template
msgid "Product with Two QC Test with different Trigger"
msgstr "Producte amb dos Tests de qualitat amb diferent disparador"
#. module: nan_prodlot_quality_control
#: selection:product.qc.trigger.template,template_type:0
#: selection:stock.production.lot.qc.trigger.test,template_type:0
msgid "Specific"
msgstr "Específic"
#. module: nan_prodlot_quality_control
#: code:addons/nan_prodlot_quality_control/quality_control.py:75
#, python-format
msgid ""
"You are trying to cancel the Quality Control Test '%(test_name)s' (id:"
"%(test_id)d) but it is in a Test Trigger of the Production Lot "
"'%(lot_name)s' (id:%(lot_id)d) which is in '%(lot_state)s' state.\n"
"You can only cancel this test if it is the current test of the Lot and the "
"Lot's state is 'Waiting QC Test' or 'QC Test Failed"
msgstr ""
"Està intentant cancel·lar el test de qualitat '%(test_name)s' (id:"
"%(test_id)d) però està associat a un disparador de qualitat del Lot "
"'%(lot_name)s' (id:%(lot_id)d) el qual està a l'estat '%(lot_state)s'.\n"
"Només es pot cancel·lar aquest test si és el test actual del Lot i l'estat "
"es 'Esperant test' o 'Test fallit'."
#. module: nan_prodlot_quality_control
#: field:product.qc.trigger.template,sequence:0
#: field:res.company.qc.trigger.template,sequence:0
#: field:stock.production.lot.qc.trigger.test,sequence:0
msgid "Sequence"
msgstr "Seqüència"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_qc_test
msgid "qc.test"
msgstr "qc.test"
#. module: nan_prodlot_quality_control
#: view:product.product:0 view:res.company:0 view:stock.production.lot:0
msgid "Quality Control Triggers"
msgstr "Disparadors de qualitat"
#. module: nan_prodlot_quality_control
#: field:stock.production.lot,current_qc_test_id:0
msgid "Current QC Test"
msgstr "Test de qualitat actual"
#. module: nan_prodlot_quality_control
#: help:product.qc.trigger.template,template_id:0
#: help:res.company.qc.trigger.template,template_id:0
msgid "The Quality Control Template to use."
msgstr "La plantilla de qualitat a utilitzar."
#. module: nan_prodlot_quality_control
#: sql_constraint:product.qc.trigger.template:0
msgid ""
"The tuple QC Trigger Tag and Template Type must be unique for each Product "
"and Company!"
msgstr ""
"La combinació Etiqueta de disparador de qualitat i Tipus de plantilla ha de "
"ser única per cada producte!"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
msgid "Inactive"
msgstr "Inactiu"
#. module: nan_prodlot_quality_control
#: view:product.qc.trigger.template:0
msgid "QC Template Triggers by Product"
msgstr "Disparadors de plantilles de qualitat per producte"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
msgid "Cancel"
msgstr "Cancel·la"
#. module: nan_prodlot_quality_control
#: field:stock.production.lot.qc.trigger.test,test_approved:0
msgid "Test approved?"
msgstr "Test aprovat?"
#. module: nan_prodlot_quality_control
#: field:stock.production.lot,qc_test_trigger_ids:0
#: field:stock.production.lot,qc_test_trigger_ro_ids:0
msgid "QC Tests"
msgstr "Tests de qualitat"
#. module: nan_prodlot_quality_control
#: code:addons/nan_prodlot_quality_control/stock.py:293
#, python-format
msgid ""
"It is trying to set a new next test for Production Lot '%(lot_name)s' (id: "
"%(lot_id)s) but it is in state '%(lot_state)s' when it is expected 'Draft' "
"or 'Valid' states to change the current test."
msgstr ""
"S'està intentant establir el següent test de qualitat pel Lot "
"'%(lot_name)s' (id: %(lot_id)s) però està en l'estat '%(lot_state)s' quan "
"s'espera que estigui a 'Borrador' o 'Valid' per canviar el test actual."
#. module: nan_prodlot_quality_control
#: model:qc.proof,name:nan_prodlot_quality_control.qc_proof_simpleproof0
msgid "Simple Proof"
msgstr "Prova simple"

475
i18n/de.po Normal file
View File

@ -0,0 +1,475 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * nan_prodlot_quality_control
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 6.0.2\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2012-02-23 16:42+0000\n"
"PO-Revision-Date: 2012-02-20 15:36+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_stock_production_lot
msgid "Production lot"
msgstr "Production lot"
#. module: nan_prodlot_quality_control
#: field:product.qc.trigger.template,template_type:0
#: field:stock.production.lot.qc.trigger.test,template_type:0
msgid "Template's Type"
msgstr "Template's Type"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
msgid "Next Test"
msgstr "Next Test"
#. module: nan_prodlot_quality_control
#: view:res.company.qc.trigger.template:0
msgid "QC Template Triggers by Company"
msgstr "QC Template Triggers by Company"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
msgid "Confirm"
msgstr "Confirm"
#. module: nan_prodlot_quality_control
#: selection:product.qc.trigger.template,template_type:0
#: selection:stock.production.lot.qc.trigger.test,template_type:0
msgid "Generic"
msgstr "Generic"
#. module: nan_prodlot_quality_control
#: constraint:res.company:0
msgid "Error! You can not create recursive companies."
msgstr "Error! You can not create recursive companies."
#. module: nan_prodlot_quality_control
#: sql_constraint:res.company.qc.trigger.template:0
msgid "The QC Trigger Tag must be unique for each Company!"
msgstr "The QC Trigger Tag must be unique for each Company!"
#. module: nan_prodlot_quality_control
#: field:stock.production.lot,current_qc_test_trigger_id:0
msgid "Current QC Test Trigger"
msgstr "Current QC Test Trigger"
#. module: nan_prodlot_quality_control
#: help:product.qc.trigger.template,trigger_id:0
#: help:stock.production.lot.qc.trigger.test,trigger_id:0
msgid ""
"The Quality Control Trigger Tag which defines when must to be created a Test "
"(using the specified template) for a Production Lot of this Product."
msgstr ""
"The Quality Control Trigger Tag which defines when must to be created a Test "
"(using the specified template) for a Production Lot of this Product."
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0 field:stock.production.lot,state:0
msgid "State"
msgstr "State"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
msgid "Quality Control"
msgstr "Quality Control"
#. module: nan_prodlot_quality_control
#: field:stock.production.lot.qc.trigger.test,prodlot_id:0
msgid "Lot"
msgstr "Lot"
#. module: nan_prodlot_quality_control
#: view:product.product:0 view:res.company:0
msgid "Quality Control Trigger"
msgstr "Quality Control Trigger"
#. module: nan_prodlot_quality_control
#: field:stock.production.lot.qc.trigger.test,test_id:0
msgid "Test"
msgstr "Test"
#. module: nan_prodlot_quality_control
#: model:qc.test.template,name:nan_prodlot_quality_control.qc_test_template_generic0
msgid "Generic Template for Input Lots"
msgstr "Generic Template for Input Lots"
#. module: nan_prodlot_quality_control
#: model:product.template,name:nan_prodlot_quality_control.product_w_2qctest0_product_template
#, fuzzy
msgid "Product with Two QC Test"
msgstr "Production Lot Tests"
#. module: nan_prodlot_quality_control
#: help:stock.production.lot,qc_test_trigger_ids:0
msgid ""
"Defines the Quality Control Tests that this Production Lot must to pass in "
"certain situations defined by the Trigger Tag."
msgstr ""
"Defines the Quality Control Tests that this Production Lot must to pass in "
"certain situations defined by the Trigger Tag."
#. module: nan_prodlot_quality_control
#: field:stock.production.lot.qc.trigger.test,test_success:0
msgid "Test success?"
msgstr "Test success?"
#. module: nan_prodlot_quality_control
#: view:qc.trigger:0
msgid "Trigger Tag"
msgstr "Trigger Tag"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
msgid "Force Cancel"
msgstr "Force Cancel"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_product_product
#: field:product.qc.trigger.template,product_id:0 view:stock.production.lot:0
msgid "Product"
msgstr "Product"
#. module: nan_prodlot_quality_control
#: help:res.company.qc.trigger.template,trigger_id:0
msgid ""
"The Quality Control Trigger Tag which defines when must to be created a Test "
"(using the specified template) for a Production Lot."
msgstr ""
"The Quality Control Trigger Tag which defines when must to be created a Test "
"(using the specified template) for a Production Lot."
#. module: nan_prodlot_quality_control
#: model:product.template,name:nan_prodlot_quality_control.product_wo_qc0_product_template
#, fuzzy
msgid "Product without Quality Control"
msgstr "Quality Control"
#. module: nan_prodlot_quality_control
#: help:res.company,qc_template_trigger_ids:0
msgid ""
"Defines when a Production Lot must to pass a Quality Control Test (based on "
"the defined Template).\n"
"It defines the default Template Triggers which will be used when a Product "
"is created. Only the Product's field define the final behavior of its lots: "
"which template to use or don't require any test if there aren't any trigger "
"defined."
msgstr ""
"Defines when a Production Lot must to pass a Quality Control Test (based on "
"the defined Template).\n"
"It defines the default Template Triggers which will be used when a Product "
"is created. Only the Product's field define the final behavior of its lots: "
"which template to use or don't require any test if there aren't any trigger "
"defined."
#. module: nan_prodlot_quality_control
#: field:product.qc.trigger.template,company_id:0
#: field:res.company.qc.trigger.template,company_id:0
msgid "Company"
msgstr "Company"
#. module: nan_prodlot_quality_control
#: help:product.product,qc_template_trigger_ids:0
msgid ""
"Defines when a Production Lot must to pass a Quality Control Test (based on "
"the defined Template).\n"
"It gets its default value for generic templates from the Company."
msgstr ""
"Defines when a Production Lot must to pass a Quality Control Test (based on "
"the defined Template).\n"
"It gets its default value for generic templates from the Company."
#. module: nan_prodlot_quality_control
#: view:stock.production.lot.qc.trigger.test:0
msgid "QC Test Triggers by Lot"
msgstr "QC Test Triggers by Lot"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot.qc.trigger.test:0
msgid "QC Test Trigger by Lot"
msgstr "QC Test Trigger by Lot"
#. module: nan_prodlot_quality_control
#: constraint:product.product:0
msgid "Error: Invalid ean code"
msgstr "Error: Invalid ean code"
#. module: nan_prodlot_quality_control
#: field:product.product,qc_template_trigger_ids:0
#: field:product.product,qc_trigger_ids:0
#: field:res.company,qc_template_trigger_ids:0
#: field:stock.production.lot,qc_trigger_ids:0
msgid "QC Triggers"
msgstr "QC Triggers"
#. module: nan_prodlot_quality_control
#: field:stock.production.lot,active:0
msgid "Active"
msgstr "Active"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_res_company_qc_trigger_template
msgid "Quality Control Template Triggers by Company"
msgstr "Quality Control Template Triggers by Company"
#. module: nan_prodlot_quality_control
#: field:product.qc.trigger.template,template_id:0
#: field:res.company.qc.trigger.template,template_id:0
msgid "Template"
msgstr "Template"
#. module: nan_prodlot_quality_control
#: view:res.company:0
msgid "Configuration"
msgstr "Configuration"
#. module: nan_prodlot_quality_control
#: model:product.template,name:nan_prodlot_quality_control.product_w_1qctest0_product_template
#, fuzzy
msgid "Product with One QC Test"
msgstr "Production Lot Tests"
#. module: nan_prodlot_quality_control
#: code:addons/nan_prodlot_quality_control/stock.py:516
#, python-format
msgid ""
"You are trying to cancel the Production Lots with IDs '%(lot_ids)s' which "
"are associated to QC Test workflow, and it is not allowed.\n"
"Please, use the 'Force Cancel' button or function to cancel a Lot in "
"'Pending Test' or 'Test Failed' state."
msgstr ""
"You are trying to cancel the Production Lots with IDs '%(lot_ids)s' which "
"are associated to QC Test workflow, and it is not allowed.\n"
"Please, use the 'Force Cancel' button or function to cancel a Lot in "
"'Pending Test' or 'Test Failed' state."
#. module: nan_prodlot_quality_control
#: model:ir.actions.act_window,name:nan_prodlot_quality_control.action_qc_test_prodlot_view
#: model:ir.ui.menu,name:nan_prodlot_quality_control.qc_test_prodlot_menu
msgid "Production Lot Tests"
msgstr "Production Lot Tests"
#. module: nan_prodlot_quality_control
#: sql_constraint:qc.trigger:0
msgid "The Name of the Quality Control Trigger Tags must be unique!"
msgstr "The Name of the Quality Control Trigger Tags must be unique!"
#. module: nan_prodlot_quality_control
#: field:qc.trigger,name:0
msgid "Name"
msgstr "Name"
#. module: nan_prodlot_quality_control
#: sql_constraint:stock.production.lot.qc.trigger.test:0
msgid ""
"The tuple QC Trigger Tag and Template Type must be unique for each "
"Production Lot!"
msgstr ""
"The tuple QC Trigger Tag and Template Type must be unique for each "
"Production Lot!"
#. module: nan_prodlot_quality_control
#: model:qc.test.template,name:nan_prodlot_quality_control.qc_test_template_related0
msgid "Specific Template for Input Lots"
msgstr "Specific Template for Input Lots"
#. module: nan_prodlot_quality_control
#: code:addons/nan_prodlot_quality_control/quality_control.py:74
#, python-format
msgid "Error canceling Test!"
msgstr "Error canceling Test!"
#. module: nan_prodlot_quality_control
#: code:addons/nan_prodlot_quality_control/stock.py:515
#, python-format
msgid "Error Cancelling Lot with subflow!"
msgstr "Error Cancelling Lot with subflow!"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_qc_trigger
msgid "Quality Control Trigger Tag"
msgstr "Quality Control Trigger Tag"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_res_company
msgid "Companies"
msgstr "Companies"
#. module: nan_prodlot_quality_control
#: view:product.qc.trigger.template:0
msgid "QC Template Trigger by Product"
msgstr "QC Template Trigger by Product"
#. module: nan_prodlot_quality_control
#: field:product.qc.trigger.template,trigger_id:0
#: field:res.company.qc.trigger.template,trigger_id:0
#: field:stock.production.lot.qc.trigger.test,trigger_id:0
msgid "Trigger"
msgstr "Trigger"
#. module: nan_prodlot_quality_control
#: model:qc.posible.value,name:nan_prodlot_quality_control.qc_posible_value_no0
msgid "No"
msgstr "No"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_product_qc_trigger_template
msgid "Quality Control Template Triggers by Product"
msgstr "Quality Control Template Triggers by Product"
#. module: nan_prodlot_quality_control
#: model:ir.actions.act_window,name:nan_prodlot_quality_control.act_trigger_tag_view
#: model:ir.ui.menu,name:nan_prodlot_quality_control.menu_action_trigger_tag
#: view:qc.trigger:0
msgid "Trigger Tags"
msgstr "Trigger Tags"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
msgid "Set To Draft"
msgstr "Set To Draft"
#. module: nan_prodlot_quality_control
#: view:res.company.qc.trigger.template:0
msgid "QC Template Trigger by Company"
msgstr "QC Template Trigger by Company"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_stock_production_lot_qc_trigger_test
msgid "Quality Control Test Triggers by Lot"
msgstr "Quality Control Test Triggers by Lot"
#. module: nan_prodlot_quality_control
#: code:addons/nan_prodlot_quality_control/stock.py:292
#, python-format
msgid "Error setting next test!"
msgstr "Error setting next test!"
#. module: nan_prodlot_quality_control
#: model:qc.posible.value,name:nan_prodlot_quality_control.qc_posible_value_yes0
msgid "Yes"
msgstr "Yes"
#. module: nan_prodlot_quality_control
#: sql_constraint:stock.production.lot:0
msgid ""
"The combination of serial number and internal reference must be unique !"
msgstr ""
"The combination of serial number and internal reference must be unique !"
#. module: nan_prodlot_quality_control
#: model:product.template,name:nan_prodlot_quality_control.product_w_2qctest_diff_trigger0_product_template
msgid "Product with Two QC Test with different Trigger"
msgstr "Product with Two QC Test with different Trigger"
#. module: nan_prodlot_quality_control
#: selection:product.qc.trigger.template,template_type:0
#: selection:stock.production.lot.qc.trigger.test,template_type:0
msgid "Specific"
msgstr "Specific"
#. module: nan_prodlot_quality_control
#: code:addons/nan_prodlot_quality_control/quality_control.py:75
#, python-format
msgid ""
"You are trying to cancel the Quality Control Test '%(test_name)s' (id:"
"%(test_id)d) but it is in a Test Trigger of the Production Lot "
"'%(lot_name)s' (id:%(lot_id)d) which is in '%(lot_state)s' state.\n"
"You can only cancel this test if it is the current test of the Lot and the "
"Lot's state is 'Waiting QC Test' or 'QC Test Failed"
msgstr ""
"You are trying to cancel the Quality Control Test '%(test_name)s' (id:"
"%(test_id)d) but it is in a Test Trigger of the Production Lot "
"'%(lot_name)s' (id:%(lot_id)d) which is in '%(lot_state)s' state.\n"
"You can only cancel this test if it is the current test of the Lot and the "
"Lot's state is 'Waiting QC Test' or 'QC Test Failed"
#. module: nan_prodlot_quality_control
#: field:product.qc.trigger.template,sequence:0
#: field:res.company.qc.trigger.template,sequence:0
#: field:stock.production.lot.qc.trigger.test,sequence:0
msgid "Sequence"
msgstr "Sequence"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_qc_test
msgid "qc.test"
msgstr "qc.test"
#. module: nan_prodlot_quality_control
#: view:product.product:0 view:res.company:0 view:stock.production.lot:0
msgid "Quality Control Triggers"
msgstr "Quality Control Triggers"
#. module: nan_prodlot_quality_control
#: field:stock.production.lot,current_qc_test_id:0
msgid "Current QC Test"
msgstr "Current QC Test"
#. module: nan_prodlot_quality_control
#: help:product.qc.trigger.template,template_id:0
#: help:res.company.qc.trigger.template,template_id:0
msgid "The Quality Control Template to use."
msgstr "The Quality Control Template to use."
#. module: nan_prodlot_quality_control
#: sql_constraint:product.qc.trigger.template:0
msgid ""
"The tuple QC Trigger Tag and Template Type must be unique for each Product "
"and Company!"
msgstr ""
"The tuple QC Trigger Tag and Template Type must be unique for each Product "
"and Company!"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
msgid "Inactive"
msgstr "Inactive"
#. module: nan_prodlot_quality_control
#: view:product.qc.trigger.template:0
msgid "QC Template Triggers by Product"
msgstr "QC Template Triggers by Product"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
#, fuzzy
msgid "Cancel"
msgstr "Cancel Prodlot"
#. module: nan_prodlot_quality_control
#: field:stock.production.lot.qc.trigger.test,test_approved:0
msgid "Test approved?"
msgstr "Test approved?"
#. module: nan_prodlot_quality_control
#: field:stock.production.lot,qc_test_trigger_ids:0
#: field:stock.production.lot,qc_test_trigger_ro_ids:0
msgid "QC Tests"
msgstr "QC Tests"
#. module: nan_prodlot_quality_control
#: code:addons/nan_prodlot_quality_control/stock.py:293
#, python-format
msgid ""
"It is trying to set a new next test for Production Lot '%(lot_name)s' (id: "
"%(lot_id)s) but it is in state '%(lot_state)s' when it is expected 'Draft' "
"or 'Valid' states to change the current test."
msgstr ""
"It is trying to set a new next test for Production Lot '%(lot_name)s' (id: "
"%(lot_id)s) but it is in state '%(lot_state)s' when it is expected 'Draft' "
"or 'Valid' states to change the current test."
#. module: nan_prodlot_quality_control
#: model:qc.proof,name:nan_prodlot_quality_control.qc_proof_simpleproof0
msgid "Simple Proof"
msgstr "Simple Proof"

477
i18n/es.po Normal file
View File

@ -0,0 +1,477 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * nan_prodlot_quality_control
#
# Guillem Barba <guillem@nan-tic.com>, 2012.
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 6.0.2\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2012-02-23 16:42+0000\n"
"PO-Revision-Date: 2012-02-23 17:41+0100\n"
"Last-Translator: Guillem Barba <guillem@nan-tic.com>\n"
"Language-Team: Spanish <>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
"X-Generator: Lokalize 1.2\n"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_stock_production_lot
msgid "Production lot"
msgstr "Lote producción"
#. module: nan_prodlot_quality_control
#: field:product.qc.trigger.template,template_type:0
#: field:stock.production.lot.qc.trigger.test,template_type:0
msgid "Template's Type"
msgstr "Tipo de plantilla"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
msgid "Next Test"
msgstr "Siguiente test"
#. module: nan_prodlot_quality_control
#: view:res.company.qc.trigger.template:0
msgid "QC Template Triggers by Company"
msgstr "Disparadores de QC Template Triggers by Company"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
msgid "Confirm"
msgstr "Confirmar"
#. module: nan_prodlot_quality_control
#: selection:product.qc.trigger.template,template_type:0
#: selection:stock.production.lot.qc.trigger.test,template_type:0
msgid "Generic"
msgstr "Genérico"
#. module: nan_prodlot_quality_control
#: constraint:res.company:0
msgid "Error! You can not create recursive companies."
msgstr "¡Error! No puede crear compañías recursivas."
#. module: nan_prodlot_quality_control
#: sql_constraint:res.company.qc.trigger.template:0
msgid "The QC Trigger Tag must be unique for each Company!"
msgstr "La etiqueta de disparador de calidad debe ser única por compañía!"
#. module: nan_prodlot_quality_control
#: field:stock.production.lot,current_qc_test_trigger_id:0
msgid "Current QC Test Trigger"
msgstr "Disparador de calidad actual"
#. module: nan_prodlot_quality_control
#: help:product.qc.trigger.template,trigger_id:0
#: help:stock.production.lot.qc.trigger.test,trigger_id:0
msgid ""
"The Quality Control Trigger Tag which defines when must to be created a Test "
"(using the specified template) for a Production Lot of this Product."
msgstr ""
"La etiqueta de disparador de calidad que define quando se creará un test "
"(usando la plantilla especificada) para un lote de producción de este "
"producto."
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0 field:stock.production.lot,state:0
msgid "State"
msgstr "Estado"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
msgid "Quality Control"
msgstr "Control de calidad"
#. module: nan_prodlot_quality_control
#: field:stock.production.lot.qc.trigger.test,prodlot_id:0
msgid "Lot"
msgstr "Lote"
#. module: nan_prodlot_quality_control
#: view:product.product:0 view:res.company:0
msgid "Quality Control Trigger"
msgstr "Disparador de calidad"
#. module: nan_prodlot_quality_control
#: field:stock.production.lot.qc.trigger.test,test_id:0
msgid "Test"
msgstr "Test"
#. module: nan_prodlot_quality_control
#: model:qc.test.template,name:nan_prodlot_quality_control.qc_test_template_generic0
msgid "Generic Template for Input Lots"
msgstr "Plantilla genérica para lotes de entrada"
#. module: nan_prodlot_quality_control
#: model:product.template,name:nan_prodlot_quality_control.product_w_2qctest0_product_template
msgid "Product with Two QC Test"
msgstr "Producto con dos test de calidad"
#. module: nan_prodlot_quality_control
#: help:stock.production.lot,qc_test_trigger_ids:0
msgid ""
"Defines the Quality Control Tests that this Production Lot must to pass in "
"certain situations defined by the Trigger Tag."
msgstr ""
"Define los test de calidad que este lote d eproducción debe pasar in ciertas "
"situaciones definidas por las etiquetas de disparadores."
#. module: nan_prodlot_quality_control
#: field:stock.production.lot.qc.trigger.test,test_success:0
msgid "Test success?"
msgstr "¿Test exitoso?"
#. module: nan_prodlot_quality_control
#: view:qc.trigger:0
msgid "Trigger Tag"
msgstr "Etiqueta de disparador"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
msgid "Force Cancel"
msgstr "Forzar cancelación"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_product_product
#: field:product.qc.trigger.template,product_id:0 view:stock.production.lot:0
msgid "Product"
msgstr "Producto"
#. module: nan_prodlot_quality_control
#: help:res.company.qc.trigger.template,trigger_id:0
msgid ""
"The Quality Control Trigger Tag which defines when must to be created a Test "
"(using the specified template) for a Production Lot."
msgstr ""
"La etiqueta de disparador de calidad que define cuando debe ser creado el "
"test (usando la plantilla especificada) para un lote."
#. module: nan_prodlot_quality_control
#: model:product.template,name:nan_prodlot_quality_control.product_wo_qc0_product_template
msgid "Product without Quality Control"
msgstr "Producto sin control de calidad"
#. module: nan_prodlot_quality_control
#: help:res.company,qc_template_trigger_ids:0
msgid ""
"Defines when a Production Lot must to pass a Quality Control Test (based on "
"the defined Template).\n"
"It defines the default Template Triggers which will be used when a Product "
"is created. Only the Product's field define the final behavior of its lots: "
"which template to use or don't require any test if there aren't any trigger "
"defined."
msgstr ""
"Define cuando un lote de producción debe pasar un test de calidad (basado en "
"la plantilla especificada).\n"
"Define los disparadores de plantillas de calidad por defecto que se usarán "
"al crear un producto. Solo lo especificado en la ficha del producto define "
"el comportamiento de los Lotes: qué plantilla usar o si no se requiere "
"ningún test (si no hay ningún disparador especificado)."
#. module: nan_prodlot_quality_control
#: field:product.qc.trigger.template,company_id:0
#: field:res.company.qc.trigger.template,company_id:0
msgid "Company"
msgstr "Compañía"
#. module: nan_prodlot_quality_control
#: help:product.product,qc_template_trigger_ids:0
msgid ""
"Defines when a Production Lot must to pass a Quality Control Test (based on "
"the defined Template).\n"
"It gets its default value for generic templates from the Company."
msgstr ""
"Define cuando un lote debe pasar un test de calidad (basado en la plantilla "
"especificada).\n"
"Obtiene de la compañía los valores por defecto para plantillas genéricas."
#. module: nan_prodlot_quality_control
#: view:stock.production.lot.qc.trigger.test:0
msgid "QC Test Triggers by Lot"
msgstr "Disparadores de test de calidad por lote"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot.qc.trigger.test:0
msgid "QC Test Trigger by Lot"
msgstr "Disparador de test de calidad por lote"
#. module: nan_prodlot_quality_control
#: constraint:product.product:0
msgid "Error: Invalid ean code"
msgstr "Error: Código EAN erróneo"
#. module: nan_prodlot_quality_control
#: field:product.product,qc_template_trigger_ids:0
#: field:product.product,qc_trigger_ids:0
#: field:res.company,qc_template_trigger_ids:0
#: field:stock.production.lot,qc_trigger_ids:0
msgid "QC Triggers"
msgstr "Disparadores de calidad"
#. module: nan_prodlot_quality_control
#: field:stock.production.lot,active:0
msgid "Active"
msgstr "Activo"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_res_company_qc_trigger_template
msgid "Quality Control Template Triggers by Company"
msgstr "Disparadores de plantillas de calidad por compañía"
#. module: nan_prodlot_quality_control
#: field:product.qc.trigger.template,template_id:0
#: field:res.company.qc.trigger.template,template_id:0
msgid "Template"
msgstr "Plantilla"
#. module: nan_prodlot_quality_control
#: view:res.company:0
msgid "Configuration"
msgstr "Configuración"
#. module: nan_prodlot_quality_control
#: model:product.template,name:nan_prodlot_quality_control.product_w_1qctest0_product_template
msgid "Product with One QC Test"
msgstr "Producto con un test de calidad"
#. module: nan_prodlot_quality_control
#: code:addons/nan_prodlot_quality_control/stock.py:516
#, python-format
msgid ""
"You are trying to cancel the Production Lots with IDs '%(lot_ids)s' which "
"are associated to QC Test workflow, and it is not allowed.\n"
"Please, use the 'Force Cancel' button or function to cancel a Lot in "
"'Pending Test' or 'Test Failed' state."
msgstr ""
"Está intentando cancelar los lotes de producción con ID '%(lot_ids)s' los "
"cuales están asociados a procesos activos de test de calidad, y esto no está "
"permitido.\n"
"Por favor, use el botón 'Forzar cancelación' o la función asociada para "
"cancelar los lotes en estado 'Pendiente de test' o 'Test fallido'."
#. module: nan_prodlot_quality_control
#: model:ir.actions.act_window,name:nan_prodlot_quality_control.action_qc_test_prodlot_view
#: model:ir.ui.menu,name:nan_prodlot_quality_control.qc_test_prodlot_menu
msgid "Production Lot Tests"
msgstr "Tests de lotes de producción"
#. module: nan_prodlot_quality_control
#: sql_constraint:qc.trigger:0
msgid "The Name of the Quality Control Trigger Tags must be unique!"
msgstr "¡El nombre de las etiquetas de disparadores de calidad debe ser único!"
#. module: nan_prodlot_quality_control
#: field:qc.trigger,name:0
msgid "Name"
msgstr "Nombre"
#. module: nan_prodlot_quality_control
#: sql_constraint:stock.production.lot.qc.trigger.test:0
msgid ""
"The tuple QC Trigger Tag and Template Type must be unique for each "
"Production Lot!"
msgstr ""
"¡La combinación de Etiqueta de disparador y Tipo de plantilla debe ser única "
"por cada lote!"
#. module: nan_prodlot_quality_control
#: model:qc.test.template,name:nan_prodlot_quality_control.qc_test_template_related0
msgid "Specific Template for Input Lots"
msgstr "Plantilla específica para lotes de entrada"
#. module: nan_prodlot_quality_control
#: code:addons/nan_prodlot_quality_control/quality_control.py:74
#, python-format
msgid "Error canceling Test!"
msgstr "¡Error cancelando test!"
#. module: nan_prodlot_quality_control
#: code:addons/nan_prodlot_quality_control/stock.py:515
#, python-format
msgid "Error Cancelling Lot with subflow!"
msgstr "¡Error cancelando lote con subproceso!"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_qc_trigger
msgid "Quality Control Trigger Tag"
msgstr "Etiqueta de disparador de calidad"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_res_company
msgid "Companies"
msgstr "Compañías"
#. module: nan_prodlot_quality_control
#: view:product.qc.trigger.template:0
msgid "QC Template Trigger by Product"
msgstr "Disparador de plantilla de calidad por producto"
#. module: nan_prodlot_quality_control
#: field:product.qc.trigger.template,trigger_id:0
#: field:res.company.qc.trigger.template,trigger_id:0
#: field:stock.production.lot.qc.trigger.test,trigger_id:0
msgid "Trigger"
msgstr "Disparador"
#. module: nan_prodlot_quality_control
#: model:qc.posible.value,name:nan_prodlot_quality_control.qc_posible_value_no0
msgid "No"
msgstr "No"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_product_qc_trigger_template
msgid "Quality Control Template Triggers by Product"
msgstr "Disparadores de plantillas de calidad por producto"
#. module: nan_prodlot_quality_control
#: model:ir.actions.act_window,name:nan_prodlot_quality_control.act_trigger_tag_view
#: model:ir.ui.menu,name:nan_prodlot_quality_control.menu_action_trigger_tag
#: view:qc.trigger:0
msgid "Trigger Tags"
msgstr "Etiquetas de disparador"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
msgid "Set To Draft"
msgstr "Cambiar a borrador"
#. module: nan_prodlot_quality_control
#: view:res.company.qc.trigger.template:0
msgid "QC Template Trigger by Company"
msgstr "Disparador de plantilla de calidad por producto"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_stock_production_lot_qc_trigger_test
msgid "Quality Control Test Triggers by Lot"
msgstr "Disparadores de tests de calidad por lote"
#. module: nan_prodlot_quality_control
#: code:addons/nan_prodlot_quality_control/stock.py:292
#, python-format
msgid "Error setting next test!"
msgstr "¡Error estableciendo siguiente test!"
#. module: nan_prodlot_quality_control
#: model:qc.posible.value,name:nan_prodlot_quality_control.qc_posible_value_yes0
msgid "Yes"
msgstr "Sí"
#. module: nan_prodlot_quality_control
#: sql_constraint:stock.production.lot:0
msgid ""
"The combination of serial number and internal reference must be unique !"
msgstr ""
"¡La combinación del número de serie y la referencia interna debe ser única!"
#. module: nan_prodlot_quality_control
#: model:product.template,name:nan_prodlot_quality_control.product_w_2qctest_diff_trigger0_product_template
msgid "Product with Two QC Test with different Trigger"
msgstr "Producto con dos test de calidad con diferente disparador"
#. module: nan_prodlot_quality_control
#: selection:product.qc.trigger.template,template_type:0
#: selection:stock.production.lot.qc.trigger.test,template_type:0
msgid "Specific"
msgstr "Específicos"
#. module: nan_prodlot_quality_control
#: code:addons/nan_prodlot_quality_control/quality_control.py:75
#, python-format
msgid ""
"You are trying to cancel the Quality Control Test '%(test_name)s' (id:"
"%(test_id)d) but it is in a Test Trigger of the Production Lot "
"'%(lot_name)s' (id:%(lot_id)d) which is in '%(lot_state)s' state.\n"
"You can only cancel this test if it is the current test of the Lot and the "
"Lot's state is 'Waiting QC Test' or 'QC Test Failed"
msgstr ""
"Está intentando cancelar el test de calidad '%(test_name)s' (id:%(test_id)d) "
"pero este está asociado a un disparador de test de calidad del lote de "
"producción '%(lot_name)s' (id:%(lot_id)d) el cual está en estado "
"'%(lot_state)s'.\n"
"Solo puede cancelar este tets si es el test actual del lote o si el lote "
"está en los estados 'Esperando test' o 'Test fallido'."
#. module: nan_prodlot_quality_control
#: field:product.qc.trigger.template,sequence:0
#: field:res.company.qc.trigger.template,sequence:0
#: field:stock.production.lot.qc.trigger.test,sequence:0
msgid "Sequence"
msgstr "Secuencia"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_qc_test
msgid "qc.test"
msgstr "qc.test"
#. module: nan_prodlot_quality_control
#: view:product.product:0 view:res.company:0 view:stock.production.lot:0
msgid "Quality Control Triggers"
msgstr "Disparadores de control de calidad"
#. module: nan_prodlot_quality_control
#: field:stock.production.lot,current_qc_test_id:0
msgid "Current QC Test"
msgstr "Test de calidad actual"
#. module: nan_prodlot_quality_control
#: help:product.qc.trigger.template,template_id:0
#: help:res.company.qc.trigger.template,template_id:0
msgid "The Quality Control Template to use."
msgstr "La plantilla de calidad a usar."
#. module: nan_prodlot_quality_control
#: sql_constraint:product.qc.trigger.template:0
msgid ""
"The tuple QC Trigger Tag and Template Type must be unique for each Product "
"and Company!"
msgstr ""
"¡La combinación de Etiqueta de disparador y Tipo de plantilla debe ser única "
"por cada producto y compañía!"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
msgid "Inactive"
msgstr "Inactivo"
#. module: nan_prodlot_quality_control
#: view:product.qc.trigger.template:0
msgid "QC Template Triggers by Product"
msgstr "Disparadores de plantillas de calidad por producto"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
msgid "Cancel"
msgstr "Cancelar"
#. module: nan_prodlot_quality_control
#: field:stock.production.lot.qc.trigger.test,test_approved:0
msgid "Test approved?"
msgstr "¿Test aprobado?"
#. module: nan_prodlot_quality_control
#: field:stock.production.lot,qc_test_trigger_ids:0
#: field:stock.production.lot,qc_test_trigger_ro_ids:0
msgid "QC Tests"
msgstr "Tests de calidad"
#. module: nan_prodlot_quality_control
#: code:addons/nan_prodlot_quality_control/stock.py:293
#, python-format
msgid ""
"It is trying to set a new next test for Production Lot '%(lot_name)s' (id: "
"%(lot_id)s) but it is in state '%(lot_state)s' when it is expected 'Draft' "
"or 'Valid' states to change the current test."
msgstr ""
"Se está intentado espablecer el siguiente test de calidad para el lote de "
"producción '%(lot_name)s' (id: %(lot_id)s) pero éste se encuentra en el "
"estado '%(lot_state)s' cuando se esperaba que fuera 'Borrador' o 'Válido' "
"para poder cambiar el test actual."
#. module: nan_prodlot_quality_control
#: model:qc.proof,name:nan_prodlot_quality_control.qc_proof_simpleproof0
msgid "Simple Proof"
msgstr "Prueba simple"

View File

@ -0,0 +1,420 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * nan_prodlot_quality_control
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 6.0.2\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2012-02-23 16:42+0000\n"
"PO-Revision-Date: 2012-02-23 16:42+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_stock_production_lot
msgid "Production lot"
msgstr "Production lot"
#. module: nan_prodlot_quality_control
#: field:product.qc.trigger.template,template_type:0
#: field:stock.production.lot.qc.trigger.test,template_type:0
msgid "Template's Type"
msgstr "Template's Type"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
msgid "Next Test"
msgstr "Next Test"
#. module: nan_prodlot_quality_control
#: view:res.company.qc.trigger.template:0
msgid "QC Template Triggers by Company"
msgstr "QC Template Triggers by Company"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
msgid "Confirm"
msgstr "Confirm"
#. module: nan_prodlot_quality_control
#: selection:product.qc.trigger.template,template_type:0
#: selection:stock.production.lot.qc.trigger.test,template_type:0
msgid "Generic"
msgstr "Generic"
#. module: nan_prodlot_quality_control
#: constraint:res.company:0
msgid "Error! You can not create recursive companies."
msgstr "Error! You can not create recursive companies."
#. module: nan_prodlot_quality_control
#: sql_constraint:res.company.qc.trigger.template:0
msgid "The QC Trigger Tag must be unique for each Company!"
msgstr "The QC Trigger Tag must be unique for each Company!"
#. module: nan_prodlot_quality_control
#: field:stock.production.lot,current_qc_test_trigger_id:0
msgid "Current QC Test Trigger"
msgstr "Current QC Test Trigger"
#. module: nan_prodlot_quality_control
#: help:product.qc.trigger.template,trigger_id:0
#: help:stock.production.lot.qc.trigger.test,trigger_id:0
msgid "The Quality Control Trigger Tag which defines when must to be created a Test (using the specified template) for a Production Lot of this Product."
msgstr "The Quality Control Trigger Tag which defines when must to be created a Test (using the specified template) for a Production Lot of this Product."
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
#: field:stock.production.lot,state:0
msgid "State"
msgstr "State"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
msgid "Quality Control"
msgstr "Quality Control"
#. module: nan_prodlot_quality_control
#: field:stock.production.lot.qc.trigger.test,prodlot_id:0
msgid "Lot"
msgstr "Lot"
#. module: nan_prodlot_quality_control
#: view:product.product:0
#: view:res.company:0
msgid "Quality Control Trigger"
msgstr "Quality Control Trigger"
#. module: nan_prodlot_quality_control
#: field:stock.production.lot.qc.trigger.test,test_id:0
msgid "Test"
msgstr "Test"
#. module: nan_prodlot_quality_control
#: model:qc.test.template,name:nan_prodlot_quality_control.qc_test_template_generic0
msgid "Generic Template for Input Lots"
msgstr "Generic Template for Input Lots"
#. module: nan_prodlot_quality_control
#: model:product.template,name:nan_prodlot_quality_control.product_w_2qctest0_product_template
msgid "Product with Two QC Test"
msgstr "Product with Two QC Test"
#. module: nan_prodlot_quality_control
#: help:stock.production.lot,qc_test_trigger_ids:0
msgid "Defines the Quality Control Tests that this Production Lot must to pass in certain situations defined by the Trigger Tag."
msgstr "Defines the Quality Control Tests that this Production Lot must to pass in certain situations defined by the Trigger Tag."
#. module: nan_prodlot_quality_control
#: field:stock.production.lot.qc.trigger.test,test_success:0
msgid "Test success?"
msgstr "Test success?"
#. module: nan_prodlot_quality_control
#: view:qc.trigger:0
msgid "Trigger Tag"
msgstr "Trigger Tag"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
msgid "Force Cancel"
msgstr "Force Cancel"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_product_product
#: field:product.qc.trigger.template,product_id:0
#: view:stock.production.lot:0
msgid "Product"
msgstr "Product"
#. module: nan_prodlot_quality_control
#: help:res.company.qc.trigger.template,trigger_id:0
msgid "The Quality Control Trigger Tag which defines when must to be created a Test (using the specified template) for a Production Lot."
msgstr "The Quality Control Trigger Tag which defines when must to be created a Test (using the specified template) for a Production Lot."
#. module: nan_prodlot_quality_control
#: model:product.template,name:nan_prodlot_quality_control.product_wo_qc0_product_template
msgid "Product without Quality Control"
msgstr "Product without Quality Control"
#. module: nan_prodlot_quality_control
#: help:res.company,qc_template_trigger_ids:0
msgid "Defines when a Production Lot must to pass a Quality Control Test (based on the defined Template).\n"
"It defines the default Template Triggers which will be used when a Product is created. Only the Product's field define the final behavior of its lots: which template to use or don't require any test if there aren't any trigger defined."
msgstr "Defines when a Production Lot must to pass a Quality Control Test (based on the defined Template).\n"
"It defines the default Template Triggers which will be used when a Product is created. Only the Product's field define the final behavior of its lots: which template to use or don't require any test if there aren't any trigger defined."
#. module: nan_prodlot_quality_control
#: field:product.qc.trigger.template,company_id:0
#: field:res.company.qc.trigger.template,company_id:0
msgid "Company"
msgstr "Company"
#. module: nan_prodlot_quality_control
#: help:product.product,qc_template_trigger_ids:0
msgid "Defines when a Production Lot must to pass a Quality Control Test (based on the defined Template).\n"
"It gets its default value for generic templates from the Company."
msgstr "Defines when a Production Lot must to pass a Quality Control Test (based on the defined Template).\n"
"It gets its default value for generic templates from the Company."
#. module: nan_prodlot_quality_control
#: view:stock.production.lot.qc.trigger.test:0
msgid "QC Test Triggers by Lot"
msgstr "QC Test Triggers by Lot"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot.qc.trigger.test:0
msgid "QC Test Trigger by Lot"
msgstr "QC Test Trigger by Lot"
#. module: nan_prodlot_quality_control
#: constraint:product.product:0
msgid "Error: Invalid ean code"
msgstr "Error: Invalid ean code"
#. module: nan_prodlot_quality_control
#: field:product.product,qc_template_trigger_ids:0
#: field:product.product,qc_trigger_ids:0
#: field:res.company,qc_template_trigger_ids:0
#: field:stock.production.lot,qc_trigger_ids:0
msgid "QC Triggers"
msgstr "QC Triggers"
#. module: nan_prodlot_quality_control
#: field:stock.production.lot,active:0
msgid "Active"
msgstr "Active"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_res_company_qc_trigger_template
msgid "Quality Control Template Triggers by Company"
msgstr "Quality Control Template Triggers by Company"
#. module: nan_prodlot_quality_control
#: field:product.qc.trigger.template,template_id:0
#: field:res.company.qc.trigger.template,template_id:0
msgid "Template"
msgstr "Template"
#. module: nan_prodlot_quality_control
#: view:res.company:0
msgid "Configuration"
msgstr "Configuration"
#. module: nan_prodlot_quality_control
#: model:product.template,name:nan_prodlot_quality_control.product_w_1qctest0_product_template
msgid "Product with One QC Test"
msgstr "Product with One QC Test"
#. module: nan_prodlot_quality_control
#: code:addons/nan_prodlot_quality_control/stock.py:516
#, python-format
msgid "You are trying to cancel the Production Lots with IDs '%(lot_ids)s' which are associated to QC Test workflow, and it is not allowed.\n"
"Please, use the 'Force Cancel' button or function to cancel a Lot in 'Pending Test' or 'Test Failed' state."
msgstr "You are trying to cancel the Production Lots with IDs '%(lot_ids)s' which are associated to QC Test workflow, and it is not allowed.\n"
"Please, use the 'Force Cancel' button or function to cancel a Lot in 'Pending Test' or 'Test Failed' state."
#. module: nan_prodlot_quality_control
#: model:ir.actions.act_window,name:nan_prodlot_quality_control.action_qc_test_prodlot_view
#: model:ir.ui.menu,name:nan_prodlot_quality_control.qc_test_prodlot_menu
msgid "Production Lot Tests"
msgstr "Production Lot Tests"
#. module: nan_prodlot_quality_control
#: sql_constraint:qc.trigger:0
msgid "The Name of the Quality Control Trigger Tags must be unique!"
msgstr "The Name of the Quality Control Trigger Tags must be unique!"
#. module: nan_prodlot_quality_control
#: field:qc.trigger,name:0
msgid "Name"
msgstr "Name"
#. module: nan_prodlot_quality_control
#: sql_constraint:stock.production.lot.qc.trigger.test:0
msgid "The tuple QC Trigger Tag and Template Type must be unique for each Production Lot!"
msgstr "The tuple QC Trigger Tag and Template Type must be unique for each Production Lot!"
#. module: nan_prodlot_quality_control
#: model:qc.test.template,name:nan_prodlot_quality_control.qc_test_template_related0
msgid "Specific Template for Input Lots"
msgstr "Specific Template for Input Lots"
#. module: nan_prodlot_quality_control
#: code:addons/nan_prodlot_quality_control/quality_control.py:74
#, python-format
msgid "Error canceling Test!"
msgstr "Error canceling Test!"
#. module: nan_prodlot_quality_control
#: code:addons/nan_prodlot_quality_control/stock.py:515
#, python-format
msgid "Error Cancelling Lot with subflow!"
msgstr "Error Cancelling Lot with subflow!"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_qc_trigger
msgid "Quality Control Trigger Tag"
msgstr "Quality Control Trigger Tag"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_res_company
msgid "Companies"
msgstr "Companies"
#. module: nan_prodlot_quality_control
#: view:product.qc.trigger.template:0
msgid "QC Template Trigger by Product"
msgstr "QC Template Trigger by Product"
#. module: nan_prodlot_quality_control
#: field:product.qc.trigger.template,trigger_id:0
#: field:res.company.qc.trigger.template,trigger_id:0
#: field:stock.production.lot.qc.trigger.test,trigger_id:0
msgid "Trigger"
msgstr "Trigger"
#. module: nan_prodlot_quality_control
#: model:qc.posible.value,name:nan_prodlot_quality_control.qc_posible_value_no0
msgid "No"
msgstr "No"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_product_qc_trigger_template
msgid "Quality Control Template Triggers by Product"
msgstr "Quality Control Template Triggers by Product"
#. module: nan_prodlot_quality_control
#: model:ir.actions.act_window,name:nan_prodlot_quality_control.act_trigger_tag_view
#: model:ir.ui.menu,name:nan_prodlot_quality_control.menu_action_trigger_tag
#: view:qc.trigger:0
msgid "Trigger Tags"
msgstr "Trigger Tags"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
msgid "Set To Draft"
msgstr "Set To Draft"
#. module: nan_prodlot_quality_control
#: view:res.company.qc.trigger.template:0
msgid "QC Template Trigger by Company"
msgstr "QC Template Trigger by Company"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_stock_production_lot_qc_trigger_test
msgid "Quality Control Test Triggers by Lot"
msgstr "Quality Control Test Triggers by Lot"
#. module: nan_prodlot_quality_control
#: code:addons/nan_prodlot_quality_control/stock.py:292
#, python-format
msgid "Error setting next test!"
msgstr "Error setting next test!"
#. module: nan_prodlot_quality_control
#: model:qc.posible.value,name:nan_prodlot_quality_control.qc_posible_value_yes0
msgid "Yes"
msgstr "Yes"
#. module: nan_prodlot_quality_control
#: sql_constraint:stock.production.lot:0
msgid "The combination of serial number and internal reference must be unique !"
msgstr "The combination of serial number and internal reference must be unique !"
#. module: nan_prodlot_quality_control
#: model:product.template,name:nan_prodlot_quality_control.product_w_2qctest_diff_trigger0_product_template
msgid "Product with Two QC Test with different Trigger"
msgstr "Product with Two QC Test with different Trigger"
#. module: nan_prodlot_quality_control
#: selection:product.qc.trigger.template,template_type:0
#: selection:stock.production.lot.qc.trigger.test,template_type:0
msgid "Specific"
msgstr "Specific"
#. module: nan_prodlot_quality_control
#: code:addons/nan_prodlot_quality_control/quality_control.py:75
#, python-format
msgid "You are trying to cancel the Quality Control Test '%(test_name)s' (id:%(test_id)d) but it is in a Test Trigger of the Production Lot '%(lot_name)s' (id:%(lot_id)d) which is in '%(lot_state)s' state.\n"
"You can only cancel this test if it is the current test of the Lot and the Lot's state is 'Waiting QC Test' or 'QC Test Failed"
msgstr "You are trying to cancel the Quality Control Test '%(test_name)s' (id:%(test_id)d) but it is in a Test Trigger of the Production Lot '%(lot_name)s' (id:%(lot_id)d) which is in '%(lot_state)s' state.\n"
"You can only cancel this test if it is the current test of the Lot and the Lot's state is 'Waiting QC Test' or 'QC Test Failed"
#. module: nan_prodlot_quality_control
#: field:product.qc.trigger.template,sequence:0
#: field:res.company.qc.trigger.template,sequence:0
#: field:stock.production.lot.qc.trigger.test,sequence:0
msgid "Sequence"
msgstr "Sequence"
#. module: nan_prodlot_quality_control
#: model:ir.model,name:nan_prodlot_quality_control.model_qc_test
msgid "qc.test"
msgstr "qc.test"
#. module: nan_prodlot_quality_control
#: view:product.product:0
#: view:res.company:0
#: view:stock.production.lot:0
msgid "Quality Control Triggers"
msgstr "Quality Control Triggers"
#. module: nan_prodlot_quality_control
#: field:stock.production.lot,current_qc_test_id:0
msgid "Current QC Test"
msgstr "Current QC Test"
#. module: nan_prodlot_quality_control
#: help:product.qc.trigger.template,template_id:0
#: help:res.company.qc.trigger.template,template_id:0
msgid "The Quality Control Template to use."
msgstr "The Quality Control Template to use."
#. module: nan_prodlot_quality_control
#: sql_constraint:product.qc.trigger.template:0
msgid "The tuple QC Trigger Tag and Template Type must be unique for each Product and Company!"
msgstr "The tuple QC Trigger Tag and Template Type must be unique for each Product and Company!"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
msgid "Inactive"
msgstr "Inactive"
#. module: nan_prodlot_quality_control
#: view:product.qc.trigger.template:0
msgid "QC Template Triggers by Product"
msgstr "QC Template Triggers by Product"
#. module: nan_prodlot_quality_control
#: view:stock.production.lot:0
msgid "Cancel"
msgstr "Cancel"
#. module: nan_prodlot_quality_control
#: field:stock.production.lot.qc.trigger.test,test_approved:0
msgid "Test approved?"
msgstr "Test approved?"
#. module: nan_prodlot_quality_control
#: field:stock.production.lot,qc_test_trigger_ids:0
#: field:stock.production.lot,qc_test_trigger_ro_ids:0
msgid "QC Tests"
msgstr "QC Tests"
#. module: nan_prodlot_quality_control
#: code:addons/nan_prodlot_quality_control/stock.py:293
#, python-format
msgid "It is trying to set a new next test for Production Lot '%(lot_name)s' (id: %(lot_id)s) but it is in state '%(lot_state)s' when it is expected 'Draft' or 'Valid' states to change the current test."
msgstr "It is trying to set a new next test for Production Lot '%(lot_name)s' (id: %(lot_id)s) but it is in state '%(lot_state)s' when it is expected 'Draft' or 'Valid' states to change the current test."
#. module: nan_prodlot_quality_control
#: model:qc.proof,name:nan_prodlot_quality_control.qc_proof_simpleproof0
msgid "Simple Proof"
msgstr "Simple Proof"

View File

@ -0,0 +1,149 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<record id="qc_posible_value_yes0" model="qc.posible.value">
<field name="name">Yes</field>
<field name="company_id" ref="base.main_company"/>
<field name="active" eval="1"/>
</record>
<record id="qc_posible_value_no0" model="qc.posible.value">
<field name="name">No</field>
<field name="company_id" ref="base.main_company"/>
<field name="active" eval="1"/>
</record>
<record id="qc_proof_simpleproof0" model="qc.proof">
<field name="name">Simple Proof</field>
<field name="type">qualitative</field>
<field name="value_ids" eval="[(6,0,[ref('qc_posible_value_yes0'),ref('qc_posible_value_no0')])]"/>
<field name="company_id" ref="base.main_company"/>
<field name="active" eval="1"/>
</record>
</data>
<data noupdate="1">
<record id="qc_test_template_generic0" model="qc.test.template">
<field name="name">Generic Template</field>
<field name="type">generic</field>
<field name="fill_correct_values" eval="0"/>
<field name="company_id" ref="base.main_company"/>
<field name="active" eval="1"/>
</record>
<record id="qc_test_template_line_generic0" model="qc.test.template.line">
<field name="test_template_id" ref="qc_test_template_generic0"/>
<field name="sequence" eval="1"/>
<field name="proof_id" ref="qc_proof_simpleproof0"/>
<field name="type">qualitative</field>
<field name="valid_value_ids" eval="[(6,0,[ref('qc_posible_value_yes0')])]"/>
<field name="company_id" ref="base.main_company"/>
</record>
</data>
<data noupdate="1">
<record id="qc_test_template_related0" model="qc.test.template">
<field name="name">Specific Template</field>
<field name="type">related</field>
<field name="fill_correct_values" eval="0"/>
<field name="company_id" ref="base.main_company"/>
<field name="active" eval="1"/>
</record>
<record id="qc_test_template_line_related0" model="qc.test.template.line">
<field name="test_template_id" ref="qc_test_template_related0"/>
<field name="sequence" eval="1"/>
<field name="proof_id" ref="qc_proof_simpleproof0"/>
<field name="type">qualitative</field>
<field name="valid_value_ids" eval="[(6,0,[ref('qc_posible_value_yes0')])]"/>
<field name="company_id" ref="base.main_company"/>
</record>
</data>
<data noupdate="1">
<record id="qc_trigger_demo0" model="qc.trigger">
<field name="name">Demo Trigger 1</field>
</record>
<record id="qc_trigger_demo1" model="qc.trigger">
<field name="name">Demo Trigger 2</field>
</record>
</data>
<data noupdate="1">
<record id="product_wo_qc0" model="product.product">
<field name="name">Product without Quality Control</field>
<field name="type">product</field>
<field name="categ_id" ref="product.cat0"/>
<field name="procure_method">make_to_stock</field>
<field name="supply_method">buy</field>
<field name="cost_method">standard</field>
<field name="type">product</field>
<field name="standard_price" eval="200.0"/>
<field name="uom_id" ref="product.product_uom_unit"/>
</record>
<record id="product_w_1qctest0" model="product.product">
<field name="name">Product with One QC Test</field>
<field name="type">product</field>
<field name="categ_id" ref="product.cat0"/>
<field name="procure_method">make_to_stock</field>
<field name="supply_method">buy</field>
<field name="cost_method">standard</field>
<field name="type">product</field>
<field name="standard_price" eval="350.0"/>
<field name="uom_id" ref="product.product_uom_unit"/>
</record>
<record id="product_trigger_template0" model="product.qc.trigger.template">
<field name="product_id" ref="product_w_1qctest0"/>
<field name="sequence" eval="1"/>
<field name="trigger_id" ref="qc_trigger_demo0"/>
<field name="template_type">generic</field>
<field name="template_id" ref="qc_test_template_generic0"/>
</record>
<record id="product_w_2qctest0" model="product.product">
<field name="name">Product with Two QC Test</field>
<field name="type">product</field>
<field name="categ_id" ref="product.cat0"/>
<field name="procure_method">make_to_stock</field>
<field name="supply_method">buy</field>
<field name="cost_method">standard</field>
<field name="type">product</field>
<field name="standard_price" eval="500.0"/>
<field name="uom_id" ref="product.product_uom_unit"/>
</record>
<record id="product_trigger_template1" model="product.qc.trigger.template">
<field name="product_id" ref="product_w_2qctest0"/>
<field name="sequence" eval="1"/>
<field name="trigger_id" ref="qc_trigger_demo0"/>
<field name="template_type">generic</field>
<field name="template_id" ref="qc_test_template_generic0"/>
</record>
<record id="product_trigger_template2" model="product.qc.trigger.template">
<field name="product_id" ref="product_w_2qctest0"/>
<field name="sequence" eval="1"/>
<field name="trigger_id" ref="qc_trigger_demo0"/>
<field name="template_type">related</field>
<field name="template_id" ref="qc_test_template_related0"/>
</record>
<record id="product_w_2qctest_diff_trigger0" model="product.product">
<field name="name">Product with Two QC Test with different Trigger</field>
<field name="type">product</field>
<field name="categ_id" ref="product.cat0"/>
<field name="procure_method">make_to_stock</field>
<field name="supply_method">buy</field>
<field name="cost_method">standard</field>
<field name="type">product</field>
<field name="standard_price" eval="500.0"/>
<field name="uom_id" ref="product.product_uom_unit"/>
</record>
<record id="product_trigger_template3" model="product.qc.trigger.template">
<field name="product_id" ref="product_w_2qctest_diff_trigger0"/>
<field name="sequence" eval="1"/>
<field name="trigger_id" ref="qc_trigger_demo0"/>
<field name="template_type">generic</field>
<field name="template_id" ref="qc_test_template_generic0"/>
</record>
<record id="product_trigger_template4" model="product.qc.trigger.template">
<field name="product_id" ref="product_w_2qctest_diff_trigger0"/>
<field name="sequence" eval="1"/>
<field name="trigger_id" ref="qc_trigger_demo1"/>
<field name="template_type">generic</field>
<field name="template_id" ref="qc_test_template_generic0"/>
</record>
</data>
</openerp>

View File

@ -21,6 +21,8 @@
<record id="act_next_test" model="workflow.activity">
<field name="wkf_id" ref="wkf_prodlot"/>
<field name="name">next_test</field>
<field name="kind">function</field>
<field name="action">action_wofkflow_next_test()</field>
</record>
<record id="act_pending_test" model="workflow.activity">
@ -34,8 +36,7 @@
<record id="act_valid" model="workflow.activity">
<field name="wkf_id" ref="wkf_prodlot"/>
<field name="name">valid</field>
<field name="kind">subflow</field>
<field name="subflow_id" ref="nan_quality_control.wkf_qc_test"/>
<field name="kind">function</field>
<field name="action">action_wofkflow_valid()</field>
</record>
@ -76,9 +77,9 @@
</record>
<!-- Pending Test Output Transitions -->
<record id="trans_pending_test_valid" model="workflow.transition">
<record id="trans_pending_test_next_test" model="workflow.transition">
<field name="act_from" ref="act_pending_test"/>
<field name="act_to" ref="act_valid"/>
<field name="act_to" ref="act_next_test"/>
<!-- <field name="condition">test_valid()</field> -->
<field name="signal">subflow.success</field>
</record>
@ -89,9 +90,15 @@
<field name="signal">subflow.failed</field>
</record>
<record id="trans_valid_cancel" model="workflow.transition">
<field name="act_from" ref="act_valid"/>
<record id="trans_pending_test_cancel" model="workflow.transition">
<field name="act_from" ref="act_pending_test"/>
<field name="act_to" ref="act_cancel"/>
<!--
To be able to go out of 'subflow' activity without subflow signal,
the workitem must to be disassociated of any subflow.
It could be done with 'force_cancel' function which after raise
'cancel' signal -->
<field name="condition">test_not_qc_test_subflow()</field>
<field name="signal">cancel</field>
</record>
@ -99,15 +106,10 @@
<record id="trans_valid_next_test" model="workflow.transition">
<field name="act_from" ref="act_valid"/>
<field name="act_to" ref="act_next_test"/>
<field name="condition">test_pending_test()</field>
<field name="signal">next_test</field>
</record>
<record id="trans_valid_pending_test" model="workflow.transition">
<field name="act_from" ref="act_valid"/>
<field name="act_to" ref="act_pending_test"/>
<field name="signal">subflow.draft</field>
</record>
<record id="trans_valid_cancel" model="workflow.transition">
<field name="act_from" ref="act_valid"/>
<field name="act_to" ref="act_cancel"/>
@ -124,6 +126,12 @@
<record id="trans_test_failed_cancel" model="workflow.transition">
<field name="act_from" ref="act_test_failed"/>
<field name="act_to" ref="act_cancel"/>
<!--
To be able to go out of 'subflow' activity without subflow signal,
the workitem must to be disassociated of any subflow.
It could be done with 'force_cancel' function which after raise
'cancel' signal -->
<field name="condition">test_not_qc_test_subflow()</field>
<field name="signal">cancel</field>
</record>

View File

@ -56,8 +56,13 @@ class product_qc_trigger_template(osv.osv):
'company_id': fields.many2one('res.company', 'Company'),
}
def _default_company_id(self, cr, uid, context=None):
user = self.pool.get('res.users').browse(cr, uid, uid, context)
return user.company_id.id
_defaults = {
'sequence': 0,
'company_id': _default_company_id,
}
_sql_constraints = [
@ -77,6 +82,52 @@ class product_product(osv.osv):
'''
_inherit = 'product.product'
# product.product
def _calc_trigger_ids(self, cr, uid, ids, fieldname, args, context=None):
trigger_template_proxy = self.pool.get('product.qc.trigger.template')
res = {}
for product_id in ids:
res[product_id] = []
trigger_template_ids = trigger_template_proxy.search(cr, uid,
[('product_id','=',product_id)], context=context)
for trigger_template in trigger_template_proxy.browse(cr, uid,
trigger_template_ids, context):
if trigger_template.trigger_id.id not in res[product_id]:
res[product_id].append(trigger_template.trigger_id.id)
return res
# product.product
def _search_trigger_ids(self, cr, uid, obj, name, args, context):
trigger_template_proxy = self.pool.get('product.qc.trigger.template')
res = []
for fieldname, operator, condition in args:
opposite = False
if 'in' in operator:
if operator == 'not in':
operator = 'in'
opposite = True
else:
if operator in ('!=', '<>'):
operator = '='
opposite = True
template_trigger_ids = trigger_template_proxy.search(cr, uid,
[('trigger_id', operator, condition)], context=context)
product_ids = []
for template_trigger in trigger_template_proxy.browse(cr, uid,
template_trigger_ids, context):
product_ids.append(template_trigger.product_id.id)
operator = 'in'
if opposite:
operator = 'not in'
res.append(('id', operator, product_ids))
return res
_columns = {
'qc_template_trigger_ids': fields.one2many(
'product.qc.trigger.template', 'product_id', 'QC Triggers',
@ -84,6 +135,9 @@ class product_product(osv.osv):
"Control Test (based on the defined Template).\n"
"It gets its default value for generic templates from the "
"Company."),
'qc_trigger_ids': fields.function(_calc_trigger_ids, method=True,
type='many2many', relation='qc.trigger', string='QC Triggers',
fnct_search=_search_trigger_ids),
}
# product.product

View File

@ -28,6 +28,7 @@
##############################################################################
from osv import osv, fields
from tools.translate import _
class qc_trigger(osv.osv):
_name = 'qc.trigger'
@ -43,4 +44,49 @@ class qc_trigger(osv.osv):
]
qc_trigger()
class qc_test(osv.osv):
_inherit = 'qc.test'
# qc.test
def action_wofkflow_draft(self, cr, uid, ids, context=None):
"""
Check if the Test is in any Lot Trigger Test. In these case, raise an
exception if the Test is not the current test of Lot or it is not in
'Draft', 'Waiting QC Test' or 'QC Test Failed' states.
"""
lot_test_proxy = self.pool.get('stock.production.lot.qc.trigger.test')
lot_test_ids = lot_test_proxy.search(cr, uid, [('test_id','in',ids)],
context=context)
for lot_test in lot_test_proxy.browse(cr, uid, lot_test_ids, context):
if lot_test.prodlot_id.state == 'draft':
continue
if (lot_test.id == lot_test.prodlot_id.current_qc_test_trigger_id.id
and lot_test.prodlot_id.state in
('pending_test', 'test_failed', 'draft')):
continue
state_labels = self.pool.get('stock.production.lot').fields_get(cr,
uid, ['state'], context)['state']['selection']
state_labels = dict(state_labels)
raise osv.except_osv(
_("Error canceling Test!"),
_("You are trying to cancel the Quality Control Test "
"'%(test_name)s' (id:%(test_id)d) but it is in a Test "
"Trigger of the Production Lot '%(lot_name)s' "
"(id:%(lot_id)d) which is in '%(lot_state)s' state.\n"
"You can only cancel this test if it is the current test "
"of the Lot and the Lot's state is 'Waiting QC Test' or "
"'QC Test Failed") % {
'test_name': lot_test.test_id.name,
'test_id': lot_test.test_id.id,
'lot_name': lot_test.prodlot_id.name,
'lot_id': lot_test.prodlot_id.id,
'lot_state': state_labels[lot_test.prodlot_id.state],
})
return super(qc_test, self).action_wofkflow_draft(cr, uid, ids, context)
qc_test()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -8,3 +8,6 @@
"access_product_qc_trigger_template_stock_user","product.qc.trigger.template stock user","model_product_qc_trigger_template","stock.group_stock_user",1,0,0,0
"access_product_qc_trigger_template_stock_manager","product.qc.trigger.template stock manager","model_product_qc_trigger_template","stock.group_stock_manager",1,1,1,1
"access_product_qc_trigger_template_qc_manager","product.qc.trigger.template qc manager","model_product_qc_trigger_template","nan_quality_control.group_quality_control_manager",1,1,1,1
"access_prodlot_qc_trigger_test_employee","stock.production.lot.qc.trigger.test employee","model_stock_production_lot_qc_trigger_test","base.group_user",1,0,0,0
"access_prodlot_qc_trigger_test_stock_user","stock.production.lot.qc.trigger.test stock user","model_stock_production_lot_qc_trigger_test","stock.group_stock_user",1,0,1,0
"access_prodlot_qc_trigger_test_stock_manager","stock.production.lot.qc.trigger.test stock manager","model_stock_production_lot_qc_trigger_test","stock.group_stock_manager",1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
8 access_product_qc_trigger_template_stock_user product.qc.trigger.template stock user model_product_qc_trigger_template stock.group_stock_user 1 0 0 0
9 access_product_qc_trigger_template_stock_manager product.qc.trigger.template stock manager model_product_qc_trigger_template stock.group_stock_manager 1 1 1 1
10 access_product_qc_trigger_template_qc_manager product.qc.trigger.template qc manager model_product_qc_trigger_template nan_quality_control.group_quality_control_manager 1 1 1 1
11 access_prodlot_qc_trigger_test_employee stock.production.lot.qc.trigger.test employee model_stock_production_lot_qc_trigger_test base.group_user 1 0 0 0
12 access_prodlot_qc_trigger_test_stock_user stock.production.lot.qc.trigger.test stock user model_stock_production_lot_qc_trigger_test stock.group_stock_user 1 0 1 0
13 access_prodlot_qc_trigger_test_stock_manager stock.production.lot.qc.trigger.test stock manager model_stock_production_lot_qc_trigger_test stock.group_stock_manager 1 1 1 1

433
stock.py
View File

@ -28,6 +28,7 @@
##############################################################################
from osv import osv, fields
from tools.translate import _
import netsvc
class stock_production_lot_qc_trigger_test(osv.osv):
@ -75,7 +76,7 @@ class stock_production_lot_qc_trigger_test(osv.osv):
_columns = {
'prodlot_id': fields.many2one('stock.production.lot', 'Lot',
required=True),
required=True, ondelete="cascade"),
'sequence': fields.integer('Sequence', required=True),
'trigger_id': fields.many2one('qc.trigger', 'Trigger', required=True,
help="The Quality Control Trigger Tag which defines when must "
@ -115,8 +116,9 @@ class stock_production_lot(osv.osv):
'''
_inherit = 'stock.production.lot'
# stock.production.lot
def _get_available_states(self, cr, uid, context=None):
def get_available_states(self, cr, uid, context=None):
"""
Returns the list of available states for Lot objects. It is defined as
a function to make easier to extend the list of states.
@ -129,23 +131,38 @@ class stock_production_lot(osv.osv):
('cancel', 'Cancelled'),
]
# stock.production.lot
def get_available_states(self, cr, uid, context=None):
def __get_available_states(self, cr, uid, context=None):
"""
Returns the list of available states for Lot objects.
It call's the function '_get_available_states' which could be
reimplemented to extend or modify the list of available states.
@see: _get_available_states
"""
return self._get_available_states(cr, uid, context)
return self.get_available_states(cr, uid, context)
# stock.production.lot
def _calc_test_trigger_ro_ids(self, cr, uid, ids, fieldname, args,
def _calc_test_trigger_data(self, cr, uid, ids, fieldnames, args,
context=None):
trigger_proxy = self.pool.get('stock.production.lot.qc.trigger.test')
res = {}
for lot_triggers in self.read(cr, uid, ids, ['qc_test_trigger_ids'],
for lot_id in ids:
res[lot_id] = {}.fromkeys(fieldnames, [])
lot_trigger_ids = trigger_proxy.search(cr, uid,
[('prodlot_id', 'in', ids)], context=context)
for lot_trigger in trigger_proxy.browse(cr, uid, lot_trigger_ids,
context):
res[lot_triggers['id']] = lot_triggers['qc_test_trigger_ids']
lot_id = lot_trigger.prodlot_id.id
if 'qc_test_trigger_ro_ids' in fieldnames:
res[lot_id]['qc_test_trigger_ro_ids'].append(lot_trigger.id)
if 'qc_trigger_ids' in fieldnames:
res[lot_id]['qc_trigger_ids'].append(lot_trigger.trigger_id.id)
return res
@ -154,11 +171,12 @@ class stock_production_lot(osv.osv):
'product_id': fields.many2one('product.product', 'Product',
required=True, readonly=True,
states={'draft': [('readonly', False)]}),
'state': fields.selection(get_available_states,
'State', required=True, readonly=True),
'state': fields.selection(__get_available_states, 'State',
required=True, readonly=True),
# 'state': fields.selection(
# lambda self, cr, uid, context=None: self.get_available_states,
# 'State', required=True, readonly=True),
'active': fields.boolean('Active'),
'qc_test_trigger_ids': fields.one2many(
'stock.production.lot.qc.trigger.test', 'prodlot_id',
@ -166,9 +184,14 @@ class stock_production_lot(osv.osv):
"Production Lot must to pass in certain situations defined by "
"the Trigger Tag."),
# Read Only version of previous field. Better solutions are wellcome
'qc_test_trigger_ro_ids': fields.function(_calc_test_trigger_ro_ids,
'qc_test_trigger_ro_ids': fields.function(_calc_test_trigger_data,
method=True, type='one2many', string='QC Tests',
relation='stock.production.lot.qc.trigger.test'),
relation='stock.production.lot.qc.trigger.test',
multi='trigges'),
'qc_trigger_ids': fields.function(_calc_test_trigger_data, method=True,
type='many2many', string='QC Triggers', relation='qc.trigger',
multi='trigges'),
'current_qc_test_trigger_id': fields.many2one(
'stock.production.lot.qc.trigger.test',
'Current QC Test Trigger',
@ -181,42 +204,193 @@ class stock_production_lot(osv.osv):
_defaults = {
'state': 'draft',
'active': True,
}
# stock.production.lot
def _calc_qc_test_vals(self, cr, uid, prodlot, context):
"""
Prepare data to create a qc.test instance related to a Production Lot
@param prodlot: Browse object of stock.production.lot
@return: Dictionary of stock.production.lot values
"""
reference = 'stock.production.lot,%d' % prodlot.id
return {
'object_id': reference,
}
# stock.production.lot
def _calc_qc_test_trigger_ids_vals(self, cr, uid, prodlot, trigger_id,
context):
"""
Prepare data to create and write in the field 'qc_test_trigger_ids' of
Production Lot the QC Test Triggers corresponding to the supplied
trigger.
@param prodlot: Browse object of stock.production.lot instance
@param trigger_id: ID of qc.trigger instance
@return: Dictionary of stock.production.lot values
"""
qc_test_proxy = self.pool.get('qc.test')
if trigger_id in [x.id for x in prodlot.qc_trigger_ids]:
netsvc.Logger().notifyChannel(self._name, netsvc.LOG_DEBUG,
"Lot id:%d already has QC Test Trigger for Trigger %d" % (
prodlot.id, trigger_id))
return False
if trigger_id not in [x.id for x in prodlot.product_id.qc_trigger_ids]:
netsvc.Logger().notifyChannel(self._name, netsvc.LOG_DEBUG,
"Product id:%d of Lot id:%d doesn't have QC Template "
"Trigger for Trigger %d" % (prodlot.product_id.id,
prodlot.id, trigger_id))
return False
test_trigger_vals = []
for template_trigger in prodlot.product_id.qc_template_trigger_ids:
if template_trigger.trigger_id.id != trigger_id:
continue
test_vals = self._calc_qc_test_vals(cr, uid, prodlot, context)
test_id = qc_test_proxy.create(cr, uid, test_vals, context)
qc_test_proxy.set_test_template(cr, uid, [test_id],
template_trigger.template_id.id, context)
test_trigger_vals.append((0, 0, {
'sequence': template_trigger.sequence,
'trigger_id': template_trigger.trigger_id.id,
'template_type': template_trigger.template_type,
'test_id': test_id,
}))
if not test_trigger_vals:
return False
return {
'qc_test_trigger_ids': test_trigger_vals,
}
# stock.production.lot
def create_qc_test_triggers(self, cr, uid, prodlot, trigger_id,
set_next_test, context):
"""
Create and write into Production Lot the Trigger Test corresponding to
supplied Trigger, getting templates configuration and QC templates from
the Product of Lot.
@param prodlot: Browse object of stock.production.lot instance
@param trigger_id: ID of qc.trigger instance
@param set_next_test: Sets the first Test of Trigger as current_qc_test_id and move Lot workflow to Pending Test
@return: Boolean value depending of triggers has been created
@raise except_osv: If set_next_test is True and Lot is not in 'Draft' or 'Valid' state
"""
trigger_proxy = self.pool.get('stock.production.lot.qc.trigger.test')
wf_service = netsvc.LocalService("workflow")
if set_next_test and prodlot.state not in ('draft', 'valid'):
raise osv.except_osv(
_("Error setting next test!"),
_("It is trying to set a new next test for Production Lot "
"'%(lot_name)s' (id: %(lot_id)s) but it is in state "
"'%(lot_state)s' when it is expected 'Draft' or 'Valid' "
"states to change the current test.") % {
'lot_name': prodlot.name,
'lot_id': prodlot.id,
'lot_state': prodlot.state,
})
test_trigger_vals = self._calc_qc_test_trigger_ids_vals(cr, uid,
prodlot, trigger_id, context)
if test_trigger_vals:
self.write(cr, uid, [prodlot.id], test_trigger_vals, context)
res = True
else:
res = False
if not set_next_test:
return res
trigger_test_ids = trigger_proxy.search(cr, uid, [
('prodlot_id', '=', prodlot.id),
('trigger_id', '=', trigger_id),
], order='sequence asc', limit=1, context=context)
if trigger_test_ids:
self.write(cr, uid, [prodlot.id],
{'current_qc_test_trigger_id': trigger_test_ids[0]},
context)
# If 'set_next_test' is true it move the workflow independly if the Lot
# has any test (in this case it will be moved to 'Valid' state
if prodlot.state == 'draft':
wf_service.trg_validate(uid, 'stock.production.lot', prodlot.id,
'confirm', cr)
else:
wf_service.trg_validate(uid, 'stock.production.lot', prodlot.id,
'next_test', cr)
return res
# stock.production.lot
def action_wofkflow_draft(self, cr, uid, ids, context=None):
"""
Sets the State of Lot to 'Draft'
Sets the State of Lot to 'Draft' and deactivate it
"""
self.write(cr, uid, ids, {'state': 'draft'}, context)
self.write(cr, uid, ids, {'state': 'draft', 'active': False}, context)
return True
# stock.production.lot
def test_pending_test(self, cr, uid, ids, context=None):
def _get_next_test_trigger_id(self, cr, uid, prodlot, context):
"""
Checks that Production Lot has a Current Test and it is not Approved
(test is not in any final state)
Calculates the Lot Trigger Test Id for the next Test to pass.
If there isn't a current trigger test specified, it returns False.
If the current Trigger Test is not 'Success', it returns this.
In other case, search the next trigger test (by Sequence) with the same
Trigger and return its Id.
@param prodlot: Browse object of stock.production.lot
@return: ID of stock.production.lot.qc.trigger.test instance or False
"""
trigger_proxy = self.pool.get('stock.production.lot.qc.trigger.test')
if not prodlot.current_qc_test_trigger_id:
return False
# if current test is not 'Success' => it remains as Current test
if not prodlot.current_qc_test_trigger_id.test_success:
return prodlot.current_qc_test_trigger_id.id
# if current test is 'Success' => search next test for the same trigger
current_trigger = prodlot.current_qc_test_trigger_id
next_trigger_ids = trigger_proxy.search(cr, uid, [
('prodlot_id', '=', prodlot.id),
('id', '!=', current_trigger.id),
('sequence', '>=', current_trigger.sequence),
('trigger_id', '=', current_trigger.trigger_id.id),
], limit=1, context=context)
return next_trigger_ids and next_trigger_ids[0] or False
# stock.production.lot
def action_wofkflow_next_test(self, cr, uid, ids, context=None):
"""
Find the Next Test to pass and write it to 'current_qc_test_trigger_id'
field.
It will be empty if there isn't any current test or there aren't any
next test for current Trigger.
It will maintain the current test trigger if its test is not 'Success'
@see: _get_next_test_trigger_id
@param ids: List of IDs of stock.production.lot
"""
for prodlot in self.browse(cr, uid, ids, context):
if (not prodlot.current_qc_test_id or
prodlot.current_qc_test_trigger_id.test_approved):
return False
next_trigger_id = self._get_next_test_trigger_id(cr, uid, prodlot,
context)
self.write(cr, uid, [prodlot.id], {
'current_qc_test_trigger_id': next_trigger_id,
}, context)
return True
# stock.production.lot
def action_wofkflow_pending_test(self, cr, uid, ids, context=None):
"""
Sets the State of Lot to 'Pending Test'
"""
assert len(ids) == 1, "Unexpected number of Lot IDs in function of " \
"'Pending Test' workflow step."
self.write(cr, uid, ids, {'state': 'pending_test'}, context)
return self.browse(cr, uid, ids[0], context).current_qc_test_id.id
# stock.production.lot
def test_valid(self, cr, uid, ids, context=None):
"""
@ -233,69 +407,190 @@ class stock_production_lot(osv.osv):
# stock.production.lot
def action_wofkflow_valid(self, cr, uid, ids, context=None):
"""
Sets the State of Lot to 'Valid' and, for Lots with Current Test,
search the next Test with the same Trigger (ordered by Test Trigger
sequence) and, if it exists, sets as 'Current QC Test Trigger' and
move the workflow of Lot to 'Next Test' step.
Sets the State of Lot to 'Valid' and activate the Lot.
"""
self.write(cr, uid, ids, {
'current_qc_test_trigger_id': False,
'state': 'valid',
'active': True,
}, context)
return True
# stock.production.lot
def test_pending_test(self, cr, uid, ids, context=None):
"""
Checks that Production Lot has a Current Test and it is not Success
"""
for prodlot in self.browse(cr, uid, ids, context):
if (not prodlot.current_qc_test_id or
prodlot.current_qc_test_trigger_id.test_success):
return False
return True
# stock.production.lot
def action_wofkflow_pending_test(self, cr, uid, ids, context=None):
"""
Sets the State of Lot to 'Pending Test' and deactivate it, and returns
the ID of current QC Test.
"""
assert len(ids) == 1, "Unexpected number of Lot IDs in function of " \
"'Pending Test' workflow step."
trigger_proxy = self.pool.get('stock.production.lot.qc.trigger.test')
wf_service = netsvc.LocalService("workflow")
lot = self.browse(cr, uid, ids[0], context)
assert lot.current_qc_test_id, "The 'Current Test' field is required " \
"for the Lots which reaches the 'Pending Test' workflow step, "\
"but the Lot %d doesn't have." % lot.id
prodlot = self.browse(cr, uid, ids[0], context)
if not prodlot.current_qc_test_id:
return True
current_trigger = prodlot.current_qc_test_trigger_id
next_trigger_ids = trigger_proxy.search(cr, uid, [
('prodlot_id', '=', prodlot.id),
('id', '!=', current_trigger.id),
('sequence', '>=', current_trigger.sequence),
('trigger_id', '=', current_trigger.trigger_id.id),
], limit=1, context=context)
if next_trigger_ids:
prodlot_w_next_test.append(prodlot.id)
self.write(cr, uid, prodlot.id, {
'current_qc_test_trigger_id': next_trigger_ids[0],
'state': 'valid',
}, context)
wf_service.trg_validate(uid, 'stock.production.lot',
next_trigger_ids[0], 'next_test', cr)
return True
self.write(cr, uid, ids, {'state': 'valid'}, context)
return current_trigger.test_id.id
self.write(cr, uid, ids, {
'state': 'pending_test',
'active': False,
}, context)
return lot.current_qc_test_id.id
# stock.production.lot
def action_wofkflow_test_failed(self, cr, uid, ids, context=None):
"""
Sets the State of Lot to 'Test Failed' and returns the ID of current
Test
Sets the State of Lot to 'Test Failed', deactivate it and returns the
ID of current Test
"""
assert len(ids) == 1, "Unexpected number of Lot IDs in function of " \
"'Pending Test' workflow step."
prodlot = self.browse(cr, uid, ids[0], context)
self.write(cr, uid, ids, {'state': 'test_failed'}, context)
return prodlot.current_qc_test_trigger_id.test_id.id
lot = self.browse(cr, uid, ids[0], context)
assert lot.current_qc_test_id, "The 'Current Test' field is required " \
"for the Lots which reaches the 'Test Failed' workflow step, "\
"but the Lot %d doesn't have." % lot.id
self.write(cr, uid, ids, {
'state': 'test_failed',
'active': False,
}, context)
return lot.current_qc_test_id.id
def test_not_qc_test_subflow(self, cr, uid, ids, context=None):
"""
To be able to go out of 'subflow' activity without subflow signal,
the workitem must to be disassociated of any subflow.
It could be done with 'force_cancel' function which after raise
'cancel' signal
"""
workitem_proxy = self.pool.get('workflow.workitem')
workflow_ids = self.pool.get('workflow').search(cr, uid, [
('osv', '=', 'stock.production.lot'),
('name', '=', 'stock.production.lot.basic'),
], context=context)
assert len(workflow_ids) == 1, "Unexpected number of workflows for " \
"'stock.production.lot' with name " \
"'stock.production.lot.basic'. Expected 1 and found %d" \
% len(workflow_ids)
instance_ids = self.pool.get('workflow.instance').search(cr, uid, [
('wkf_id', '=', workflow_ids[0]),
('res_type', '=', 'stock.production.lot'),
('res_id', 'in', ids),
('state', '=', 'active'),
], context)
if not instance_ids:
netsvc.Logger().notifyChannel(self._name, netsvc.LOG_WARNING,
"Unexpected not found any active Workflow Instance for "
"Production Lots with ids '%s' in test_not_qc_test_subflow "
"function." % str(ids))
return True
workitem_ids = workitem_proxy.search(cr, uid, [
('inst_id', 'in', instance_ids),
('state', '=', 'running'),
('subflow_id', '!=', False),
], context=context)
if not workitem_ids:
return True
lot_w_subflow = [str(wi.inst_id.res_id)
for wi in workitem_proxy.browse(cr, uid, workitem_ids, context)]
raise osv.osv_exception(
_("Error Cancelling Lot with subflow!"),
_("You are trying to cancel the Production Lots with IDs "
"'%(lot_ids)s' which are associated to QC Test workflow, and "
"it is not allowed.\n"
"Please, use the 'Force Cancel' button or function to cancel "
"a Lot in 'Pending Test' or 'Test Failed' state.") % {
'lot_ids': ", ".join(lot_w_subflow),
})
return False
# stock.production.lot
def action_wofkflow_cancel(self, cr, uid, ids, context=None):
"""
Sets the State of Lot to 'Cancel' and leave empty the 'Current QC Test
Trigger' field.
Sets the State of Lot to 'Cancel', deactivate it and leave empty the
'Current QC Test Trigger' field.
"""
self.write(cr, uid, ids, {
'current_qc_test_trigger_id': False,
'state': 'cancel',
'active': False,
}, context)
return True
# stock.production.lot
def action_force_cancel(self, cr, uid, ids, context=None):
"""
Find Workitems (workflow) for these Lots with subflow and disassociate
them and sets their state to 'complete', and raise a 'cancel' signal
for all supplied Lot's ID's.
"""
workitem_proxy = self.pool.get('workflow.workitem')
wf_service = netsvc.LocalService("workflow")
workflow_ids = self.pool.get('workflow').search(cr, uid, [
('osv', '=', 'stock.production.lot'),
('name', '=', 'stock.production.lot.basic'),
], context=context)
assert len(workflow_ids) == 1, "Unexpected number of workflows for " \
"'stock.production.lot' with name " \
"'stock.production.lot.basic'. Expected 1 and found %d" \
% len(workflow_ids)
instance_ids = self.pool.get('workflow.instance').search(cr, uid, [
('wkf_id', '=', workflow_ids[0]),
('res_type', '=', 'stock.production.lot'),
('res_id', 'in', ids),
('state', '=', 'active'),
], context)
if instance_ids:
workitem_ids = workitem_proxy.search(cr, uid, [
('inst_id', 'in', instance_ids),
('state', '=', 'running'),
('subflow_id', '!=', False),
], context=context)
if workitem_ids:
workitem_proxy.write(cr, uid, workitem_ids, {
'subflow_id': False,
'state': 'complete',
}, context)
for lot_id in ids:
wf_service.trg_validate(uid, 'stock.production.lot', lot_id,
'cancel', cr)
return True
# stock.production.lot
def copy(self, cr, uid, orig_id, default=None, context=None):
"""
It only duplicate the trigger tests if the context has a True value for
'duplicate_trigger_test' key
"""
if not context or not context.get('duplicate_trigger_test'):
default['qc_test_trigger_ids'] = False
return super(stock_production_lot, self).copy(cr, uid, orig_id, default,
context)
stock_production_lot()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -48,6 +48,10 @@
<field name="type">form</field>
<field name="inherit_id" ref="stock.view_production_lot_form" />
<field name="arch" type="xml">
<field name="date" position="replace">
<field name="date"/>
<field name="active"/>
</field>
<notebook position="inside">
<page string="Quality Control">
<separator string="Quality Control Triggers" colspan="4"/>
@ -82,8 +86,9 @@
<button name="draft" states="cancel" string="Set To Draft" icon="gtk-new"/>
<button name="confirm" states="draft" string="Confirm" icon="gtk-ok"/>
<button name="next_test" states="valid" string="Next Test" icon="gtk-ok" />
<button name="cancel" states="pending_test,valid,test_failed" string="Cancel Prodlot" icon="gtk-cancel" />
<button name="next_test" states="valid" string="Next Test" icon="gtk-ok"/>
<button name="cancel" states="valid" string="Cancel" icon="gtk-cancel"/>
<button name="action_force_cancel" type="object" states="pending_test,test_failed" string="Force Cancel" icon="gtk-cancel"/>
</group>
</form>
</field>
@ -108,6 +113,9 @@
<field name="type">search</field>
<field name="inherit_id" ref="stock.search_product_lot_filter"/>
<field name="arch" type="xml">
<filter name="available" position="after">
<filter icon="terp-dialog-close" name="inactive" string="Inactive" domain="[('active', '=', False)]"/>
</filter>
<filter string="Product" position="after">
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
</filter>

View File

@ -0,0 +1,287 @@
-
------ Prodlot Quality Control with One Trigger Test ------
-
In order to test the workflow and functionality of Production Lots with one
Trigger Test, it create a Lot with a trigger test and move it with all
workflow, from Draft to Valid and to Test Failed, passing by the Cancel state
(and reusing it after that).
-
I create a Production Lot of Product with one QC Test (Lot2)
-
!record {model: stock.production.lot, id: prodlot_w_1qctest0}:
product_id: nan_prodlot_quality_control.product_w_1qctest0
-
I create its Trigger Test calling function 'create_qc_test_triggers' but not
setting the 'next test' (param of function)
-
!python {model: stock.production.lot}: |
lot = self.browse(cr, uid, ref('prodlot_w_1qctest0'), context)
self.create_qc_test_triggers(cr, uid, lot,
ref('nan_prodlot_quality_control.qc_trigger_demo0'), False, context)
-
Checking the Lot2 exists, it has one Trigger Tests with expected trigger and
Test Template and it's in 'Draft' state
-
!python {model: stock.production.lot}: |
lot = self.browse(cr, uid, ref('prodlot_w_1qctest0'), context)
assert lot.state == 'draft', "The Lot2 doesn't have the expected 'Draft' " \
"state: %s" % lot.state
assert len(lot.qc_test_trigger_ids) == 1, "The Lot2 doesn't have exactly " \
"one Test Trigger as expected: %d" % len(lot.qc_test_trigger_ids)
assert (lot.qc_test_trigger_ids[0].test_id.test_template_id.id ==
ref('qc_test_template_generic0')), "The Lot2 doesn't have the " \
"expected test template 'Generic Template' in its Trigger Test: %s " \
% lot.qc_test_trigger_ids[0].test_id.test_template_id.name
assert lot.qc_test_trigger_ids[0].trigger_id.id == ref('qc_trigger_demo0'),\
"The Lot2 doesn't have the expected Trigger 'Demo Trigger 1' in its " \
"Trigger Test: %s " % lot.qc_test_trigger_ids[0].trigger_id.name
-
I set the current Test manually and confirm the Lot2
-
!python {model: stock.production.lot}: |
import netsvc
lot = self.browse(cr, uid, ref('prodlot_w_1qctest0'), context)
self.write(cr, uid, [ref('prodlot_w_1qctest0')],
{'current_qc_test_trigger_id': lot.qc_test_trigger_ids[0].id}, context)
netsvc.LocalService("workflow").trg_validate(uid, 'stock.production.lot',
ref('prodlot_w_1qctest0'), 'confirm', cr)
-
Checking the 'Current Test Trigger' of Lot2 is the expected and it's in
'Pending Test' state
-
!python {model: stock.production.lot}: |
lot = self.browse(cr, uid, ref('prodlot_w_1qctest0'), context)
assert lot.state == 'pending_test', "The Lot2 doesn't have the expected " \
"'pending_test' state: %s" % lot.state
assert lot.current_qc_test_trigger_id.id == lot.qc_test_trigger_ids[0].id,\
"The Lot2 doesn't have its Trigger test as 'Current Trigger Test': " \
"%d != %d" % (lot.current_qc_test_trigger_id.id,
lot.qc_test_trigger_ids[0].id)
-
I fill up the current Quality Test with INVALID values and I confirm it
-
!python {model: stock.production.lot}: |
import netsvc
lot = self.browse(cr, uid, ref('prodlot_w_1qctest0'), context)
test_line_id = lot.current_qc_test_id.test_line_ids[0].id
self.pool.get('qc.test.line').write(cr, uid, [test_line_id],
{'actual_value_ql': ref('qc_posible_value_no0')}, context)
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.current_qc_test_id.id, 'confirm', cr)
-
Checking the Lot2 remains in 'pending_test' state and it's current test is in
'waiting' state and not 'success'
-
!python {model: stock.production.lot}: |
lot = self.browse(cr, uid, ref('prodlot_w_1qctest0'), context)
assert lot.state == 'pending_test', "The Lot2 doesn't have the expected " \
"'pending_test' state: %s" % lot.state
assert lot.current_qc_test_id.state == 'waiting', "The Current Test of " \
"Lot2 doesn't have the expected 'waiting' state: %s" \
% lot.current_qc_test_id.state
assert lot.current_qc_test_id.success == False, "The Current Test of Lot2 "\
"is, unexpectly, successful: %s" % str(lot.current_qc_test_id.success)
-
I aprove the current Quality Test of Lot2
-
!python {model: stock.production.lot}: |
import netsvc
lot = self.browse(cr, uid, ref('prodlot_w_1qctest0'), context)
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.current_qc_test_id.id, 'approve', cr)
-
Checking Lot2 is in 'test_failed' state because its current QC Test is in
'fail' state.
-
!assert {model: stock.production.lot, id: prodlot_w_1qctest0, string: The Lot2 or its current QC Test aren't in the expected state!}:
- state == 'test_failed'
- current_qc_test_id.state == 'failed'
-
I cancel the current Quality Test of Lot2
-
!python {model: stock.production.lot}: |
import netsvc
lot = self.browse(cr, uid, ref('prodlot_w_1qctest0'), context)
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.current_qc_test_id.id, 'cancel', cr)
-
Checking Lot2 is in 'pending_test' state because its current QC Test is in
'draft' state.
-
!assert {model: stock.production.lot, id: prodlot_w_1qctest0, string: The Lot2 or its current QC Test aren't in the expected state!}:
- state == 'pending_test'
- current_qc_test_id.state == 'draft'
-
I Confirm and Aprove the current Quality Test of Lot2
-
!python {model: stock.production.lot}: |
import netsvc
lot = self.browse(cr, uid, ref('prodlot_w_1qctest0'), context)
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.current_qc_test_id.id, 'confirm', cr)
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.current_qc_test_id.id, 'approve', cr)
-
Checking Lot2 is in 'test_failed' state because its current QC Test is in
'fail' state.
-
!assert {model: stock.production.lot, id: prodlot_w_1qctest0, string: The Lot2 or its current QC Test aren't in the expected state!}:
- state == 'test_failed'
- current_qc_test_id.state == 'failed'
-
I cancel the Lot2 using the function 'action_force_cancel'
-
!python {model: stock.production.lot}: |
self.action_force_cancel(cr, uid, [ref('prodlot_w_1qctest0')], context)
-
Checking Lot2 is in 'cancel' state and inactive.
-
!assert {model: stock.production.lot, id: prodlot_w_1qctest0, string: The Lot2 isn't in the expected state!}:
- state == 'cancel'
- active == False
-
Checking that now I can't cancel the Test of Lot3 because the Lot must to
be in 'Draft' state
-
!python {model: stock.production.lot}: |
from osv import osv
import netsvc
lot = self.browse(cr, uid, ref('prodlot_w_1qctest0'), context)
try:
cr.execute('SAVEPOINT not_allwed_cancel')
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.qc_test_trigger_ids[0].test_id.id, 'cancel', cr)
raise Exception("ERROR: We can cancel the First Test of Lot3 (%s) but it "
"shouldn't be able." % str(qc_test_trigger_ids[0]))
except osv.except_osv, e:
print "OK: We can't cancel the Test of Lot2: %s" % str(e.value)
cr.execute('ROLLBACK TO SAVEPOINT not_allwed_cancel')
-
I set to Draft the Lot2.
-
!python {model: stock.production.lot}: |
import netsvc
netsvc.LocalService("workflow").trg_validate(uid, 'stock.production.lot',
ref('prodlot_w_1qctest0'), 'draft', cr)
-
I cancel the Quality Test of Lot2
-
!python {model: stock.production.lot}: |
import netsvc
lot = self.browse(cr, uid, ref('prodlot_w_1qctest0'), context)
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.qc_test_trigger_ids[0].test_id.id, 'cancel', cr)
-
I set the Current Test Trigger and I Confirm it.
-
!python {model: stock.production.lot}: |
import netsvc
lot = self.browse(cr, uid, ref('prodlot_w_1qctest0'), context)
self.write(cr, uid, [ref('prodlot_w_1qctest0')],
{'current_qc_test_trigger_id': lot.qc_test_trigger_ids[0].id}, context)
netsvc.LocalService("workflow").trg_validate(uid, 'stock.production.lot',
ref('prodlot_w_1qctest0'), 'confirm', cr)
-
Checking the 'Current Test Trigger' of Lot2 is the expected and it's in
'Pending Test' state
-
!python {model: stock.production.lot}: |
lot = self.browse(cr, uid, ref('prodlot_w_1qctest0'), context)
assert lot.state == 'pending_test', "The Lot2 doesn't have the expected " \
"'pending_test' state: %s" % lot.state
assert lot.current_qc_test_trigger_id.id == lot.qc_test_trigger_ids[0].id,\
"The Lot2 doesn't have its Trigger test as 'Current Trigger Test': " \
"%d != %d" % (lot.current_qc_test_trigger_id.id,
lot.qc_test_trigger_ids[0].id)
-
I change the value of current Quality Test with valid value and Confirm and
Aprove it.
-
!python {model: stock.production.lot}: |
import netsvc
lot = self.browse(cr, uid, ref('prodlot_w_1qctest0'), context)
test_line_id = lot.current_qc_test_id.test_line_ids[0].id
self.pool.get('qc.test.line').write(cr, uid, [test_line_id],
{'actual_value_ql': ref('qc_posible_value_yes0')}, context)
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.current_qc_test_id.id, 'confirm', cr)
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.current_qc_test_id.id, 'approve', cr)
-
Checking Lot2 is in 'valid' state because its QC Test is 'success' and now it
doesn't have 'Current Test (Trigger)'.
-
!python {model: stock.production.lot}: |
lot = self.browse(cr, uid, ref('prodlot_w_1qctest0'), context)
assert lot.state == 'valid', "The Lot2 doesn't have the expected 'valid' " \
"state: %s" % lot.state
assert lot.qc_test_trigger_ids[0].test_success == True, "The Trigger " \
"Test of Lot2 is, unexpectly, not successful: %s" \
% str(lot.qc_test_trigger_ids[0].test_success)
assert lot.qc_test_trigger_ids[0].test_id.state == 'success', \
"The QC Test of Lot2 doesn't have the expected 'success' state: %s" \
% lot.qc_test_trigger_ids[0].test_id.state
assert not lot.current_qc_test_trigger_id, "The Lot2 has, unexpectly, a " \
"current Trigger Test: %s" % str(lot.current_qc_test_trigger_id)
-
I cancel the Lot2
-
!python {model: stock.production.lot}: |
import netsvc
netsvc.LocalService("workflow").trg_validate(uid, 'stock.production.lot',
ref('prodlot_w_1qctest0'), 'cancel', cr)
-
Checking Lot2 is in 'cancel' state.
-
!assert {model: stock.production.lot, id: prodlot_w_1qctest0, string: The Lot2 isn't in the expected state!}:
- state == 'cancel'
-
------ Prodlot Quality Control END OK ------
-
!python {model: stock.production.lot}: |
print "THE END"

View File

@ -0,0 +1,368 @@
-
------ Prodlot Quality Control with Two Trigger Test ------
-
In order to test the workflow and functionality of Production Lots with two
Trigger Test with the same Trigger (and check the automatic request of second
test after Success the first), it create a Lot with two trigger test and move
it for all workflow, from Draft to Valid and to Test Failed, passing by the
Cancel state (and reusing it after that).
-
I create a Production Lot of Product with two QC Test (Lot3)
-
!record {model: stock.production.lot, id: prodlot_w_2qctest0}:
product_id: nan_prodlot_quality_control.product_w_2qctest0
-
I create its Trigger Test calling function 'create_qc_test_triggers' setting
the 'next test' (param of function)
-
!python {model: stock.production.lot}: |
lot = self.browse(cr, uid, ref('prodlot_w_2qctest0'), context)
self.create_qc_test_triggers(cr, uid, lot,
ref('nan_prodlot_quality_control.qc_trigger_demo0'), True, context)
-
Checking the Lot3 exists, it has two Trigger Tests with expected trigger and
Test Template, the Current Test Trigger is the expected and it's in
'Pending Test' state and inactive
-
!python {model: stock.production.lot}: |
lot = self.browse(cr, uid, ref('prodlot_w_2qctest0'), context)
assert lot.state == 'pending_test', "The Lot3 doesn't have the expected " \
"'pending_test' state: %s" % lot.state
assert lot.active == False, "The Lot3 is unexpectly active"
assert len(lot.qc_test_trigger_ids) == 2, "The Lot3 doesn't have exactly " \
"two Test Trigger as expected: %d" % len(lot.qc_test_trigger_ids)
assert (lot.qc_test_trigger_ids[0].test_id.test_template_id.id ==
ref('qc_test_template_generic0')), "The Lot3 doesn't have the " \
"expected test template 'Generic Template' in its first Trigger Test: "\
"%s " % lot.qc_test_trigger_ids[0].test_id.test_template_id.name
assert lot.qc_test_trigger_ids[0].trigger_id.id == ref('qc_trigger_demo0'),\
"The Lot3 doesn't have the expected Trigger 'Demo Trigger 1' in its " \
"first Trigger Test: %s " % lot.qc_test_trigger_ids[0].trigger_id.name
assert (lot.qc_test_trigger_ids[1].test_id.test_template_id.id ==
ref('qc_test_template_related0')), "The Lot3 doesn't have the " \
"expected test template 'Specific Template' in its second Trigger " \
"Test: %s " % lot.qc_test_trigger_ids[1].test_id.test_template_id.name
assert lot.qc_test_trigger_ids[1].trigger_id.id == ref('qc_trigger_demo0'),\
"The Lot3 doesn't have the expected Trigger 'Demo Trigger 1' in its " \
"second Trigger Test: %s " % lot.qc_test_trigger_ids[1].trigger_id.name
assert lot.current_qc_test_trigger_id.id == lot.qc_test_trigger_ids[0].id,\
"The Lot3 doesn't have its first Trigger test as 'Current Trigger " \
"Test': %d != %d" % (lot.current_qc_test_trigger_id.id,
lot.qc_test_trigger_ids[0].id)
-
I fill up the current Quality Test with INVALID values and I Confirm and
Aprove it
-
!python {model: stock.production.lot}: |
import netsvc
lot = self.browse(cr, uid, ref('prodlot_w_2qctest0'), context)
test_line_id = lot.current_qc_test_id.test_line_ids[0].id
self.pool.get('qc.test.line').write(cr, uid, [test_line_id],
{'actual_value_ql': ref('qc_posible_value_no0')}, context)
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.current_qc_test_id.id, 'confirm', cr)
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.current_qc_test_id.id, 'approve', cr)
-
Checking Lot3 is in 'test_failed' state (and inactive) because its current QC
Test is in 'fail' state.
-
!assert {model: stock.production.lot, id: prodlot_w_2qctest0, string: The Lot3 or its current QC Test aren't in the expected state!}:
- state == 'test_failed'
- active == False
- current_qc_test_id.state == 'failed'
-
I cancel the current Quality Test of Lot3
-
!python {model: stock.production.lot}: |
import netsvc
lot = self.browse(cr, uid, ref('prodlot_w_2qctest0'), context)
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.current_qc_test_id.id, 'cancel', cr)
-
Checking Lot3 is in 'pending_test' state (and inactive) because its current
QC Test is in 'draft' state.
-
!assert {model: stock.production.lot, id: prodlot_w_2qctest0, string: The Lot3 or its current QC Test aren't in the expected state!}:
- state == 'pending_test'
- active == False
- current_qc_test_id.state == 'draft'
-
I Confirm and Aprove the current Quality Test of Lot3
-
!python {model: stock.production.lot}: |
import netsvc
lot = self.browse(cr, uid, ref('prodlot_w_2qctest0'), context)
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.current_qc_test_id.id, 'confirm', cr)
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.current_qc_test_id.id, 'approve', cr)
-
Checking Lot3 is in 'test_failed' state (and inactive) because its current
QC Test is in 'fail' state.
-
!assert {model: stock.production.lot, id: prodlot_w_2qctest0, string: The Lot3 or its current QC Test aren't in the expected state!}:
- state == 'test_failed'
- active == False
- current_qc_test_id.state == 'failed'
-
I try to cancel the Lot3 from 'Test Failed' state
-
!python {model: stock.production.lot}: |
import netsvc
netsvc.LocalService("workflow").trg_validate(uid, 'stock.production.lot',
ref('prodlot_w_2qctest0'), 'cancel', cr)
-
Checking Lot3 remains in 'test_failed' state because it can't be used the
'cancel' signal directly to cancel a Lot in 'Test Failed' state.
-
!assert {model: stock.production.lot, id: prodlot_w_2qctest0, string: The Lot3 is not in the expected state!}:
- state == 'test_failed'
- active == False
- current_qc_test_id.state == 'failed'
-
I cancel the Lot3 using the function 'action_force_cancel'
-
!python {model: stock.production.lot}: |
self.action_force_cancel(cr, uid, [ref('prodlot_w_2qctest0')], context)
-
Checking Lot3 is in 'cancel' state and inactive.
-
!assert {model: stock.production.lot, id: prodlot_w_2qctest0, string: The Lot3 isn't in the expected state!}:
- state == 'cancel'
- active == False
- not current_qc_test_trigger_id
- qc_test_trigger_ids[0].test_id.state == 'failed'
-
I set to Draft the Lot3 for be able to Cancel the Quality Test.
-
!python {model: stock.production.lot}: |
import netsvc
netsvc.LocalService("workflow").trg_validate(uid, 'stock.production.lot',
ref('prodlot_w_2qctest0'), 'draft', cr)
-
I cancel the first Quality Test of Lot3
-
!python {model: stock.production.lot}: |
import netsvc
lot = self.browse(cr, uid, ref('prodlot_w_2qctest0'), context)
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.qc_test_trigger_ids[0].test_id.id, 'cancel', cr)
-
I set the Current Test Trigger and I confirm it.
-
!python {model: stock.production.lot}: |
import netsvc
lot = self.browse(cr, uid, ref('prodlot_w_2qctest0'), context)
self.write(cr, uid, [ref('prodlot_w_2qctest0')],
{'current_qc_test_trigger_id': lot.qc_test_trigger_ids[0].id}, context)
netsvc.LocalService("workflow").trg_validate(uid, 'stock.production.lot',
ref('prodlot_w_2qctest0'), 'confirm', cr)
-
Checking the 'Current Test Trigger' of Lot3 is the expected and it's in
'Pending Test' state
-
!python {model: stock.production.lot}: |
lot = self.browse(cr, uid, ref('prodlot_w_2qctest0'), context)
assert lot.state == 'pending_test', "The Lot3 doesn't have the expected " \
"'pending_test' state: %s" % lot.state
assert lot.current_qc_test_trigger_id.id == lot.qc_test_trigger_ids[0].id,\
"The Lot3 doesn't have its Trigger test as 'Current Trigger Test': " \
"%d != %d" % (lot.current_qc_test_trigger_id.id,
lot.qc_test_trigger_ids[0].id)
assert lot.current_qc_test_id.state == 'draft',\
"The Current Test of Lot3 is not in the expected 'Draft' state: %s" \
% lot.current_qc_test_id.state
-
I change the value of current Quality Test with valid value and Confirm and
Aprove it.
-
!python {model: stock.production.lot}: |
import netsvc
lot = self.browse(cr, uid, ref('prodlot_w_2qctest0'), context)
test_line_id = lot.current_qc_test_id.test_line_ids[0].id
self.pool.get('qc.test.line').write(cr, uid, [test_line_id],
{'actual_value_ql': ref('qc_posible_value_yes0')}, context)
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.current_qc_test_id.id, 'confirm', cr)
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.current_qc_test_id.id, 'approve', cr)
-
Checking Lot3 is in 'pending_test' state (and inactive) because its Current
Trigger Test is now the second Trigger Test of Lot and its test is in 'draft'
state, and the first Trigger Test is 'success'.
-
!python {model: stock.production.lot}: |
lot = self.browse(cr, uid, ref('prodlot_w_2qctest0'), context)
assert lot.state == 'pending_test', "The Lot3 doesn't have the expected " \
"'pending_test' state: %s" % lot.state
assert lot.active == False, "The Lot3 is unexpectly active"
assert lot.current_qc_test_id.state == 'draft', "The Current Test of Log3 "\
"isn't in the expected 'Draft' state: %s" % lot.current_qc_test_id.state
assert lot.qc_test_trigger_ids[0].test_success == True, "The first " \
"Trigger Test of Lot3 is, unexpectly, not successful: %s" \
% str(lot.qc_test_trigger_ids[0].test_success)
assert lot.current_qc_test_trigger_id.id == lot.qc_test_trigger_ids[1].id, \
"The Lot3 has not the expected second Trigger Test (%d) as Current: %s"\
% (lot.qc_test_trigger_ids[1].id,
str(lot.current_qc_test_trigger_id))
-
Checking that now I can't cancel the Test of first Trigger Test of Lot3
-
!python {model: stock.production.lot}: |
from osv import osv
import netsvc
lot = self.browse(cr, uid, ref('prodlot_w_2qctest0'), context)
try:
cr.execute('SAVEPOINT not_allwed_cancel')
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.qc_test_trigger_ids[0].test_id.id, 'cancel', cr)
raise Exception("ERROR: We can cancel the First Test of Lot3 (%s) but it "
"shouldn't be able." % str(qc_test_trigger_ids[0]))
except osv.except_osv, e:
print "OK: We can't cancel the First Test of Lot3: %s" % str(e.value)
cr.execute('ROLLBACK TO SAVEPOINT not_allwed_cancel')
-
I try to cancel the Lot3 from 'Pending Test' state
-
!python {model: stock.production.lot}: |
import netsvc
netsvc.LocalService("workflow").trg_validate(uid, 'stock.production.lot',
ref('prodlot_w_2qctest0'), 'cancel', cr)
-
Checking Lot3 remains in 'pending_test' state because it can't be used the
'cancel' signal directly to cancel a Lot in 'Pending Test' state.
-
!assert {model: stock.production.lot, id: prodlot_w_2qctest0, string: The Lot3 is not in the expected state!}:
- state == 'pending_test'
- active == False
-
I cancel the Lot3 using the function 'action_force_cancel'
-
!python {model: stock.production.lot}: |
self.action_force_cancel(cr, uid, [ref('prodlot_w_2qctest0')], context)
-
Checking Lot3 is in 'Cancel' state and inactive, and doesn't has 'Current
Test' defined.
-
!assert {model: stock.production.lot, id: prodlot_w_2qctest0, string: The Lot3 is not in the expected state!}:
- state == 'cancel'
- active == False
- not current_qc_test_trigger_id
-
I change the state of Lot3 to 'Draft', I set its first Test Trigger as Current
and I Confirm it.
-
!python {model: stock.production.lot}: |
import netsvc
netsvc.LocalService("workflow").trg_validate(uid, 'stock.production.lot',
ref('prodlot_w_2qctest0'), 'draft', cr)
lot = self.browse(cr, uid, ref('prodlot_w_2qctest0'), context)
self.write(cr, uid, [ref('prodlot_w_2qctest0')],
{'current_qc_test_trigger_id': lot.qc_test_trigger_ids[0].id}, context)
netsvc.LocalService("workflow").trg_validate(uid, 'stock.production.lot',
ref('prodlot_w_2qctest0'), 'confirm', cr)
-
Checking the 'Current Test Trigger' of Lot3 is its second Test Trigger and the
state of Lot is 'Pending Test' because its first Test is 'Success' and second
is 'Draft'
-
!python {model: stock.production.lot}: |
lot = self.browse(cr, uid, ref('prodlot_w_2qctest0'), context)
assert lot.state == 'pending_test', "The Lot3 doesn't have the expected " \
"'pending_test' state: %s" % lot.state
assert lot.current_qc_test_trigger_id.id == lot.qc_test_trigger_ids[1].id,\
"The Lot3 doesn't have its second Trigger Test as 'Current Trigger " \
"Test': %d != %d" % (lot.current_qc_test_trigger_id.id,
lot.qc_test_trigger_ids[1].id)
assert lot.current_qc_test_id.state == 'draft', "The current test (second)"\
" is not in the expected 'Draft' state."
assert lot.qc_test_trigger_ids[0].test_success, "The first Test Trigger " \
"is not success: %s" % lot.qc_test_trigger_ids[0].test_id.state
-
I set valid values to the Current Test of Lot3 and I Confirm and Aprove it.
-
!python {model: stock.production.lot}: |
import netsvc
lot = self.browse(cr, uid, ref('prodlot_w_2qctest0'), context)
test_line_id = lot.current_qc_test_id.test_line_ids[0].id
self.pool.get('qc.test.line').write(cr, uid, [test_line_id],
{'actual_value_ql': ref('qc_posible_value_yes0')}, context)
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.current_qc_test_id.id, 'confirm', cr)
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.current_qc_test_id.id, 'approve', cr)
-
Checking Lot3 is in 'valid' state (and ACTIVE) because its Two tests are
'success' and it doesn't have current test.
-
!python {model: stock.production.lot}: |
lot = self.browse(cr, uid, ref('prodlot_w_2qctest0'), context)
assert lot.state == 'valid', "The Lot3 doesn't have the expected 'valid' " \
"state: %s" % lot.state
assert lot.active == True, "The Lot3 is unexpectly inactive"
assert not lot.current_qc_test_trigger_id, "The Lot3 has unexpectly " \
"Current Test Trigger: %s" % str(lot.current_qc_test_trigger_id)
assert lot.qc_test_trigger_ids[0].test_success == True, "The first " \
"Trigger Test of Lot3 is, unexpectly, not successful: %s" \
% str(lot.qc_test_trigger_ids[0].test_success)
assert lot.qc_test_trigger_ids[1].test_success == True, "The second " \
"Trigger Test of Lot3 is, unexpectly, not successful: %s" \
% str(lot.qc_test_trigger_ids[1].test_success)
-
------ Prodlot Quality Control END OK ------
-
!python {model: stock.production.lot}: |
print "THE END"

View File

@ -0,0 +1,366 @@
-
------ Prodlot Quality Control with Two Trigger Test ------
-
In order to test the workflow and functionality of Production Lots with two
Trigger Test with different Trigger, I create a Lot with two trigger test and
move it for all workflow, from Draft to Valid and to Test Failed, passing by
the Cancel state (and reusing it after that).
-
I create a Production Lot of Product with two QC Test with different triggers
(Lot4)
-
!record {model: stock.production.lot, id: prodlot_w_2qctest_difftrigger0}:
product_id: nan_prodlot_quality_control.product_w_2qctest_diff_trigger0
-
I create its Trigger Test calling function 'create_qc_test_triggers' setting
the 'next test' (param of function) for the first trigger and without this
param for the second trigger
-
!python {model: stock.production.lot}: |
lot = self.browse(cr, uid, ref('prodlot_w_2qctest_difftrigger0'), context)
self.create_qc_test_triggers(cr, uid, lot,
ref('nan_prodlot_quality_control.qc_trigger_demo0'), True, context)
self.create_qc_test_triggers(cr, uid, lot,
ref('nan_prodlot_quality_control.qc_trigger_demo1'), False, context)
-
Checking the Lot4 exists, it has two Trigger Tests with expected Trigger and
Test Template, the Current Test Trigger is the expected and it's in
'Pending Test' state
-
!python {model: stock.production.lot}: |
lot = self.browse(cr, uid, ref('prodlot_w_2qctest_difftrigger0'), context)
assert lot.state == 'pending_test', "The Lot4 doesn't have the expected " \
"'pending_test' state: %s" % lot.state
assert len(lot.qc_test_trigger_ids) == 2, "The Lot4 doesn't have exactly " \
"two Test Trigger as expected: %d" % len(lot.qc_test_trigger_ids)
assert (lot.qc_test_trigger_ids[0].test_id.test_template_id.id ==
ref('qc_test_template_generic0')), "The Lot4 doesn't have the " \
"expected test template 'Generic Template' in its first Trigger Test: "\
"%s " % lot.qc_test_trigger_ids[0].test_id.test_template_id.name
assert lot.qc_test_trigger_ids[0].trigger_id.id == ref('qc_trigger_demo0'),\
"The Lot4 doesn't have the expected Trigger 'Demo Trigger 1' in its " \
"first Trigger Test: %s " % lot.qc_test_trigger_ids[0].trigger_id.name
assert (lot.qc_test_trigger_ids[1].test_id.test_template_id.id ==
ref('qc_test_template_generic0')), "The Lot4 doesn't have the " \
"expected test template 'Generic Template' in its second Trigger Test:"\
" %s " % lot.qc_test_trigger_ids[1].test_id.test_template_id.name
assert lot.qc_test_trigger_ids[1].trigger_id.id == ref('qc_trigger_demo1'),\
"The Lot4 doesn't have the expected Trigger 'Demo Trigger 2' in its " \
"second Trigger Test: %s " % lot.qc_test_trigger_ids[1].trigger_id.name
assert lot.current_qc_test_trigger_id.id == lot.qc_test_trigger_ids[0].id,\
"The Lot4 doesn't have its first Trigger test as 'Current Trigger " \
"Test': %d != %d" % (lot.current_qc_test_trigger_id.id,
lot.qc_test_trigger_ids[0].id)
-
I fill up the current Quality Test with INVALID values and I Confirm and
Aprove it
-
!python {model: stock.production.lot}: |
import netsvc
lot = self.browse(cr, uid, ref('prodlot_w_2qctest_difftrigger0'), context)
test_line_id = lot.current_qc_test_id.test_line_ids[0].id
self.pool.get('qc.test.line').write(cr, uid, [test_line_id],
{'actual_value_ql': ref('qc_posible_value_no0')}, context)
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.current_qc_test_id.id, 'confirm', cr)
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.current_qc_test_id.id, 'approve', cr)
-
Checking Lot4 is in 'test_failed' state (and inactive) because its current QC
Test is in 'fail' state.
-
!assert {model: stock.production.lot, id: prodlot_w_2qctest_difftrigger0, string: The Lot4 or its current QC Test aren't in the expected state!}:
- state == 'test_failed'
- active == False
- current_qc_test_id.state == 'failed'
-
I cancel the current Quality Test of Lot4
-
!python {model: stock.production.lot}: |
import netsvc
lot = self.browse(cr, uid, ref('prodlot_w_2qctest_difftrigger0'), context)
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.current_qc_test_id.id, 'cancel', cr)
-
Checking Lot4 is in 'pending_test' state (and inactive) because its current
QC Test is in 'draft' state.
-
!assert {model: stock.production.lot, id: prodlot_w_2qctest_difftrigger0, string: The Lot4 or its current QC Test aren't in the expected state!}:
- state == 'pending_test'
- active == False
- current_qc_test_id.state == 'draft'
-
I Confirm and Aprove the current Quality Test of Lot4
-
!python {model: stock.production.lot}: |
import netsvc
lot = self.browse(cr, uid, ref('prodlot_w_2qctest_difftrigger0'), context)
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.current_qc_test_id.id, 'confirm', cr)
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.current_qc_test_id.id, 'approve', cr)
-
Checking Lot4 is in 'test_failed' state (and inactive) because its current
QC Test is in 'fail' state.
-
!assert {model: stock.production.lot, id: prodlot_w_2qctest_difftrigger0, string: The Lot4 or its current QC Test aren't in the expected state!}:
- state == 'test_failed'
- active == False
- current_qc_test_id.state == 'failed'
-
I cancel the Lot4 using the function 'action_force_cancel'
-
!python {model: stock.production.lot}: |
self.action_force_cancel(cr, uid, [ref('prodlot_w_2qctest_difftrigger0')],
context)
-
Checking Lot4 is in 'cancel' state and inactive.
-
!assert {model: stock.production.lot, id: prodlot_w_2qctest_difftrigger0, string: The Lot4 isn't in the expected state!}:
- state == 'cancel'
- active == False
- not current_qc_test_trigger_id
- qc_test_trigger_ids[0].test_id.state == 'failed'
-
I set to Draft the Lot4 for be able to Cancel the Quality Test.
-
!python {model: stock.production.lot}: |
import netsvc
netsvc.LocalService("workflow").trg_validate(uid, 'stock.production.lot',
ref('prodlot_w_2qctest_difftrigger0'), 'draft', cr)
-
I cancel the first Quality Test of Lot4
-
!python {model: stock.production.lot}: |
import netsvc
lot = self.browse(cr, uid, ref('prodlot_w_2qctest_difftrigger0'), context)
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.qc_test_trigger_ids[0].test_id.id, 'cancel', cr)
-
I set the Current Test Trigger and I confirm it.
-
!python {model: stock.production.lot}: |
import netsvc
lot = self.browse(cr, uid, ref('prodlot_w_2qctest_difftrigger0'), context)
self.write(cr, uid, [ref('prodlot_w_2qctest_difftrigger0')],
{'current_qc_test_trigger_id': lot.qc_test_trigger_ids[0].id}, context)
netsvc.LocalService("workflow").trg_validate(uid, 'stock.production.lot',
ref('prodlot_w_2qctest_difftrigger0'), 'confirm', cr)
-
Checking the 'Current Test Trigger' of Lot4 is the expected and it's in
'Pending Test' state
-
!python {model: stock.production.lot}: |
lot = self.browse(cr, uid, ref('prodlot_w_2qctest_difftrigger0'), context)
assert lot.state == 'pending_test', "The Lot4 doesn't have the expected " \
"'pending_test' state: %s" % lot.state
assert lot.current_qc_test_trigger_id.id == lot.qc_test_trigger_ids[0].id,\
"The Lot4 doesn't have its Trigger test as 'Current Trigger Test': " \
"%d != %d" % (lot.current_qc_test_trigger_id.id,
lot.qc_test_trigger_ids[0].id)
assert lot.current_qc_test_id.state == 'draft',\
"The Current Test of Lot4 is not in the expected 'Draft' state: %s" \
% lot.current_qc_test_id.state
-
I change the value of current Quality Test with valid value and Confirm and
Aprove it.
-
!python {model: stock.production.lot}: |
import netsvc
lot = self.browse(cr, uid, ref('prodlot_w_2qctest_difftrigger0'), context)
test_line_id = lot.current_qc_test_id.test_line_ids[0].id
self.pool.get('qc.test.line').write(cr, uid, [test_line_id],
{'actual_value_ql': ref('qc_posible_value_yes0')}, context)
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.current_qc_test_id.id, 'confirm', cr)
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.current_qc_test_id.id, 'approve', cr)
-
Checking Lot4 is in 'valid' state (and ACTIVE) and doesn't have 'Current Test'
because its first test is 'success' and second is in 'Draft' state.
-
!python {model: stock.production.lot}: |
lot = self.browse(cr, uid, ref('prodlot_w_2qctest_difftrigger0'), context)
assert lot.state == 'valid', "The Lot4 doesn't have the expected 'valid' " \
"state: %s" % lot.state
assert lot.active == True, "The Lot4 is unexpectly inactive"
assert not lot.current_qc_test_trigger_id, "The Lot4 has unexpectly " \
"Current Test Trigger: %s" % str(lot.current_qc_test_trigger_id)
assert lot.qc_test_trigger_ids[0].test_success == True, "The first " \
"Trigger Test of Lot4 is, unexpectly, not successful: %s" \
% str(lot.qc_test_trigger_ids[0].test_success)
assert lot.qc_test_trigger_ids[1].test_id.state == 'draft', "The second " \
"Trigger Test of Lot4 is, unexpectly, not in 'Draft' state: %s" \
% lot.qc_test_trigger_ids[1].test_id.state
-
Checking that now I can't cancel the Test of first Trigger Test of Lot4
-
!python {model: stock.production.lot}: |
from osv import osv
import netsvc
lot = self.browse(cr, uid, ref('prodlot_w_2qctest_difftrigger0'), context)
try:
cr.execute('SAVEPOINT not_allwed_cancel')
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.qc_test_trigger_ids[0].test_id.id, 'cancel', cr)
raise Exception("ERROR: We can cancel the First Test of Lot4 (%s) but it "
"shouldn't be able." % str(qc_test_trigger_ids[0]))
except osv.except_osv, e:
print "OK: We can't cancel the First Test of Lot4: %s" % str(e.value)
cr.execute('ROLLBACK TO SAVEPOINT not_allwed_cancel')
-
I cancel the Lot4 using the 'cancel' signal' because from 'Valid' state it's
allowed
-
!python {model: stock.production.lot}: |
import netsvc
netsvc.LocalService("workflow").trg_validate(uid, 'stock.production.lot',
ref('prodlot_w_2qctest_difftrigger0'), 'cancel', cr)
-
Checking Lot4 is in 'Cancel' state and inactive, and doesn't has 'Current
Test' defined.
-
!assert {model: stock.production.lot, id: prodlot_w_2qctest_difftrigger0, string: The Lot4 is not in the expected state!}:
- state == 'cancel'
- active == False
- not current_qc_test_trigger_id
-
I change the state of Lot4 to 'Draft' and I Confirm it without specify any
Current Test.
-
!python {model: stock.production.lot}: |
import netsvc
netsvc.LocalService("workflow").trg_validate(uid, 'stock.production.lot',
ref('prodlot_w_2qctest_difftrigger0'), 'draft', cr)
netsvc.LocalService("workflow").trg_validate(uid, 'stock.production.lot',
ref('prodlot_w_2qctest_difftrigger0'), 'confirm', cr)
-
Checking Lot4 is in 'valid' state (and ACTIVE) because it doesn't have
'Current Test', and its first test is 'success' and second is in 'Draft' state
-
!python {model: stock.production.lot}: |
lot = self.browse(cr, uid, ref('prodlot_w_2qctest_difftrigger0'), context)
assert lot.state == 'valid', "The Lot4 doesn't have the expected 'valid' " \
"state: %s" % lot.state
assert lot.active == True, "The Lot4 is unexpectly inactive"
assert not lot.current_qc_test_trigger_id, "The Lot4 has unexpectly " \
"Current Test Trigger: %s" % str(lot.current_qc_test_trigger_id)
assert lot.qc_test_trigger_ids[0].test_success == True, "The first " \
"Trigger Test of Lot4 is, unexpectly, not successful: %s" \
% str(lot.qc_test_trigger_ids[0].test_success)
assert lot.qc_test_trigger_ids[1].test_id.state == 'draft', "The second " \
"Trigger Test of Lot4 is, unexpectly, not in 'Draft' state: %s" \
% lot.qc_test_trigger_ids[1].test_id.state
-
I set the second Test Trigger of Lot4 as Current and I raise 'next_test'
signal.
-
!python {model: stock.production.lot}: |
import netsvc
lot = self.browse(cr, uid, ref('prodlot_w_2qctest_difftrigger0'), context)
self.write(cr, uid, [ref('prodlot_w_2qctest_difftrigger0')],
{'current_qc_test_trigger_id': lot.qc_test_trigger_ids[1].id}, context)
netsvc.LocalService("workflow").trg_validate(uid, 'stock.production.lot',
ref('prodlot_w_2qctest_difftrigger0'), 'next_test', cr)
-
Checking the 'Current Test Trigger' of Lot4 is the expected and it's in
'Pending Test' state
-
!python {model: stock.production.lot}: |
lot = self.browse(cr, uid, ref('prodlot_w_2qctest_difftrigger0'), context)
assert lot.state == 'pending_test', "The Lot4 doesn't have the expected " \
"'pending_test' state: %s" % lot.state
assert lot.current_qc_test_trigger_id.id == lot.qc_test_trigger_ids[1].id,\
"The Lot4 doesn't have its Trigger test as 'Current Trigger Test': " \
"%d != %d" % (lot.current_qc_test_trigger_id.id,
lot.qc_test_trigger_ids[1].id)
assert lot.current_qc_test_id.state == 'draft',\
"The Current Test of Lot4 is not in the expected 'Draft' state: %s" \
% lot.current_qc_test_id.state
-
I fill up the current Quality Test with valid values and Confirm and Aprove it
-
!python {model: stock.production.lot}: |
import netsvc
lot = self.browse(cr, uid, ref('prodlot_w_2qctest_difftrigger0'), context)
test_line_id = lot.current_qc_test_id.test_line_ids[0].id
self.pool.get('qc.test.line').write(cr, uid, [test_line_id],
{'actual_value_ql': ref('qc_posible_value_yes0')}, context)
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.current_qc_test_id.id, 'confirm', cr)
netsvc.LocalService("workflow").trg_validate(uid, 'qc.test',
lot.current_qc_test_id.id, 'approve', cr)
-
Checking Lot4 is in 'valid' state (and ACTIVE) and doesn't have 'Current Test'
because its second test is 'success'.
-
!python {model: stock.production.lot}: |
lot = self.browse(cr, uid, ref('prodlot_w_2qctest_difftrigger0'), context)
assert lot.state == 'valid', "The Lot4 doesn't have the expected 'valid' " \
"state: %s" % lot.state
assert lot.active == True, "The Lot4 is unexpectly inactive"
assert not lot.current_qc_test_trigger_id, "The Lot4 has unexpectly " \
"Current Test Trigger: %s" % str(lot.current_qc_test_trigger_id)
assert lot.qc_test_trigger_ids[1].test_success == True, "The second " \
"Trigger Test of Lot4 is, unexpectly, not successful: %s" \
% str(lot.qc_test_trigger_ids[1].test_success)
-
------ Prodlot Quality Control END OK ------
-
!python {model: stock.production.lot}: |
print "THE END"

View File

@ -0,0 +1,90 @@
-
------ Prodlot Quality Control without Quality Control ------
-
In order to test the workflow and functionality of Production Lots without
Quality Control, I create lot and move it with all workflow, from Draft to
Valid passing by the Cancel state.
-
I create a Production Lot of Product without Quality Control (Lot1)
-
!record {model: stock.production.lot, id: prodlot_wo_qc0}:
product_id: nan_prodlot_quality_control.product_wo_qc0
-
Checking the Lot1 exists, it hasn't Trigger Tests and it's in 'Draft' state
and inactive
-
!assert {model: stock.production.lot, id: prodlot_wo_qc0, string: The Lot1 doesn't have the expected values/state!}:
- state == 'draft'
- active == False
- len(qc_test_trigger_ids) == 0
- not current_qc_test_id
-
I confirm the Lot1
-
!python {model: stock.production.lot}: |
import netsvc
netsvc.LocalService("workflow").trg_validate(uid, 'stock.production.lot',
ref('prodlot_wo_qc0'), 'confirm', cr)
-
Checking the Lot1 is in 'Valid' state and Active
-
!assert {model: stock.production.lot, id: prodlot_wo_qc0, string: The Lot1 doesn't have the expected state!}:
- state == 'valid'
- active == True
-
I cancel the Lot1
-
!python {model: stock.production.lot}: |
import netsvc
netsvc.LocalService("workflow").trg_validate(uid, 'stock.production.lot',
ref('prodlot_wo_qc0'), 'cancel', cr)
-
Checking the Lot1 is in 'Cancel' state and is inactive
-
!assert {model: stock.production.lot, id: prodlot_wo_qc0, string: The Lot1 doesn't have the expected state!}:
- state == 'cancel'
- active == False
-
I set to Draft the Lot1
-
!python {model: stock.production.lot}: |
import netsvc
netsvc.LocalService("workflow").trg_validate(uid, 'stock.production.lot',
ref('prodlot_wo_qc0'), 'draft', cr)
-
Checking the Lot1 is in 'Draft' state and inactive
-
!assert {model: stock.production.lot, id: prodlot_wo_qc0, string: The Lot1 doesn't have the expected state!}:
- state == 'draft'
- active == False
-
I confirm the Lot1
-
!python {model: stock.production.lot}: |
import netsvc
netsvc.LocalService("workflow").trg_validate(uid, 'stock.production.lot',
ref('prodlot_wo_qc0'), 'confirm', cr)
-
Checking the Lot1 is in 'Valid' state and active.
If it's Ok, the workflow is correct for the simple case.
-
!assert {model: stock.production.lot, id: prodlot_wo_qc0, string: The Lot1 doesn't have the expected state!}:
- state == 'valid'
- active == True
-
------ Prodlot Quality Control END OK ------
-
!python {model: stock.production.lot}: |
print "THE END"