diff options
| author | Thibault Delavallée <tde@openerp.com> | 2012-01-12 10:02:58 +0100 |
|---|---|---|
| committer | Thibault Delavallée <tde@openerp.com> | 2012-01-12 10:02:58 +0100 |
| commit | 650c9cc56ebcedb1ba81b38136d1670cd7fb047e (patch) | |
| tree | 057eb0af9e1740b200d1d0beafd70d26247b17e3 | |
| parent | 12e3ef7fbfd8f3a45f1e995a9261d1d12496a31b (diff) | |
| parent | 08d728e05c2aa89dcb295aba2360325a8509be40 (diff) | |
[MERGE] survey: fixed bug 914208: removed dynamic sequence calculation not working in web client and making client crash by removing o2m referencing themselves in context. Also removed now unused data_get method.
bzr revid: tde@openerp.com-20120112090258-kl5g5sb7hn906i27
| -rw-r--r-- | addons/survey/survey.py | 13 | ||||
| -rw-r--r-- | addons/survey/survey_view.xml | 14 |
2 files changed, 7 insertions, 20 deletions
diff --git a/addons/survey/survey.py b/addons/survey/survey.py index bf5ec4edeef..0101cef17b8 100644 --- a/addons/survey/survey.py +++ b/addons/survey/survey.py @@ -178,7 +178,6 @@ class survey_page(osv.osv): if context is None: context = {} data = super(survey_page, self).default_get(cr, uid, fields, context) - self.pool.get('survey.question').data_get(cr,uid,data,context) if context.has_key('survey_id'): data['survey_id'] = context.get('survey_id', False) return data @@ -499,21 +498,10 @@ class survey_question(osv.osv): 'context': context } - def data_get(self, cr, uid, data, context): - if data and context: - if context.get('line_order', False): - lines = context.get('line_order') - seq = data.get('sequence', 0) - for line in lines: - seq = seq + 1 - data.update({'sequence': seq}) - return data - def default_get(self, cr, uid, fields, context=None): if context is None: context = {} data = super(survey_question, self).default_get(cr, uid, fields, context) - self.data_get(cr,uid,data,context) if context.has_key('page_id'): data['page_id']= context.get('page_id', False) return data @@ -606,7 +594,6 @@ class survey_answer(osv.osv): if context is None: context = {} data = super(survey_answer, self).default_get(cr, uid, fields, context) - self.pool.get('survey.question').data_get(cr,uid,data,context) return data survey_answer() diff --git a/addons/survey/survey_view.xml b/addons/survey/survey_view.xml index 52969704b7d..3dd7ca17f6f 100644 --- a/addons/survey/survey_view.xml +++ b/addons/survey/survey_view.xml @@ -33,13 +33,13 @@ </group> <notebook colspan="4"> <page string="Survey"> - <field name="page_ids" colspan="4" nolabel="1" mode="form,tree" context="{'line_order': page_ids}"> + <field name="page_ids" colspan="4" nolabel="1" mode="form,tree"> <form string="Survey Page"> <field name="title" select="1"/> <field name="sequence" groups="base.group_extended"/> <separator string="Description" colspan="4"/> <field name="note" colspan="4" nolabel="1"/> - <field name="question_ids" height="200" width="200" colspan="4" nolabel="1" context="{'line_order': question_ids}"> + <field name="question_ids" height="200" width="200" colspan="4"> <form string="Survey Question" > <group col="6" colspan="6" height="600" width="200"> <field name="question" colspan="4" select="1"/> @@ -54,7 +54,7 @@ <group attrs="{'invisible':[('type','!=','multiple_textboxes_diff_type'),('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale'),('type','!=','multiple_textboxes'),('type','!=','numerical_textboxes'),('type','!=','date'),('type','!=','date_and_time'),('type','!=','table')]}"> <separator string="Answer" colspan="4"/> <group colspan="4" attrs="{'invisible':[('type','=','table')]}"> - <field name="answer_choice_ids" nolabel="1" colspan="4" context="{'line_order': answer_choice_ids, 'in_visible_answer_type': in_visible_answer_type}"/> + <field name="answer_choice_ids" nolabel="1" colspan="4" context="{'in_visible_answer_type': in_visible_answer_type}"/> </group> <group colspan="4" attrs="{'invisible':[('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale'),('type','!=','table')]}"> <field name="column_heading_ids" colspan="4" nolabel="1" context="{'in_visible_rating_weight':in_visible_rating_weight,'in_visible_menu_choice':in_visible_menu_choice}"/> @@ -310,7 +310,7 @@ <field name="sequence"/> <separator string="Description" colspan="4"/> <field name="note" colspan="4" nolabel="1"/> - <field name="question_ids" colspan="4" nolabel="1" context="{'line_order': question_ids}"> + <field name="question_ids" colspan="4" nolabel="1"> <form string="Survey Question"> <field name="question" colspan="4" select="1"/> <field name="sequence"/> @@ -324,7 +324,7 @@ <group attrs="{'invisible':[('type','!=','multiple_textboxes_diff_type'),('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale'),('type','!=','multiple_textboxes'),('type','!=','numerical_textboxes'),('type','!=','date'),('type','!=','date_and_time'),('type','!=','table')]}"> <separator string="Answer" colspan="4"/> <group colspan="4" attrs="{'invisible':[('type','=','table')]}"> - <field name="answer_choice_ids" nolabel="1" colspan="4" context="{'line_order': answer_choice_ids, 'in_visible_answer_type': in_visible_answer_type}"/> + <field name="answer_choice_ids" nolabel="1" colspan="4" context="{'in_visible_answer_type': in_visible_answer_type}"/> </group> <group colspan="4" attrs="{'invisible':[('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale'),('type','!=','table')]}"> <field name="column_heading_ids" colspan="4" nolabel="1" context="{'in_visible_rating_weight':in_visible_rating_weight,'in_visible_menu_choice':in_visible_menu_choice}"/> @@ -537,7 +537,7 @@ <group attrs="{'invisible':[('type','!=','multiple_textboxes_diff_type'),('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale'),('type','!=','multiple_textboxes'),('type','!=','numerical_textboxes'),('type','!=','date'),('type','!=','date_and_time'),('type','!=','table')]}"> <separator string="Answer" colspan="4"/> <group colspan="4" attrs="{'invisible':[('type','=','table')]}"> - <field name="answer_choice_ids" nolabel="1" colspan="4" context="{'line_order': answer_choice_ids, 'in_visible_answer_type': in_visible_answer_type}"/> + <field name="answer_choice_ids" nolabel="1" colspan="4" context="{'in_visible_answer_type': in_visible_answer_type}"/> </group> <group colspan="4" attrs="{'invisible':[('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale'),('type','!=','table')]}"> <field name="column_heading_ids" colspan="4" nolabel="1" context="{'in_visible_rating_weight':in_visible_rating_weight,'in_visible_menu_choice':in_visible_menu_choice}"/> @@ -718,7 +718,7 @@ <group attrs="{'invisible':[('type','!=','multiple_textboxes_diff_type'),('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale'),('type','!=','multiple_textboxes'),('type','!=','numerical_textboxes'),('type','!=','date'),('type','!=','date_and_time'),('type','!=','table')]}"> <separator string="Answer" colspan="4"/> <group colspan="4" attrs="{'invisible':[('type','=','table')]}"> - <field name="answer_choice_ids" nolabel="1" colspan="4" context="{'line_order': answer_choice_ids, 'in_visible_answer_type': in_visible_answer_type}"/> + <field name="answer_choice_ids" nolabel="1" colspan="4" context="{'in_visible_answer_type': in_visible_answer_type}"/> </group> <group colspan="4" attrs="{'invisible':[('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale'),('type','!=','table')]}"> <field name="column_heading_ids" colspan="4" nolabel="1" context="{'in_visible_rating_weight':in_visible_rating_weight,'in_visible_menu_choice':in_visible_menu_choice}"/> |
