[IMP] Admin views

bzr revid: rim@openerp.com-20131031080856-agv9435a8fns8lqe
This commit is contained in:
Richard Mathot (OpenERP)
2013-10-31 09:08:56 +01:00
parent 8b7a4d7b5e
commit a55ef8c79d
2 changed files with 73 additions and 68 deletions
+9 -8
View File
@@ -366,16 +366,16 @@ class survey_question(osv.osv):
'Display'),
# Answer
'type': fields.selection([('textbox', 'Text box'),
'type': fields.selection([('free_text', 'Free Text'),
('textbox', 'Text box'),
('numerical_box', 'Numerical box'),
('free_text', 'Free Text'),
('datetime', 'Date and Time'),
('checkbox', 'Checkbox'),
('simple_choice_scale', 'One choice on a scale'),
('simple_choice_dropdown', 'One choice in a menu'),
('multiple_choice', 'Some choices in checkboxes'),
('vector', 'Container of questions'),
('matrix', 'Container of containers of questions')
('vector', 'Multi-questions'),
('matrix', 'Matrix')
], 'Question Type', required=1),
'suggested_answers_ids': fields.one2many('survey.suggestion',
@@ -393,7 +393,6 @@ class survey_question(osv.osv):
'validation_required': fields.boolean('Validate entry',
oldname='is_validation_require'),
'validation_type': fields.selection([
('none', '''Don't validate'''),
('has_length', 'Must Be Specific Length'),
('is_integer', 'Must Be A Whole Number'),
('is_decimal', 'Must Be A Decimal Number'),
@@ -401,8 +400,10 @@ class survey_question(osv.osv):
('is_email', 'Must Be An Email Address')
], 'Text Validation'),
'validation_length': fields.integer('Specific length'),
'validation_min_value': fields.float('Minimum value'),
'validation_max_value': fields.float('Maximum value'),
'validation_min_float_value': fields.float('Minimum value'),
'validation_max_float_value': fields.float('Maximum value'),
'validation_min_int_value': fields.integer('Minimum value'),
'validation_max_int_value': fields.integer('Maximum value'),
'validation_min_date': fields.date('Start date range'),
'validation_max_date': fields.date('End date range'),
'validation_error_msg': fields.char("Error message if validation \
@@ -446,7 +447,7 @@ class survey_question(osv.osv):
#'comment_label': lambda s, cr, uid, c: _('Other (please specify)'),
#'comment_valid_type': 'do_not_validate',
#'comment_valid_err_msg': lambda s, cr, uid, c: _('The comment you entered is in an invalid format.'),
'validation_type': 'do_not_validate',
'validation_required': 'False',
#'validation_valid_err_msg': lambda s, cr, uid, c: _('The comment you entered is in an invalid format.'),
#'numeric_required_sum_err_msg': lambda s, cr, uid, c: _('The choices need to add up to [enter sum here].'),
#'make_comment_field_err_msg': lambda s, cr, uid, c: _('Please enter a comment.'),
+64 -60
View File
@@ -119,9 +119,9 @@
<field name="arch" type="xml">
<form string="Survey" version="7.0">
<header groups="base.group_survey_manager">
<button name="action_edit_survey" states="draft" string="Edit Survey" type="object" class="oe_highlight"/>
<!-- <button name="action_edit_survey" states="draft" string="Edit Survey" type="object" class="oe_highlight"/>
<button name="survey_cancel" string="Cancel" states="draft" type="object"/>
<button name="action_send_survey" string="Invite people" states="open" type="object" class="oe_highlight"/>
<button name="action_send_survey" string="Invite people" states="open" type="object" class="oe_highlight"/> -->
<field name="state" widget="statusbar" nolabel="1" clickable="false" statusbar_visible="draft,open,close,cancelled"/>
</header>
<sheet class="oe_survey">
@@ -292,11 +292,6 @@
</field>
</record>
<!--
Survey Pages
-->
@@ -395,36 +390,40 @@
<field name="arch" type="xml">
<form string="Survey Question" version="7.0">
<sheet class="oe_survey">
<!-- <field name="in_visible_rating_weight" invisible="1"/>
<field name="in_visible_menu_choice" invisible="1"/>
<field name="in_visible_answer_type" invisible="1"/>
--> <group colspan="4" col="1">
<group col="2" invisible="context.get('edit')" attrs="{'invisible': [('page_id','!=',None)]}">
<!-- <field name="tot_resp"/> -->
<field name="survey_id" readonly="1"/>
<field name="page_id" on_change="on_change_page_id(page_id)"/>
</group>
<group col="2">
<field name="type" on_change="on_change_type(type)"/>
<field name="question" nolabel="1" colspan="2"/>
<field name="description" nolabel="1" colspan="2"/>
</group>
<group string="Answer" attrs="{'invisible':[('type','not in',['matrix', 'multiple_textboxes_diff_type', 'multiple_choice_only_one_ans', 'multiple_choice_multiple_ans', 'matrix_of_choices_only_one_ans', 'matrix_of_choices_only_multi_ans', 'rating_scale', 'multiple_textboxes', 'numerical_textboxes', 'date', 'date_and_time', 'table'])]}">
<group colspan="4" attrs="{'invisible':[('type','=','table')]}">
<field name="suggested_answers_ids" nolabel="1" colspan="4" /> <!-- context="{'in_visible_answer_type': in_visible_answer_type}"/> -->
</group>
<group colspan="4" attrs="{'invisible':[('type','not in',['matrix_of_choices_only_multi_ans', 'matrix_of_choices_only_one_ans', 'rating_scale', '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}"/> -->
<group colspan="4" col="2">
<!-- <group colspan="4" attrs="{'invisible':[('type','not in',['table'])]}">
<field name="no_of_rows"/>
<!-- The question -->
<group colspan="2">
<field name="type" on_change="on_change_type(type)"/>
<field name="question" />
<field name="description" />
</group>
<!-- Suggestions -->
<group colspan="2" string="Choice of answers" attrs="{'invisible':[('type','not in',['simple_choice_dropdown',
'multiple_choice','simple_choice_scale'])]}">
<field name="suggested_answers_ids" nolabel="1" context="{'default_question_id': active_id}">
<tree string="Suggested answers" editable="bottom">
<field name="value" />
</tree>
</field>
</group>
<!-- Sub-questions -->
<group colspan="2" attrs="{'invisible':[('type','not in',['matrix', 'vector'])]}">
<field name='children_ids' nolabel='1' context="{'default_parent_id': active_id}"/>
</group>
<!-- Comments -->
<group colspan="1" string="Comments">
<field name='comments_allowed' />
<group colspan="2" attrs="{'invisible':[('comments_allowed','=',False)]}">
<field name='comment_count_as_answer' />
</group>
-->
</group>
</group>
<group string="Children questions" attrs="{'invisible':[('type','not in',['matrix', 'vector'])]}">
<field name='children_ids' nolabel='1' colspan='4' />
</group>
</group>
<!-- <group string="Comment Field" attrs="{'invisible':[('type','not in',['multiple_choice_only_one_ans', 'multiple_choice_multiple_ans', 'matrix_of_choices_only_multi_ans', 'matrix_of_choices_only_one_ans', 'rating_scale'])]}">
<group colspan="4">
<field name="is_comment_require"/>
@@ -464,33 +463,38 @@
</group>
</group>
-->
<group string="Validation" attrs="{'invisible':[('type','in',['matrix', 'vector'])]}">
<group colspan="4">
<field name="validation_required"/>
</group>
<group col="6" colspan="4" attrs="{'invisible':[('validation_required','=',False)]}">
<field name="validation_type" colspan="2"/>
<group colspan="2" attrs="{'invisible':[('validation_type','!=','must_be_specific_length'), ('validation_type','!=','must_be_whole_number')]}">
<field name="validation_min_value" string="Between"/>
<field name="validation_max_value" string="and"/>
</group>
<!--
<group colspan="4" attrs="{'invisible':[('validation_type','!=','must_be_decimal_number')]}">
<field name="validation_minimum_float" string="Between"/>
<field name="validation_maximum_float" string="and"/>
</group>
-->
<group colspan="4" attrs="{'invisible':[('validation_type','!=','must_be_date')]}">
<field name="validation_min_date" string="Between"/>
<field name="validation_max_date" string="and"/>
<!-- Answer validation -->
<group colspan="1" string="Answer Validation" attrs="{'invisible':[('type','not in',['textbox','numerical_box','datetime'])]}">
<group>
<field name="validation_required"/>
<group attrs="{'invisible':[('validation_required','=',False)]}">
<field name="validation_type" />
<group attrs="{'invisible':[('validation_type','!=','has_length')]}">
<field name="validation_length" string="Length"/>
</group>
<group attrs="{'invisible':[('validation_type','!=','is_decimal')]}">
<field name="validation_min_float_value" string="between"/>
<field name="validation_max_float_value" string="and"/>
</group>
<group attrs="{'invisible':[('validation_type','!=','is_integer')]}">
<field name="validation_min_int_value" string="between"/>
<field name="validation_max_int_value" string="and"/>
</group>
<group attrs="{'invisible':[('validation_type','!=','is_date')]}">
<field name="validation_min_date" string="between"/>
<field name="validation_max_date" string="and"/>
</group>
</group>
</group>
</group>
<group colspan="4" attrs="{'invisible':[('validation_type','!=','must_be_specific_length'),('validation_type','!=','must_be_decimal_number'),('validation_type','!=','must_be_whole_number'),('validation_type','!=','must_be_date'),('validation_type','!=','must_be_email_address')]}">
<label string="When the comment is an invalid format, display this error message" colspan="4"/>
<field name="validation_error_msg" nolabel="1" colspan="4"/>
</group>
</group>
<group string="Required Answer" attrs="{'invisible':[('type','not in',['multiple_choice_only_one_ans', 'multiple_choice_multiple_ans', 'matrix_of_choices_only_one_ans', 'matrix_of_choices_only_multi_ans', 'rating_scale', 'multiple_textboxes', 'numerical_textboxes', 'date', 'date_and_time', 'single_textbox', 'comment', 'multiple_textboxes_diff_type'])]}">
<!-- Question validation -->
<group colspan="2" string="Question required" attrs="{'invisible':[('type','not in',['multiple_choice_only_one_ans', 'multiple_choice_multiple_ans', 'matrix_of_choices_only_one_ans', 'matrix_of_choices_only_multi_ans', 'rating_scale', 'multiple_textboxes', 'numerical_textboxes', 'date', 'date_and_time', 'single_textbox', 'comment', 'multiple_textboxes_diff_type'])]}">
<field name="constr_mandatory"/>
<group col="6" colspan="4" attrs="{'invisible':[('constr_mandatory','=',False)]}">
<group colspan="4" attrs="{'invisible':[('type','not in', ['multiple_choice_multiple_ans', 'matrix_of_choices_only_one_ans', 'matrix_of_choices_only_multi_ans', 'rating_scale', 'multiple_textboxes', 'numerical_textboxes', 'date', 'date_and_time', 'multiple_textboxes_diff_type'])]}">