From 472943335eedd476a07dc17f742eaceac8610227 Mon Sep 17 00:00:00 2001 From: Guillem Barba Date: Thu, 23 Feb 2012 17:43:31 +0100 Subject: [PATCH] [IMP] nan_prodlot_quality_control: finalized (re)implementation of Quality Control for Production Lots, with complet YAML tests included. --- __openerp__.py | 10 +- i18n/ca.po | 476 +++++++++++++++++ i18n/de.po | 475 +++++++++++++++++ i18n/es.po | 477 ++++++++++++++++++ i18n/nan_prodlot_quality_control.pot | 420 +++++++++++++++ prodlot_quality_control_demo.xml | 149 ++++++ prodlot_workflow.xml | 32 +- product.py | 54 ++ quality_control.py | 46 ++ security/ir.model.access.csv | 3 + stock.py | 433 +++++++++++++--- stock_view.xml | 12 +- test/prodlot_with_one_qc_test.yml | 287 +++++++++++ test/prodlot_with_two_qc_test.yml | 368 ++++++++++++++ .../prodlot_with_two_qc_test_diff_trigger.yml | 366 ++++++++++++++ test/prodlot_without_quality_control.yml | 90 ++++ 16 files changed, 3614 insertions(+), 84 deletions(-) create mode 100644 i18n/ca.po create mode 100644 i18n/de.po create mode 100644 i18n/es.po create mode 100644 i18n/nan_prodlot_quality_control.pot create mode 100644 prodlot_quality_control_demo.xml create mode 100644 test/prodlot_with_one_qc_test.yml create mode 100644 test/prodlot_with_two_qc_test.yml create mode 100644 test/prodlot_with_two_qc_test_diff_trigger.yml create mode 100644 test/prodlot_without_quality_control.yml diff --git a/__openerp__.py b/__openerp__.py index a8fa395..ae12ff5 100644 --- a/__openerp__.py +++ b/__openerp__.py @@ -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, } diff --git a/i18n/ca.po b/i18n/ca.po new file mode 100644 index 0000000..7b36734 --- /dev/null +++ b/i18n/ca.po @@ -0,0 +1,476 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * nan_prodlot_quality_control +# +# Guillem Barba , 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 \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" diff --git a/i18n/de.po b/i18n/de.po new file mode 100644 index 0000000..9db3a18 --- /dev/null +++ b/i18n/de.po @@ -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" diff --git a/i18n/es.po b/i18n/es.po new file mode 100644 index 0000000..71402c8 --- /dev/null +++ b/i18n/es.po @@ -0,0 +1,477 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * nan_prodlot_quality_control +# +# Guillem Barba , 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 \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" diff --git a/i18n/nan_prodlot_quality_control.pot b/i18n/nan_prodlot_quality_control.pot new file mode 100644 index 0000000..b640b30 --- /dev/null +++ b/i18n/nan_prodlot_quality_control.pot @@ -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" + diff --git a/prodlot_quality_control_demo.xml b/prodlot_quality_control_demo.xml new file mode 100644 index 0000000..f980f55 --- /dev/null +++ b/prodlot_quality_control_demo.xml @@ -0,0 +1,149 @@ + + + + + Yes + + + + + No + + + + + + Simple Proof + qualitative + + + + + + + + Generic Template + generic + + + + + + + + + qualitative + + + + + + + Specific Template + related + + + + + + + + + qualitative + + + + + + + Demo Trigger 1 + + + Demo Trigger 2 + + + + + Product without Quality Control + product + + make_to_stock + buy + standard + product + + + + + + Product with One QC Test + product + + make_to_stock + buy + standard + product + + + + + + + + generic + + + + + Product with Two QC Test + product + + make_to_stock + buy + standard + product + + + + + + + + generic + + + + + + + related + + + + + Product with Two QC Test with different Trigger + product + + make_to_stock + buy + standard + product + + + + + + + + generic + + + + + + + generic + + + + diff --git a/prodlot_workflow.xml b/prodlot_workflow.xml index c2a7d97..15587d1 100644 --- a/prodlot_workflow.xml +++ b/prodlot_workflow.xml @@ -21,6 +21,8 @@ next_test + function + action_wofkflow_next_test() @@ -34,8 +36,7 @@ valid - subflow - + function action_wofkflow_valid() @@ -76,9 +77,9 @@ - + - + subflow.success @@ -89,9 +90,15 @@ subflow.failed - - + + + + test_not_qc_test_subflow() cancel @@ -99,15 +106,10 @@ + test_pending_test() next_test - - - - subflow.draft - - @@ -124,6 +126,12 @@ + + test_not_qc_test_subflow() cancel diff --git a/product.py b/product.py index 6389139..bbc711b 100644 --- a/product.py +++ b/product.py @@ -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 diff --git a/quality_control.py b/quality_control.py index d700c16..c9a2d79 100644 --- a/quality_control.py +++ b/quality_control.py @@ -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: diff --git a/security/ir.model.access.csv b/security/ir.model.access.csv index b12f48f..9b50b3b 100644 --- a/security/ir.model.access.csv +++ b/security/ir.model.access.csv @@ -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 diff --git a/stock.py b/stock.py index b2c06b1..91d4eb7 100644 --- a/stock.py +++ b/stock.py @@ -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: diff --git a/stock_view.xml b/stock_view.xml index 2459393..8a0479d 100644 --- a/stock_view.xml +++ b/stock_view.xml @@ -48,6 +48,10 @@ form + + + + @@ -82,8 +86,9 @@