diff --git a/quality_control/i18n/es.po b/quality_control/i18n/es.po index 70e5f600a..70f48e7d4 100644 --- a/quality_control/i18n/es.po +++ b/quality_control/i18n/es.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 8.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-10-09 14:29+0000\n" -"PO-Revision-Date: 2014-10-09 17:41+0100\n" +"POT-Creation-Date: 2014-10-13 13:00+0000\n" +"PO-Revision-Date: 2014-10-13 15:02+0100\n" "Last-Translator: Alfredo \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -30,6 +30,12 @@ msgstr "Aceptado" msgid "Active" msgstr "Activo" +#. module: quality_control +#: field:qc.test.line,valid_value_ids:0 +#: field:qc.test.template.line,valid_value_ids:0 +msgid "Answers" +msgstr "Respuestas" + #. module: quality_control #: view:qc.test:quality_control.qc_test_form_view msgid "Approve" @@ -82,6 +88,11 @@ msgstr "Configuración" msgid "Confirm" msgstr "Confirmar" +#. module: quality_control +#: field:qc.posible.value,ok:0 +msgid "Correct answer" +msgstr "Correct answer" + #. module: quality_control #: field:qc.posible.value,create_uid:0 #: field:qc.proof,create_uid:0 @@ -129,7 +140,7 @@ msgid "Enabled" msgstr "Activado" #. module: quality_control -#: code:addons/quality_control/models/quality_control.py:230 +#: code:addons/quality_control/models/quality_control.py:233 #: constraint:qc.test.template.category:0 #, python-format msgid "Error ! You can not create recursive categories." @@ -323,7 +334,7 @@ msgid "Proof Type" msgstr "Tipo pregunta" #. module: quality_control -#: code:addons/quality_control/models/quality_control.py:133 +#: code:addons/quality_control/models/quality_control.py:136 #: sql_constraint:qc.proof:0 #, python-format msgid "Proof-Method relation alredy exists!" @@ -395,12 +406,6 @@ msgstr "Referenciado" msgid "Related" msgstr "Relacionado" -#. module: quality_control -#: field:qc.test.line,valid_value_ids:0 -#: field:qc.test.template.line,valid_value_ids:0 -msgid "Answers" -msgstr "Respuestas" - #. module: quality_control #: model:ir.actions.act_window,name:quality_control.action_qc_test_set_template_wizard_form #: view:qc.test.set.template.wizard:quality_control.view_qc_test_set_template_wizard_form @@ -616,6 +621,17 @@ msgstr "Valor del resultado, si se trata de una pregunta cuantitativa." msgid "Waiting Supervisor Approval" msgstr "Esperando aprobación del supervisor" +#. module: quality_control +#: help:qc.posible.value,ok:0 +msgid "" +"When this field is True, the answer\n" +" is correct, When is False the answer\n" +" is not correct." +msgstr "" +"Cuando este campo es verdadera, la respuesta\n" +" es correcta, cuando es falso la respuesta\n" +" es incorrecta." + #. module: quality_control #: view:qc.test.template.line:quality_control.qc_test_template_line_form_view msgid "proof Line" diff --git a/quality_control/i18n/quality_control.pot b/quality_control/i18n/quality_control.pot index 7e2e5295e..75c5f2bfa 100644 --- a/quality_control/i18n/quality_control.pot +++ b/quality_control/i18n/quality_control.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 8.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-10-09 13:58+0000\n" -"PO-Revision-Date: 2014-10-09 13:58+0000\n" +"POT-Creation-Date: 2014-10-13 13:00+0000\n" +"PO-Revision-Date: 2014-10-13 13:00+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -30,6 +30,12 @@ msgstr "" msgid "Active" msgstr "" +#. module: quality_control +#: field:qc.test.line,valid_value_ids:0 +#: field:qc.test.template.line,valid_value_ids:0 +msgid "Answers" +msgstr "" + #. module: quality_control #: view:qc.test:quality_control.qc_test_form_view msgid "Approve" @@ -82,6 +88,11 @@ msgstr "" msgid "Confirm" msgstr "" +#. module: quality_control +#: field:qc.posible.value,ok:0 +msgid "Correct answer" +msgstr "" + #. module: quality_control #: field:qc.posible.value,create_uid:0 #: field:qc.proof,create_uid:0 @@ -129,7 +140,7 @@ msgid "Enabled" msgstr "" #. module: quality_control -#: code:addons/quality_control/models/quality_control.py:230 +#: code:addons/quality_control/models/quality_control.py:233 #: constraint:qc.test.template.category:0 #, python-format msgid "Error ! You can not create recursive categories." @@ -323,7 +334,7 @@ msgid "Proof Type" msgstr "" #. module: quality_control -#: code:addons/quality_control/models/quality_control.py:133 +#: code:addons/quality_control/models/quality_control.py:136 #: sql_constraint:qc.proof:0 #, python-format msgid "Proof-Method relation alredy exists!" @@ -395,12 +406,6 @@ msgstr "" msgid "Related" msgstr "" -#. module: quality_control -#: field:qc.test.line,valid_value_ids:0 -#: field:qc.test.template.line,valid_value_ids:0 -msgid "Answers" -msgstr "" - #. module: quality_control #: model:ir.actions.act_window,name:quality_control.action_qc_test_set_template_wizard_form #: view:qc.test.set.template.wizard:quality_control.view_qc_test_set_template_wizard_form @@ -616,6 +621,13 @@ msgstr "" msgid "Waiting Supervisor Approval" msgstr "" +#. module: quality_control +#: help:qc.posible.value,ok:0 +msgid "When this field is True, the answer\n" +" is correct, When is False the answer\n" +" is not correct." +msgstr "" + #. module: quality_control #: view:qc.test.template.line:quality_control.qc_test_template_line_form_view msgid "proof Line" diff --git a/quality_control/models/quality_control.py b/quality_control/models/quality_control.py index 91f75fa72..acfac8d53 100644 --- a/quality_control/models/quality_control.py +++ b/quality_control/models/quality_control.py @@ -62,6 +62,10 @@ class QcPosibleValue(orm.Model): 'name': fields.char('Name', size=200, required=True, select="1", translate=True), 'active': fields.boolean('Active', select="1"), + 'ok': fields.boolean('Correct answer', + help="When this field is True, the answer\n" + " is correct, When is False the answer\n" + " is not correct."), } _defaults = { @@ -506,7 +510,7 @@ class QcTest(orm.Model): new_data = [] fill = test.test_template_id.fill_correct_values for line in test.test_template_id.test_template_line_ids: - data = self.self._prepare_test_line( + data = self._prepare_test_line( cr, uid, test, line, fill=fill or force_fill, context=context) new_data.append((0, 0, data)) return new_data @@ -562,7 +566,7 @@ class QcTestLine(orm.Model): def quality_test_qualitative_check(self, cr, uid, test_line, context=None): if test_line.actual_value_ql in test_line.valid_value_ids: - return True + return test_line.actual_value_ql.ok else: return False @@ -623,18 +627,20 @@ class QcTestLine(orm.Model): actual_value_qt, test_uom_id) if amount >= min_value and amount <= max_value: - res.update({'success': True}) + res['success'] = True else: - res.update({'success': False}) + res['success'] = False return {'value': res} def onchange_actual_value_ql(self, cr, uid, ids, actual_value_ql, valid_value_ids, context=None): res = {} + value_obj = self.pool['qc.posible.value'] if actual_value_ql: valid = valid_value_ids[0][2] if actual_value_ql in valid: - res.update({'success': True}) + value = value_obj.browse(cr, uid, actual_value_ql, context) + res['success'] = value.ok else: - res.update({'success': False}) + res['success'] = False return {'value': res} diff --git a/quality_control/views/quality_control_view.xml b/quality_control/views/quality_control_view.xml index de63fa88e..fca80dd73 100644 --- a/quality_control/views/quality_control_view.xml +++ b/quality_control/views/quality_control_view.xml @@ -45,10 +45,11 @@ qc.posible.value
- - - - + + + + +
@@ -58,6 +59,7 @@ + @@ -488,10 +490,12 @@ + attrs="{'readonly':[('proof_type','=','quantitative')]}" + on_change="onchange_actual_value_ql(actual_value_ql, valid_value_ids)" /> + attrs="{'readonly':[('proof_type','=','qualitative')]}" + on_change="onchange_actual_value_qt(uom_id, test_uom_id, actual_value_qt, min_value, max_value)" />