[ADD] focus previous/next field when using the left/right arrow while at the start...
[odoo/odoo.git] / addons / survey / survey_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4
5         <menuitem name="Surveys" id="menu_surveys" parent="base.menu_tools" sequence="2" groups="base.group_tool_user,base.group_tool_manager,base.group_survey_user"/>
6         <menuitem name="Define Surveys" id="menu_define_survey"
7              groups="base.group_tool_manager"
8              parent="menu_surveys" />
9         <menuitem id="menu_answer_surveys" name="Answer Surveys" parent="menu_surveys" groups="base.group_tool_user,base.group_tool_manager,base.group_survey_user"/>
10         <menuitem name="Reporting" parent="base.menu_tools"
11             id="base.menu_lunch_reporting" sequence="6"/>
12         <menuitem name="Reporting" id="menu_reporting" parent="menu_surveys" sequence="60"/>
13
14         <!--
15             Survey
16         -->
17
18         <record model="ir.ui.view" id="survey_form">
19             <field name="name">survey_form</field>
20             <field name="model">survey</field>
21             <field name="type">form</field>
22             <field name="arch" type="xml">
23                 <form string="Survey" version="7.0">
24                 <header>
25                     <button name="survey_open" string="Open" states="cancel,close" type="object"/>
26                     <button name="survey_close" string="Close" states="open" type="object" class="oe_highlight"/>
27                     <button name="survey_cancel" string="Cancel" states="open" type="object"/>
28                     <field name="state" widget="statusbar" statusbar_visible="open,close"/>
29                 </header>
30                 <sheet>
31                     <div class="oe_button_box oe_right">
32                         <button name="%(action_view_survey_question_message)d" states="open,draft,close,cancel" string="Test Survey" type="action" icon="gtk-new" context="{'active':True,'survey_id': active_id}" attrs="{'invisible':[('id','=',0)]}"/>
33                         <button name="%(action_view_survey_question_message)d" states="open,draft,close,cancel" string="Answer Survey" type="action" icon="gtk-execute" context="{'survey_id': active_id}" attrs="{'invisible':[('state','!=','open')]}"/>
34                     </div>
35                     <div class="oe_title">
36                         <label for="title" class="oe_edit_only"/>
37                         <h1>
38                             <field name="title"/>
39                         </h1>
40                     </div>
41                     <group>
42                         <group>
43                             <field name="id" invisible="1"/>
44                             <field name="responsible_id" class="oe_inline"/>
45                             <field name="send_response"/>
46                             <field name="type"/>
47                         </group>
48                         <group>
49                             <field name="max_response_limit" attrs="{'readonly':[('state','in',('open','close'))]}"/>
50                             <field name="response_user" attrs="{'readonly':[('state','in',('open','close'))]}"/>
51                         </group>
52                      </group>
53                      <notebook>
54                         <page string="Survey Details">
55                             <field name="note" colspan="4" placeholder="Survey description..."/>
56                             <label for="page_ids"/>
57                             <field name="page_ids" colspan="4" mode="tree">
58                                 <form string="Survey Page" version="7.0">
59                                     <sheet>
60                                     <label for="title" class="oe_edit_only"/>
61                                     <h1>
62                                         <field name="title"/>
63                                     </h1>
64                                     <group>
65                                         <field name="note" placeholder="Description on the survey page..." nolabel="1"/>
66                                     </group>
67                                     <newline/>
68                                     <group>
69                                         <label for="question_ids"/>
70                                         <newline/>
71                                         <field name="question_ids" nolabel="1">
72                                             <form string="Survey Question">
73                                                 <group>
74                                                     <group>
75                                                         <field name="question"/>
76                                                         <field name="type" on_change="on_change_type(type)"/>
77                                                     </group>
78                                                 </group>
79                                                 <newline/>
80                                                 <group>
81                                                 <field name="in_visible_rating_weight" invisible="1"/>
82                                                 <field name="in_visible_menu_choice" invisible="1"/>
83                                                 <field name="in_visible_answer_type" invisible="1"/>
84                                                 <notebook colspan="4">
85                                                     <page string="Options">
86                                                         <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')]}" string="Answer">
87                                                            <group colspan="4" attrs="{'invisible':[('type','=','table')]}">
88                                                                <field name="answer_choice_ids" nolabel="1" colspan="4" context="{'in_visible_answer_type': in_visible_answer_type}"/>
89                                                            </group>
90                                                            <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')]}">
91                                                                <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}"/>
92                                                                 <group colspan="4" attrs="{'invisible':[('type','!=','table')]}">
93                                                                    <field name="no_of_rows"/>
94                                                                 </group>
95                                                            </group>
96                                                         </group>
97                                                         <newline/>
98                                                         <group  attrs="{'invisible':[('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'), ('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale')]}">
99                                                             <separator string="Comment Field" colspan="4"/>
100                                                             <group colspan="4">
101                                                                 <field name="is_comment_require"/>
102                                                             </group>
103                                                             <group attrs="{'invisible':[('is_comment_require','=',False)]}">
104                                                                 <group col="4" colspan="4">
105                                                                     <field name="comment_field_type" colspan="1"/>
106                                                                     <group colspan="2" attrs="{'invisible':[('comment_field_type','!=','char'),('comment_field_type','!=','text')]}">
107                                                                         <field colspan="2" name="comment_label" />
108                                                                     </group>
109                                                                 </group>
110                                                                 <group col="6" colspan="4" attrs="{'invisible':[('comment_field_type','!=','char'),('comment_field_type','!=','text')]}">
111                                                                     <field name="comment_valid_type" colspan="2"/>
112                                                                     <group colspan="2" attrs="{'invisible':[('comment_valid_type','!=','must_be_specific_length'), ('comment_valid_type','!=','must_be_whole_number')]}">
113                                                                         <field name="comment_minimum_no" string="Between"/>
114                                                                         <field name="comment_maximum_no" string="and"/>
115                                                                     </group>
116                                                                     <group colspan="4" attrs="{'invisible':[('comment_valid_type','!=','must_be_decimal_number')]}">
117                                                                         <field name="comment_minimum_float" string="Between"/>
118                                                                         <field name="comment_maximum_float" string="and"/>
119                                                                     </group>
120                                                                     <group colspan="4" attrs="{'invisible':[('comment_valid_type','!=','must_be_date')]}">
121                                                                         <field name="comment_minimum_date" string="Between"/>
122                                                                         <field name="comment_maximum_date" string="and"/>
123                                                                     </group>
124                                                                     <group colspan="4" attrs="{'invisible':[('comment_valid_type','!=','must_be_specific_length'),('comment_valid_type','!=','must_be_decimal_number'),('comment_valid_type','!=','must_be_whole_number'),('comment_valid_type','!=','must_be_date'),('comment_valid_type','!=','must_be_email_address')]}">
125                                                                         <label string="When the comment is an invalid format, display this error message" colspan="4"/>
126                                                                         <field name="comment_valid_err_msg" nolabel="1" colspan="4"/>
127                                                                     </group>
128                                                                 </group>
129                                                             </group>
130                                                         </group>
131                                                         <newline/>
132                                                         <group attrs="{'invisible':[('type','!=','matrix_of_choices_only_one_ans'),('type','!=','rating_scale')]}">
133                                                             <field name="comment_column"/>
134                                                             <group colspan="2" attrs="{'invisible':[('comment_column','!=',True)]}">
135                                                                 <field name="column_name" colspan="2"/>
136                                                             </group>
137                                                         </group>
138                                                         <newline/>
139                                                         <group attrs="{'invisible':[('type','!=','single_textbox'), ('type','!=','multiple_textboxes')]}">
140                                                             <separator string="Validation" colspan="4"/>
141                                                             <group colspan="4">
142                                                                 <field name="is_validation_require"/>
143                                                             </group>
144                                                             <group col="6" colspan="4" attrs="{'invisible':[('is_validation_require','=',False)]}">
145                                                                 <field name="validation_type" colspan="2"/>
146                                                                 <group colspan="2" attrs="{'invisible':[('validation_type','!=','must_be_specific_length'), ('validation_type','!=','must_be_whole_number')]}">
147                                                                     <field name="validation_minimum_no" string="Between"/>
148                                                                     <field name="validation_maximum_no" string="and"/>
149                                                                 </group>
150                                                                 <group colspan="4" attrs="{'invisible':[('validation_type','!=','must_be_decimal_number')]}">
151                                                                     <field name="validation_minimum_float" string="Between"/>
152                                                                     <field name="validation_maximum_float" string="and"/>
153                                                                 </group>
154                                                                 <group colspan="4" attrs="{'invisible':[('validation_type','!=','must_be_date')]}">
155                                                                     <field name="validation_minimum_date" string="Between"/>
156                                                                     <field name="validation_maximum_date" string="and"/>
157                                                                 </group>
158                                                             </group>
159                                                             <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')]}">
160                                                                 <label string="When the comment is an invalid format, display this error message" colspan="4"/>
161                                                                 <field name="validation_valid_err_msg" nolabel="1" colspan="4"/>
162                                                             </group>
163                                                         </group>
164                                                         <newline/>
165                                                         <group attrs="{'invisible':[('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','!=','single_textbox'),('type','!=','comment'),('type','!=','multiple_textboxes_diff_type')]}">
166                                                             <separator string="Required Answer" colspan="4"/>
167                                                             <newline/>
168                                                             <field name="is_require_answer"/>
169                                                             <group col="6" colspan="4" attrs="{'invisible':[('is_require_answer','=',False)]}">
170                                                                 <group colspan="4" attrs="{'invisible':[('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','!=','multiple_textboxes_diff_type')]}">
171                                                                     <field name="required_type"/>
172                                                                     <group colspan="2" attrs="{'invisible':[('required_type','!=','at least'),('required_type','!=','at most'),('required_type','!=','exactly')]}">
173                                                                         <field name="req_ans" />
174                                                                     </group>
175                                                                     <group colspan="4" attrs="{'invisible':[('required_type','!=','a range')]}">
176                                                                         <field name="minimum_req_ans"/>
177                                                                         <field name="maximum_req_ans"/>
178                                                                     </group>
179                                                                 </group>
180                                                                 <group colspan="4" attrs="{'invisible':[('required_type','!=','all'),('required_type','!=','at least'),('required_type','!=','at most'),('required_type','!=','exactly'),('required_type','!=','a range'),('is_require_answer','!=',True)]}">
181                                                                     <label string="When the question is not answered, display this error message:"/>
182                                                                     <field name="req_error_msg" colspan="4" nolabel="1"/>
183                                                                 </group>
184                                                                 <group colspan="4" attrs="{'invisible':[('type','!=','numerical_textboxes')]}">
185                                                                     <group colspan="2" >
186                                                                         <field name="numeric_required_sum"/>
187                                                                     </group>
188                                                                     <newline/>
189                                                                     <label string="When the choices do not add up correctly, display this error message"/>
190                                                                     <field name="numeric_required_sum_err_msg" colspan="4" nolabel="1"/>
191                                                                 </group>
192                                                                 <group colspan="4" attrs="{'invisible':[('type','!=','rating_scale')]}">
193                                                                     <field name="rating_allow_one_column_require"/>
194                                                                 </group>
195                                                             </group>
196                                                         </group>
197                                                         <newline/>
198                                                         <group attrs="{'invisible':[('type','!=','descriptive_text')]}">
199                                                             <separator string="Descriptive Text" colspan="4"/>
200                                                             <field name="descriptive_text" colspan="4" nolabel="1"/>
201                                                         </group>
202                                                     </page>
203                                                 </notebook>
204                                                 </group>
205                                             </form>
206                                             <tree string="Survey Question">
207                                                 <field name="sequence" string="Seq"/>
208                                                 <field name="question"/>
209                                                 <field name="answer_choice_ids"/>
210                                             </tree>
211                                         </field>
212                                     </group>
213                                     </sheet>
214                                     </form>
215                                 </field>
216                         </page>
217                         <page string="Invited User">
218                             <field name="invited_user_ids" readonly="1"/>
219                         </page>
220                         <page string="History">
221                             <group>
222                                 <group>
223                                     <field name="date_open"/>
224                                     <field name="date_close"/>
225                                 </group>
226                                 <group>
227                                     <field name="tot_start_survey"/>
228                                     <field name="tot_comp_survey"/>
229                                 </group>
230                             </group>
231                             <field name="history" colspan="4">
232                                 <tree string="History">
233                                     <field name="date"/>
234                                     <field name="user_id"/>
235                                 </tree>
236                                 <form string="History">
237                                     <field name="date"/>
238                                     <field name="user_id"/>
239                                 </form>
240                            </field>
241                         </page>
242                     </notebook>
243                 </sheet>
244                 </form>
245             </field>
246         </record>
247
248         <record model ="ir.ui.view" id= "survey_tree">
249             <field name="name">survey_tree</field>
250             <field name="model">survey</field>
251             <field name="type">tree</field>
252             <field name="arch" type="xml">
253                 <tree colors="gray:state == 'close'" string="Survey">
254                     <field name="title"/>
255                     <field name="type"/>
256                     <field name="responsible_id"/>
257                     <field name="date_open"  string="Open Date"/>
258                     <field name="tot_start_survey" string="Started"/>
259                     <field name="tot_comp_survey" string="Completed"/>
260                     <field name="state"/>
261                     <button name="%(action_view_survey_question_message)d" states="open,draft,close,cancel"
262                         string="Test Survey" type="action" icon="gtk-new"
263                         context="{'active':True,'survey_id': active_id}"/>
264                     <button name="%(action_view_survey_question_message)d" states="open,draft,close,cancel"
265                         string="Answer Survey" type="action" icon="gtk-execute" context="{'survey_id': active_id}" attrs="{'invisible':[('state','!=','open')]}"/>
266                     <button name="%(action_view_survey_question_message)d" states="open,draft,close,cancel"
267                         string="Edit Survey" type="action" icon="gtk-edit" context="{'active':True,'edit' : True,'survey_id': active_id}"/>
268                     <button name="action_print_survey" states="open,draft,close,cancel"
269                                     string="Print Answer" type="object" icon="gtk-print"/>
270                 </tree>
271             </field>
272         </record>
273
274         <record id="survey_search" model="ir.ui.view">
275             <field name="name">survey_search</field>
276             <field name="model">survey</field>
277             <field name="type">search</field>
278             <field name="arch" type="xml">
279                 <search string="Search Survey">
280                    <group>
281                         <field name="title" string="Survey"/>
282                         <separator orientation="vertical"/>
283                         <filter icon="terp-document-new" string="New" domain="[('state','=', 'draft')]" help="All New Survey"/>
284                         <filter icon="terp-camera_test" string="Open" domain="[('state','=','open')]" help="All Open Survey"/>
285                         <filter string="My Survey(s)" icon="terp-personal" domain="[('responsible_id','=',uid)]" help="My Survey(s)"/>
286                         <separator orientation="vertical"/>
287                         <field name="type" widget="selection"/>
288                         <field name="responsible_id"/>
289                    </group>
290                    <newline/>
291                    <group expand="0" string="Group By...">
292                        <filter string="Responsible" icon="terp-personal" domain="[]"  context="{'group_by':'responsible_id'}"/>
293                         <separator orientation="vertical"/>
294                        <filter string="Type" icon="terp-stock_symbol-selection" domain="[]"  context="{'group_by':'type'}"/>
295                        <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]"  context="{'group_by':'state'}"/>
296                    </group>
297                </search>
298             </field>
299         </record>
300
301         <record model="ir.ui.view" id="view_survey_kanban">
302             <field name="name">event.survey.kanban</field>
303             <field name="model">survey</field>
304             <field name="type">kanban</field>
305             <field name="arch" type="xml">
306                 <kanban>
307                     <field name="title"/>
308                     <field name="date_open"/>
309                     <field name="color"/>
310                     <templates>
311                         <t t-name="kanban-box">
312                             <div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card">
313                                 <div class="oe_dropdown_toggle oe_dropdown_kanban">
314                                     <span class="oe_e">i</span>
315                                     <ul class="oe_dropdown_menu">
316                                         <li><a type="edit">Edit...</a></li>
317                                         <li><a type="delete">Delete</a></li>
318                                         <li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
319                                     </ul>
320                                 </div>
321                                 <div class="oe_kanban_content">
322                                     <h3 class="oe_kanban_ellipsis"><t t-esc="record.title.raw_value.toString()"><field name="title"/></t></h3>
323                                     <div class="oe_survey_responsible">
324                                        <t t-if="record.responsible_id.raw_value">By: <field name="responsible_id"/></t>
325                                    </div><br/>
326                                    <div class="oe_survey_start_date">
327                                        <t t-if="record.date_open.raw_value">
328                                            Opened at
329                                            <t t-esc="record.date_open.raw_value.getDate()"/>
330                                            <t t-esc="record.date_open.raw_value.toString('MMM')"/>,
331                                            <t t-esc="record.date_open.raw_value.getFullYear()"/>
332                                        </t>
333                                    </div><br/>
334                                    <div class="oe_survey_rate">
335                                        Rate:
336                                         <a name="fill_survey" type="object">Fill</a>
337                                    </div>
338                                 </div>
339                             </div>
340                         </t>
341                     </templates>
342                 </kanban>
343             </field>
344         </record>
345
346         <record model="ir.actions.act_window" id="action_survey_form1">
347             <field name="name">Surveys</field>
348             <field name="res_model">survey</field>
349             <field name="view_type">form</field>
350             <field name="view_mode">kanban,tree,form</field>
351             <field name="view_id" ref="view_survey_kanban"></field>
352             <field name="search_view_id" ref="survey_search"/>
353             <field name="help">You can create survey for different purposes: recruitment interviews, employee's periodical evaluations, marketing campaigns, etc. A survey is made of pages containing questions of several types: text, multiple choices, etc. You can edit survey manually or click on the 'Edit Survey' for a WYSIWYG interface.</field>
354         </record>
355
356
357         <menuitem name="Surveys" id="menu_survey_form"
358             action="action_survey_form1" parent="menu_define_survey"
359             groups="base.group_tool_manager"/>
360
361         <!--
362             Survey Pages
363         -->
364
365         <record model="ir.ui.view" id="survey_page_form">
366             <field name="name">survey_page_form</field>
367             <field name="model">survey.page</field>
368             <field name="type">form</field>
369             <field name="arch" type="xml">
370                 <form string="Survey Page" version="7.0">
371                     <sheet>
372                         <label for="title" class="oe_edit_only"/>
373                         <h1>
374                             <field name="title"/>
375                         </h1>
376                         <group colspan="4">
377                             <field name="survey_id"/>
378                             <field name="sequence"/>
379                         </group>
380                         <group colspan="4">
381                             <field name="note" nolabel="1" placeholder="Description on the survey page..."/>
382                         </group>
383                         <group col="4">
384                             <label for="question_ids"/>
385                             <newline/>
386                             <field name="question_ids" nolabel="1">
387                             <form string="Survey Question">
388                                 <group>
389                                     <group>
390                                         <field name="question" select="1"/>
391                                         <field name="type" on_change="on_change_type(type)"/>
392                                     </group>
393                                     <group>
394                                         <field name="sequence" invisible="1"/>
395                                         <field name="tot_resp" invisible="1"/>
396                                         <field name="in_visible_rating_weight" invisible="1"/>
397                                         <field name="in_visible_menu_choice" invisible="1"/>
398                                         <field name="in_visible_answer_type" invisible="1"/>
399                                     </group>
400                                     <newline/>
401                                     <notebook colspan="4">
402                                         <page string="Options">
403                                             <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')]}" string="Answer" col="4">
404                                                <group attrs="{'invisible':[('type','=','table')]}">
405                                                    <field name="answer_choice_ids" nolabel="1" context="{'in_visible_answer_type': in_visible_answer_type}"/>
406                                                </group>
407                                                <group 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')]}">
408                                                    <field name="column_heading_ids" nolabel="1" context="{'in_visible_rating_weight':in_visible_rating_weight,'in_visible_menu_choice':in_visible_menu_choice}"/>
409                                                     <group attrs="{'invisible':[('type','!=','table')]}">
410                                                        <field name="no_of_rows"/>
411                                                     </group>
412                                                </group>
413                                             </group>
414                                             <newline/>
415                                             <group  attrs="{'invisible':[('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'), ('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale')]}" string="Comment Field" col="4">
416                                                 <group>
417                                                     <field name="is_comment_require"/>
418                                                 </group>
419                                                 <group attrs="{'invisible':[('is_comment_require','=',False)]}">
420                                                     <group>
421                                                         <field name="comment_field_type" colspan="1"/>
422                                                         <group attrs="{'invisible':[('comment_field_type','!=','char'),('comment_field_type','!=','text')]}">
423                                                             <field name="comment_label" />
424                                                         </group>
425                                                     </group>
426                                                     <group col="6" colspan="4" attrs="{'invisible':[('comment_field_type','!=','char'),('comment_field_type','!=','text')]}">
427                                                         <field name="comment_valid_type" colspan="2"/>
428                                                         <group colspan="2" attrs="{'invisible':[('comment_valid_type','!=','must_be_specific_length'), ('comment_valid_type','!=','must_be_whole_number')]}">
429                                                             <field name="comment_minimum_no" string="Between"/>
430                                                             <field name="comment_maximum_no" string="and"/>
431                                                         </group>
432                                                         <group colspan="4" attrs="{'invisible':[('comment_valid_type','!=','must_be_decimal_number')]}">
433                                                             <field name="comment_minimum_float" string="Between"/>
434                                                             <field name="comment_maximum_float" string="and"/>
435                                                         </group>
436                                                         <group colspan="4" attrs="{'invisible':[('comment_valid_type','!=','must_be_date')]}">
437                                                             <field name="comment_minimum_date" string="Between"/>
438                                                             <field name="comment_maximum_date" string="and"/>
439                                                         </group>
440                                                         <group colspan="4" attrs="{'invisible':[('comment_valid_type','!=','must_be_specific_length'),('comment_valid_type','!=','must_be_decimal_number'),('comment_valid_type','!=','must_be_whole_number'),('comment_valid_type','!=','must_be_date'),('comment_valid_type','!=','must_be_email_address')]}">
441                                                             <label string="When the comment is an invalid format, display this error message" colspan="4"/>
442                                                             <field name="comment_valid_err_msg" nolabel="1" colspan="4"/>
443                                                         </group>
444                                                     </group>
445                                                 </group>
446                                             </group>
447                                             <newline/>
448                                             <group attrs="{'invisible':[('type','!=','matrix_of_choices_only_one_ans'),('type','!=','rating_scale')]}">
449                                                 <field name="comment_column"/>
450                                                 <group colspan="2" attrs="{'invisible':[('comment_column','!=',True)]}">
451                                                     <field name="column_name" colspan="2"/>
452                                                 </group>
453                                             </group>
454                                             <newline/>
455                                             <group attrs="{'invisible':[('type','!=','single_textbox'), ('type','!=','multiple_textboxes')]}">
456                                                 <separator string="Validation" colspan="4"/>
457                                                 <group colspan="4">
458                                                     <field name="is_validation_require"/>
459                                                 </group>
460                                                 <group col="6" colspan="4" attrs="{'invisible':[('is_validation_require','=',False)]}">
461                                                     <field name="validation_type" colspan="2"/>
462                                                     <group colspan="2" attrs="{'invisible':[('validation_type','!=','must_be_specific_length'), ('validation_type','!=','must_be_whole_number')]}">
463                                                         <field name="validation_minimum_no" string="Between"/>
464                                                         <field name="validation_maximum_no" string="and"/>
465                                                     </group>
466                                                     <group colspan="4" attrs="{'invisible':[('validation_type','!=','must_be_decimal_number')]}">
467                                                         <field name="validation_minimum_float" string="Between"/>
468                                                         <field name="validation_maximum_float" string="and"/>
469                                                     </group>
470                                                     <group colspan="4" attrs="{'invisible':[('validation_type','!=','must_be_date')]}">
471                                                         <field name="validation_minimum_date" string="Between"/>
472                                                         <field name="validation_maximum_date" string="and"/>
473                                                     </group>
474                                                 </group>
475                                                 <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')]}">
476                                                     <label string="When the comment is an invalid format, display this error message" colspan="4"/>
477                                                     <field name="validation_valid_err_msg" nolabel="1" colspan="4"/>
478                                                 </group>
479                                             </group>
480                                             <newline/>
481                                             <group attrs="{'invisible':[('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','!=','single_textbox'),('type','!=','comment'),('type','!=','multiple_textboxes_diff_type')]}">
482                                                 <separator string="Required Answer" colspan="4"/>
483                                                 <newline/>
484                                                 <field name="is_require_answer"/>
485                                                 <group col="6" colspan="4" attrs="{'invisible':[('is_require_answer','=',False)]}">
486                                                     <group colspan="4" attrs="{'invisible':[('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','!=','multiple_textboxes_diff_type')]}">
487                                                         <field name="required_type"/>
488                                                         <group colspan="2" attrs="{'invisible':[('required_type','!=','at least'),('required_type','!=','at most'),('required_type','!=','exactly')]}">
489                                                             <field name="req_ans" />
490                                                         </group>
491                                                         <group colspan="4" attrs="{'invisible':[('required_type','!=','a range')]}">
492                                                             <field name="minimum_req_ans"/>
493                                                             <field name="maximum_req_ans"/>
494                                                         </group>
495                                                     </group>
496                                                     <group colspan="4" attrs="{'invisible':[('required_type','!=','all'),('required_type','!=','at least'),('required_type','!=','at most'),('required_type','!=','exactly'),('required_type','!=','a range'),('is_require_answer','!=',True)]}">
497                                                         <label string="When the question is not answered, display this error message:"/>
498                                                         <field name="req_error_msg" colspan="4" nolabel="1"/>
499                                                     </group>
500                                                     <group colspan="4" attrs="{'invisible':[('type','!=','numerical_textboxes')]}">
501                                                         <group colspan="2">
502                                                             <field name="numeric_required_sum"/>
503                                                         </group>
504                                                         <newline/>
505                                                         <label string="When the choices do not add up correctly, display this error message"/>
506                                                         <field name="numeric_required_sum_err_msg" colspan="4" nolabel="1"/>
507                                                     </group>
508                                                     <group colspan="4" attrs="{'invisible':[('type','!=','rating_scale')]}">
509                                                         <field name="rating_allow_one_column_require"/>
510                                                     </group>
511                                                 </group>
512                                             </group>
513                                             <newline/>
514                                             <group attrs="{'invisible':[('type','!=','descriptive_text')]}">
515                                                 <separator string="Descriptive Text" colspan="4"/>
516                                                 <field name="descriptive_text" colspan="4" nolabel="1"/>
517                                             </group>
518                                         </page>
519                                     </notebook>
520                                 </group>
521                             </form>
522                             <tree string="Survey Question">
523                                 <field name="sequence" string="Seq"/>
524                                 <field name="question"/>
525                                 <field name="answer_choice_ids"/>
526                             </tree>
527                             </field>
528                         </group>
529                     </sheet>
530                 </form>
531             </field>
532         </record>
533
534
535         <record model="ir.ui.view" id="survey_page_tree">
536             <field name="name">survey_page_tree</field>
537             <field name="model">survey.page</field>
538             <field name="type">tree</field>
539             <field name="arch" type="xml">
540                 <tree string="Survey Page">
541                     <field name="sequence" string="Seq"/>
542                     <field name="title"/>
543                     <field name="survey_id"/>
544                     <field name="question_ids" string="#Questions"/>
545                 </tree>
546             </field>
547         </record>
548
549         <record id="view_survey_page_filter" model="ir.ui.view">
550             <field name="name">survey.page.list.select</field>
551             <field name="model">survey.page</field>
552             <field name="type">search</field>
553             <field name="arch" type="xml">
554                 <search string="Search Survey Page">
555                     <field name="title" string="Page"/>
556                     <separator orientation="vertical"/>
557                     <field name="survey_id"/>
558                     <newline/>
559                     <group expand="0" string="Group By...">
560                         <filter string="Survey" icon="terp-stock_align_left_24" domain="[]"  context="{'group_by':'survey_id'}"/>
561                     </group>
562                 </search>
563             </field>
564         </record>
565
566         <record model="ir.actions.act_window" id="action_survey_page_form">
567             <field name="name">Survey Pages</field>
568             <field name="res_model">survey.page</field>
569             <field name="view_type">form</field>
570             <field name="view_mode">tree,form</field>
571             <field name="view_id" ref="survey_page_tree"></field>
572         </record>
573
574         <menuitem name="Survey Pages" id="menu_survey_page_form1"
575             action="action_survey_page_form" parent='menu_define_survey'
576             groups="base.group_tool_manager"/>
577
578         <record model="ir.ui.view" id="survey_page_wizard_test1">
579             <field name="name">survey_page_wizard_test</field>
580             <field name="model">survey.page</field>
581             <field name="type">form</field>
582             <field name="priority">20</field>
583             <field name="arch" type="xml">
584                 <form string="Survey Pages">
585                     <field name="title" colspan="4"/>
586                     <field name="sequence"/>
587                     <separator string="Description" colspan="4"/>
588                     <field name="note" colspan="4" nolabel="1"/>
589                       <group colspan="4">
590                           <label string="" colspan="3"/>
591                         <button name="survey_save"  string="Ok" type="object" icon="gtk-go-forward"/>
592                     </group>
593                 </form>
594             </field>
595         </record>
596
597         <!--
598             Survey Question
599         -->
600
601         <record model="ir.ui.view" id="survey_question_form">
602             <field name="name">survey_question_form</field>
603             <field name="model">survey.question</field>
604             <field name="type">form</field>
605             <field name="arch" type="xml">
606                 <form string="Survey Question">
607                     <field name="question" colspan="4"/>
608                     <field name="page_id"/>
609                     <field name="sequence"/>
610                     <field name="tot_resp"/>
611                     <field name="type" on_change="on_change_type(type)"/>
612                     <field name="in_visible_rating_weight" invisible="1"/>
613                     <field name="in_visible_menu_choice" invisible="1"/>
614                     <field name="in_visible_answer_type" invisible="1"/>
615                     <notebook colspan="4">
616                         <page string="Options">
617                             <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')]}">
618                               <separator string="Answer" colspan="4"/>
619                                <group colspan="4" attrs="{'invisible':[('type','=','table')]}">
620                                    <field name="answer_choice_ids" nolabel="1" colspan="4" context="{'in_visible_answer_type': in_visible_answer_type}"/>
621                                </group>
622                                <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')]}">
623                                    <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}"/>
624                                     <group colspan="4" attrs="{'invisible':[('type','!=','table')]}">
625                                        <field name="no_of_rows"/>
626                                     </group>
627                                </group>
628                             </group>
629                             <newline/>
630                             <group  attrs="{'invisible':[('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'), ('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale')]}">
631                                 <separator string="Comment Field" colspan="4"/>
632                                 <group colspan="4">
633                                     <field name="is_comment_require"/>
634                                 </group>
635                                 <group attrs="{'invisible':[('is_comment_require','=',False)]}">
636                                     <group col="4" colspan="4">
637                                         <field name="comment_field_type" colspan="1"/>
638                                         <group colspan="2" attrs="{'invisible':[('comment_field_type','!=','char'),('comment_field_type','!=','text')]}">
639                                             <field colspan="2" name="comment_label" />
640                                         </group>
641                                     </group>
642                                     <group col="6" colspan="4" attrs="{'invisible':[('comment_field_type','!=','char'),('comment_field_type','!=','text')]}">
643                                         <field name="comment_valid_type" colspan="2"/>
644                                         <group colspan="2" attrs="{'invisible':[('comment_valid_type','!=','must_be_specific_length'), ('comment_valid_type','!=','must_be_whole_number')]}">
645                                             <field name="comment_minimum_no" string="Between"/>
646                                             <field name="comment_maximum_no" string="and"/>
647                                         </group>
648                                         <group colspan="4" attrs="{'invisible':[('comment_valid_type','!=','must_be_decimal_number')]}">
649                                             <field name="comment_minimum_float" string="Between"/>
650                                             <field name="comment_maximum_float" string="and"/>
651                                         </group>
652                                         <group colspan="4" attrs="{'invisible':[('comment_valid_type','!=','must_be_date')]}">
653                                             <field name="comment_minimum_date" string="Between"/>
654                                             <field name="comment_maximum_date" string="and"/>
655                                         </group>
656                                         <group colspan="4" attrs="{'invisible':[('comment_valid_type','!=','must_be_specific_length'),('comment_valid_type','!=','must_be_decimal_number'),('comment_valid_type','!=','must_be_whole_number'),('comment_valid_type','!=','must_be_date'),('comment_valid_type','!=','must_be_email_address')]}">
657                                             <label string="When the comment is an invalid format, display this error message" colspan="4"/>
658                                             <field name="comment_valid_err_msg" nolabel="1" colspan="4"/>
659                                         </group>
660                                     </group>
661                                 </group>
662                             </group>
663                             <newline/>
664                             <group attrs="{'invisible':[('type','!=','matrix_of_choices_only_one_ans'),('type','!=','rating_scale')]}">
665                                 <field name="comment_column"/>
666                                 <group colspan="2" attrs="{'invisible':[('comment_column','!=',True)]}">
667                                     <field name="column_name" colspan="2"/>
668                                 </group>
669                             </group>
670                             <newline/>
671                             <group attrs="{'invisible':[('type','!=','single_textbox'), ('type','!=','multiple_textboxes')]}">
672                                 <separator string="Validation" colspan="4"/>
673                                 <group colspan="4">
674                                     <field name="is_validation_require"/>
675                                 </group>
676                                 <group col="6" colspan="4" attrs="{'invisible':[('is_validation_require','=',False)]}">
677                                     <field name="validation_type" colspan="2"/>
678                                     <group colspan="2" attrs="{'invisible':[('validation_type','!=','must_be_specific_length'), ('validation_type','!=','must_be_whole_number')]}">
679                                         <field name="validation_minimum_no" string="Between"/>
680                                         <field name="validation_maximum_no" string="and"/>
681                                     </group>
682                                     <group colspan="4" attrs="{'invisible':[('validation_type','!=','must_be_decimal_number')]}">
683                                         <field name="validation_minimum_float" string="Between"/>
684                                         <field name="validation_maximum_float" string="and"/>
685                                     </group>
686                                     <group colspan="4" attrs="{'invisible':[('validation_type','!=','must_be_date')]}">
687                                         <field name="validation_minimum_date" string="Between"/>
688                                         <field name="validation_maximum_date" string="and"/>
689                                     </group>
690                                 </group>
691                                 <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')]}">
692                                     <label string="When the comment is an invalid format, display this error message" colspan="4"/>
693                                     <field name="validation_valid_err_msg" nolabel="1" colspan="4"/>
694                                 </group>
695                             </group>
696                             <newline/>
697                             <group attrs="{'invisible':[('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','!=','single_textbox'),('type','!=','comment'),('type','!=','multiple_textboxes_diff_type')]}">
698                                 <separator string="Required Answer" colspan="4"/>
699                                 <newline/>
700                                 <field name="is_require_answer"/>
701                                 <group col="6" colspan="4" attrs="{'invisible':[('is_require_answer','=',False)]}">
702                                     <group colspan="4" attrs="{'invisible':[('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','!=','multiple_textboxes_diff_type')]}">
703                                         <field name="required_type"/>
704                                         <group colspan="2" attrs="{'invisible':[('required_type','!=','at least'),('required_type','!=','at most'),('required_type','!=','exactly')]}">
705                                             <field name="req_ans" />
706                                         </group>
707                                         <group colspan="4" attrs="{'invisible':[('required_type','!=','a range')]}">
708                                             <field name="minimum_req_ans"/>
709                                             <field name="maximum_req_ans"/>
710                                         </group>
711                                     </group>
712                                     <group colspan="4" attrs="{'invisible':[('required_type','!=','all'),('required_type','!=','at least'),('required_type','!=','at most'),('required_type','!=','exactly'),('required_type','!=','a range'),('is_require_answer','!=',True)]}">
713                                         <label string="When the question is not answered, display this error message:"/>
714                                         <field name="req_error_msg" colspan="4" nolabel="1"/>
715                                     </group>
716                                     <group colspan="4" attrs="{'invisible':[('type','!=','numerical_textboxes')]}">
717                                         <group colspan="2" >
718                                             <field name="numeric_required_sum"/>
719                                         </group>
720                                         <newline/>
721                                         <label string="When the choices do not add up correctly, display this error message"/>
722                                         <field name="numeric_required_sum_err_msg" colspan="4" nolabel="1"/>
723                                     </group>
724                                     <group colspan="4" attrs="{'invisible':[('type','!=','rating_scale')]}">
725                                         <field name="rating_allow_one_column_require"/>
726                                     </group>
727                                 </group>
728                             </group>
729                             <newline/>
730                             <group attrs="{'invisible':[('type','!=','descriptive_text')]}">
731                                 <separator string="Descriptive Text" colspan="4"/>
732                                 <field name="descriptive_text" colspan="4" nolabel="1"/>
733                             </group>
734                         </page>
735                     </notebook>
736                 </form>
737             </field>
738         </record>
739
740         <record model="ir.ui.view" id="survey_question_tree">
741             <field name="name">survey_question_tree</field>
742             <field name="model">survey.question</field>
743             <field name="type">tree</field>
744             <field name="arch" type="xml">
745                 <tree string="Survey Question">
746                     <field name="sequence" string="Seq"/>
747                     <field name="question"/>
748                     <field name="page_id"/>
749                     <field name="survey"/>
750                     <field name="type"/>
751                 </tree>
752             </field>
753         </record>
754
755         <record id="survey_question_search" model="ir.ui.view">
756             <field name="name">survey_question_search</field>
757             <field name="model">survey.question</field>
758             <field name="type">search</field>
759             <field name="arch" type="xml">
760                 <search string="Search Question">
761                     <field name="question" string="Question"/>
762                     <separator orientation="vertical"/>
763                     <field name="page_id"/>
764                     <field name="survey" widget="selection"/>
765                     <field name="type"/>
766                     <newline/>
767                     <group expand="0" string="Group By...">
768                         <filter string="Page" icon="terp-stock_align_left_24" domain="[]"  context="{'group_by':'page_id'}"/>
769                     </group>
770                </search>
771             </field>
772         </record>
773
774         <record model="ir.actions.act_window" id="action_survey_question_form">
775             <field name="name">Survey Questions</field>
776             <field name="res_model">survey.question</field>
777             <field name="view_type">form</field>
778             <field name="view_mode">tree,form</field>
779             <field name="view_id" ref="survey_question_tree"></field>
780              <field name="search_view_id" ref="survey_question_search"/>
781         </record>
782
783         <record model="ir.ui.view" id="survey_question_wizard_test">
784             <field name="name">survey_question_wizard_test</field>
785             <field name="model">survey.question</field>
786             <field name="priority">20</field>
787             <field name="type">form</field>
788             <field name="arch" type="xml">
789                 <form string="Survey Question">
790                     <field name="question" colspan="4"/>
791                     <field name="sequence"/>
792                     <field name="tot_resp"/>
793                     <field name="type" on_change="on_change_type(type)"/>
794                     <field name="in_visible_rating_weight" invisible="1"/>
795                     <field name="in_visible_menu_choice" invisible="1"/>
796                     <field name="in_visible_answer_type" invisible="1"/>
797                     <notebook colspan="4">
798                         <page string="Options">
799                             <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')]}">
800                               <separator string="Answer" colspan="4"/>
801                                <group colspan="4" attrs="{'invisible':[('type','=','table')]}">
802                                    <field name="answer_choice_ids" nolabel="1" colspan="4" context="{'in_visible_answer_type': in_visible_answer_type}"/>
803                                </group>
804                                <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')]}">
805                                    <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}"/>
806                                     <group colspan="4" attrs="{'invisible':[('type','!=','table')]}">
807                                        <field name="no_of_rows"/>
808                                     </group>
809                                </group>
810                             </group>
811                             <newline/>
812                             <group  attrs="{'invisible':[('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'), ('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale')]}">
813                                 <separator string="Comment Field" colspan="4"/>
814                                 <group colspan="4">
815                                     <field name="is_comment_require"/>
816                                 </group>
817                                 <group attrs="{'invisible':[('is_comment_require','=',False)]}">
818                                     <group col="4" colspan="4">
819                                         <field name="comment_field_type" colspan="1"/>
820                                         <group colspan="2" attrs="{'invisible':[('comment_field_type','!=','char'),('comment_field_type','!=','text')]}">
821                                             <field colspan="2" name="comment_label" />
822                                         </group>
823                                     </group>
824                                     <group col="6" colspan="4" attrs="{'invisible':[('comment_field_type','!=','char'),('comment_field_type','!=','text')]}">
825                                         <field name="comment_valid_type" colspan="2"/>
826                                         <group colspan="2" attrs="{'invisible':[('comment_valid_type','!=','must_be_specific_length'), ('comment_valid_type','!=','must_be_whole_number')]}">
827                                             <field name="comment_minimum_no" string="Between"/>
828                                             <field name="comment_maximum_no" string="and"/>
829                                         </group>
830                                         <group colspan="4" attrs="{'invisible':[('comment_valid_type','!=','must_be_decimal_number')]}">
831                                             <field name="comment_minimum_float" string="Between"/>
832                                             <field name="comment_maximum_float" string="and"/>
833                                         </group>
834                                         <group colspan="4" attrs="{'invisible':[('comment_valid_type','!=','must_be_date')]}">
835                                             <field name="comment_minimum_date" string="Between"/>
836                                             <field name="comment_maximum_date" string="and"/>
837                                         </group>
838                                         <group colspan="4" attrs="{'invisible':[('comment_valid_type','!=','must_be_specific_length'),('comment_valid_type','!=','must_be_decimal_number'),('comment_valid_type','!=','must_be_whole_number'),('comment_valid_type','!=','must_be_date'),('comment_valid_type','!=','must_be_email_address')]}">
839                                             <label string="When the comment is an invalid format, display this error message" colspan="4"/>
840                                             <field name="comment_valid_err_msg" nolabel="1" colspan="4"/>
841                                         </group>
842                                     </group>
843                                 </group>
844                             </group>
845                             <newline/>
846                             <group attrs="{'invisible':[('type','!=','matrix_of_choices_only_one_ans'),('type','!=','rating_scale')]}">
847                                 <field name="comment_column"/>
848                                 <group colspan="2" attrs="{'invisible':[('comment_column','!=',True)]}">
849                                     <field name="column_name" colspan="2"/>
850                                 </group>
851                             </group>
852                             <newline/>
853                             <group attrs="{'invisible':[('type','!=','single_textbox'), ('type','!=','multiple_textboxes')]}">
854                                 <separator string="Validation" colspan="4"/>
855                                 <group colspan="4">
856                                     <field name="is_validation_require"/>
857                                 </group>
858                                 <group col="6" colspan="4" attrs="{'invisible':[('is_validation_require','=',False)]}">
859                                     <field name="validation_type" colspan="2"/>
860                                     <group colspan="2" attrs="{'invisible':[('validation_type','!=','must_be_specific_length'), ('validation_type','!=','must_be_whole_number')]}">
861                                         <field name="validation_minimum_no" string="Between"/>
862                                         <field name="validation_maximum_no" string="and"/>
863                                     </group>
864                                     <group colspan="4" attrs="{'invisible':[('validation_type','!=','must_be_decimal_number')]}">
865                                         <field name="validation_minimum_float" string="Between"/>
866                                         <field name="validation_maximum_float" string="and"/>
867                                     </group>
868                                     <group colspan="4" attrs="{'invisible':[('validation_type','!=','must_be_date')]}">
869                                         <field name="validation_minimum_date" string="Between"/>
870                                         <field name="validation_maximum_date" string="and"/>
871                                     </group>
872                                 </group>
873                                 <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')]}">
874                                     <label string="When the comment is an invalid format, display this error message" colspan="4"/>
875                                     <field name="validation_valid_err_msg" nolabel="1" colspan="4"/>
876                                 </group>
877                             </group>
878                             <newline/>
879                             <group attrs="{'invisible':[('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','!=','single_textbox'),('type','!=','comment'),('type','!=','multiple_textboxes_diff_type')]}">
880                                 <separator string="Required Answer" colspan="4"/>
881                                 <newline/>
882                                 <field name="is_require_answer"/>
883                                 <group col="6" colspan="4" attrs="{'invisible':[('is_require_answer','=',False)]}">
884                                     <group colspan="4" attrs="{'invisible':[('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','!=','multiple_textboxes_diff_type')]}">
885                                         <field name="required_type"/>
886                                         <group colspan="2" attrs="{'invisible':[('required_type','!=','at least'),('required_type','!=','at most'),('required_type','!=','exactly')]}">
887                                             <field name="req_ans" />
888                                         </group>
889                                         <group colspan="4" attrs="{'invisible':[('required_type','!=','a range')]}">
890                                             <field name="minimum_req_ans"/>
891                                             <field name="maximum_req_ans"/>
892                                         </group>
893                                     </group>
894                                     <group colspan="4" attrs="{'invisible':[('required_type','!=','all'),('required_type','!=','at least'),('required_type','!=','at most'),('required_type','!=','exactly'),('required_type','!=','a range'),('is_require_answer','!=',True)]}">
895                                         <label string="When the question is not answered, display this error message:"/>
896                                         <field name="req_error_msg" colspan="4" nolabel="1"/>
897                                     </group>
898                                     <group colspan="4" attrs="{'invisible':[('type','!=','numerical_textboxes')]}">
899                                         <group colspan="2" >
900                                             <field name="numeric_required_sum"/>
901                                         </group>
902                                         <newline/>
903                                         <label string="When the choices do not add up correctly, display this error message"/>
904                                         <field name="numeric_required_sum_err_msg" colspan="4" nolabel="1"/>
905                                     </group>
906                                     <group colspan="4" attrs="{'invisible':[('type','!=','rating_scale')]}">
907                                         <field name="rating_allow_one_column_require"/>
908                                     </group>
909                                 </group>
910                             </group>
911                             <newline/>
912                             <group attrs="{'invisible':[('type','!=','descriptive_text')]}">
913                                 <separator string="Descriptive Text" colspan="4"/>
914                                 <field name="descriptive_text" colspan="4" nolabel="1"/>
915                             </group>
916                         </page>
917                     </notebook>
918                       <group colspan="4">
919                           <label string="" colspan="3"/>
920                         <button name="survey_save"  string="Ok" type="object" icon="gtk-go-forward"/>
921                     </group>
922                 </form>
923             </field>
924         </record>
925
926         <!--
927             Survey Answer
928         -->
929
930         <record model ="ir.ui.view" id="survey_answer_form">
931             <field name="name">survey_answer_form</field>
932             <field name="model">survey.answer</field>
933             <field name="type">form</field>
934             <field name="arch" type="xml">
935                 <form string="Survey Answer">
936                     <field name="answer" colspan="4"/>
937                     <field name="sequence"/>
938                     <field name="in_visible_answer_type" invisible="1"/>
939                        <group colspan="4" attrs="{'invisible':[('in_visible_answer_type','=',True)]}">
940                         <field name="type" colspan="2"/>
941                         <group colspan="4" attrs="{'invisible':[('type','!=','selection')]}">
942                             <separator string="Menu Choices (each choice on separate by lines)" colspan="4"/>
943                             <field name="menu_choice" colspan="4" nolabel="1"/>
944                         </group>
945                     </group>
946                 </form>
947             </field>
948         </record>
949
950
951         <record model="ir.ui.view" id= "survey_answer_tree">
952             <field name="name">survey_answer_tree</field>
953             <field name="model">survey.answer</field>
954             <field name="type">tree</field>
955             <field name="arch" type="xml">
956                 <tree editable="bottom" string="Survey Answer">
957                     <field name="sequence" string="Seq"/>
958                     <field name="answer"/>
959                     <field name="type"/>
960                 </tree>
961             </field>
962         </record>
963
964         <!--
965             Survey Response Line
966         -->
967
968         <record model ="ir.ui.view" id= "survey_response_line_form">
969             <field name="name">survey_response_line_form</field>
970             <field name="model">survey.response.line</field>
971             <field name="type">form</field>
972             <field name="arch" type="xml">
973                 <form string="Survey Answer">
974                     <field name="question_id"/>
975                     <field name="date_create"/>
976                     <notebook colspan="4">
977                         <page string="Answer">
978                             <field name="response_answer_ids" colspan="4" nolabel="1"/>
979                             <group col="5" colspan="4">
980                                 <field name="state"/>
981                             </group>
982                         </page>
983                         <page string="Single Textboxes">
984                             <field name="single_text" colspan="4"/>
985                         </page>
986                         <page string="Comment">
987                             <separator string="Description" colspan="4"/>
988                             <field name="comment" nolabel="1" colspan="4"/>
989                         </page>
990                         <page string="Table Answer">
991                             <field name="response_table_ids" colspan="4" nolabel="1">
992                             <form string="Table">
993                                 <field name="column_id"/>
994                                 <field name="name"/>
995                                 <field name="value"/>
996                             </form>
997                             <tree string="Table">
998                                 <field name="column_id"/>
999                                 <field name="name"/>
1000                                 <field name="value"/>
1001                             </tree>
1002                             </field>
1003                         </page>
1004                     </notebook>
1005                 </form>
1006             </field>
1007         </record>
1008
1009         <record model="ir.ui.view" id="survey_response_line_tree">
1010             <field name="name">survey_response_line_tree</field>
1011             <field name="model">survey.response.line</field>
1012             <field name="type">tree</field>
1013             <field name="arch" type="xml">
1014                 <tree string="Survey Answer Line">
1015                     <field name="page_id"/>
1016                     <field name="question_id"/>
1017                     <field name="date_create"/>
1018                     <field name="state"/>
1019                 </tree>
1020             </field>
1021         </record>
1022
1023         <!--
1024             Survey Response
1025         -->
1026
1027         <record model="ir.ui.view" id="survey_response_form">
1028             <field name="name">survey_response_form</field>
1029             <field name="model">survey.response</field>
1030             <field name="type">form</field>
1031             <field name="arch" type="xml">
1032                 <form string="Survey Answer">
1033                     <field name="survey_id"/>
1034                     <field name="date_create"/>
1035                     <field name="user_id"/>
1036                     <field name="response_type"/>
1037                     <field name="question_ids" nolabel="1" colspan="4" />
1038                     <field name="state"/>
1039                 </form>
1040             </field>
1041         </record>
1042
1043         <record model="ir.ui.view" id="survey_response_tree">
1044             <field name="name">survey_response_tree</field>
1045             <field name="model">survey.response</field>
1046             <field name="type">tree</field>
1047             <field name="arch" type="xml">
1048                 <tree string="Survey Answer">
1049                     <field name="survey_id"/>
1050                     <field name="date_create"/>
1051                     <field name="user_id"/>
1052                     <field name="response_type"/>
1053                     <field name="state"/>
1054                 </tree>
1055             </field>
1056         </record>
1057
1058         <!--
1059             Survey Response Answer
1060         -->
1061
1062         <record model="ir.ui.view" id="survey_response_answer_form">
1063             <field name="name">survey_response_answer_form</field>
1064             <field name="model">survey.response.answer</field>
1065             <field name="type">form</field>
1066             <field name="arch" type="xml">
1067                 <form string="Survey Answer">
1068                     <group colspan="4">
1069                         <field name="answer_id"/>
1070                         <field name="answer" />
1071                     </group>
1072                     <field name="value_choice"/>
1073                     <label string="(Use Only Question Type is matrix_of_drop_down_menus)" align="0.0"/>
1074                     <group colspan="4" col="4">
1075                         <field name="comment_field"/>
1076                         <field name="column_id"/>
1077                     </group>
1078                 </form>
1079             </field>
1080         </record>
1081
1082         <record model="ir.ui.view" id="survey_response_answer_tree">
1083             <field name="name">survey_response_answer_tree</field>
1084             <field name="model">survey.response.answer</field>
1085             <field name="type">tree</field>
1086             <field name="arch" type="xml">
1087                 <tree editable="top" string="Survey Answer">
1088                     <field name="answer_id"/>
1089                     <field name="answer" />
1090                     <field name="value_choice" />
1091                     <field name="column_id"/>
1092                     <field name="comment_field"/>
1093                 </tree>
1094             </field>
1095         </record>
1096
1097         <!--
1098             Survey Question Column Heading
1099     -->
1100
1101         <record model="ir.ui.view" id="survey_question_column_heading_form">
1102             <field name="name">survey_question_column_heading_form</field>
1103             <field name="model">survey.question.column.heading</field>
1104             <field name="type">form</field>
1105             <field name="arch" type="xml">
1106                 <form string="Column Heading">
1107                     <field name="title"/>
1108                     <field name="in_visible_rating_weight" invisible="1"/>
1109                     <field name="in_visible_menu_choice" invisible="1"/>
1110                     <group colspan="4" attrs="{'invisible':[('in_visible_rating_weight','!=',False)]}">
1111                         <field name="rating_weight"/>
1112                         <label align="0.0" string="Use if question type is rating_scale" />
1113                     </group>
1114                     <group colspan="4" attrs="{'invisible':[('in_visible_menu_choice','!=',False)]}">
1115                         <separator string="Menu Choices (each choice on separate lines)" colspan="4"/>
1116                         <field name="menu_choice" nolabel="1" colspan="4"/>
1117                     </group>
1118                 </form>
1119             </field>
1120         </record>
1121
1122         <record model="ir.ui.view" id="survey_question_column_heading_tree">
1123             <field name="name">survey_question_column_heading_tree</field>
1124             <field name="model">survey.question.column.heading</field>
1125             <field name="type">tree</field>
1126             <field name="arch" type="xml">
1127                 <tree editable="bottom" string="Column Heading">
1128                     <field name="title"/>
1129                 </tree>
1130             </field>
1131         </record>
1132
1133         <!--
1134             Survey Request
1135         -->
1136
1137         <record model="ir.ui.view" id="survey_request_form">
1138             <field name="name">survey_request_form</field>
1139             <field name="model">survey.request</field>
1140             <field name="type">form</field>
1141             <field name="arch" type="xml">
1142                 <form version="7.0">
1143                 <header>
1144                     <button name="survey_req_draft" string="Set to Draft" states="cancel,done" type="object"/>
1145                     <button name="survey_req_waiting_answer" string="Waiting Answer" states="draft" type="object" class="oe_highlight"/>
1146                     <button name="survey_req_done" string="Done" states="waiting_answer" type="object" class="oe_highlight"/>
1147                     <button name="survey_req_cancel" string="Cancel" states="waiting_answer" type="object"/>
1148                     <field name="state" widget="statusbar" statusbar_visible="draft,waiting_answer"/>
1149                 </header>
1150                 <sheet string="Survey Request">
1151                     <group class="oe_header">
1152                     <field name="date_deadline"/>
1153                     <field name="survey_id"/>
1154                     <field name="user_id" on_change="on_change_user(user_id)"/>
1155                      <field name="response" readonly="1"/>
1156                     </group>
1157                     </sheet>
1158                 </form>
1159             </field>
1160         </record>
1161
1162         <record model="ir.ui.view" id="survey_request_tree">
1163             <field name="name">survey_request_tree</field>
1164             <field name="model">survey.request</field>
1165             <field name="type">tree</field>
1166             <field name="arch" type="xml">
1167                 <tree string="Evaluation Plan Phase" colors="red:date_deadline&lt;current_date">
1168                     <field name="date_deadline"/>
1169                     <field name="user_id"/>
1170                     <field name="survey_id"/>
1171                     <field name="response" />
1172                     <field name="state" />
1173                 </tree>
1174             </field>
1175         </record>
1176
1177        <record id="survey_request_search" model="ir.ui.view">
1178             <field name="name">survey_request_search</field>
1179             <field name="model">survey.request</field>
1180             <field name="type">search</field>
1181             <field name="arch" type="xml">
1182                 <search string="Search Survey">
1183                    <group>
1184                         <field name="email" string="Survey"/>
1185                         <separator orientation="vertical"/>
1186                         <filter icon="terp-gtk-media-pause" string="Waiting Answer" domain="[('state','=','waiting_answer')]"/>
1187                         <filter icon="terp-emblem-important" string="Late" domain="[('date_deadline','&lt;',current_date)]"/>
1188                         <filter string="My Survey(s)" icon="terp-personal" domain="[('user_id','=',uid)]"/>
1189                         <separator orientation="vertical"/>
1190                         <field name="survey_id" widget="selection"/>
1191                         <field name="user_id"/>
1192                     </group>
1193                     <newline/>
1194                     <group expand="0" string="Group By...">
1195                         <filter string="User" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
1196                         <separator orientation="vertical"/>
1197                         <filter string="Survey" icon="terp-stock_align_left_24" domain="[]"  context="{'group_by':'survey_id'}"/>
1198                         <separator orientation="vertical"/>
1199                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]"  context="{'group_by':'state'}"/>
1200                     </group>
1201                </search>
1202             </field>
1203         </record>
1204
1205         <record model="ir.actions.act_window" id="action_survey_request_tree">
1206             <field name="name">Survey Requests</field>
1207             <field name="res_model">survey.request</field>
1208             <field name="view_type">form</field>
1209             <field name="view_mode">tree,form</field>
1210             <field name="domain">[('user_id','=',uid)]</field>
1211             <field name="view_id" ref="survey_request_tree"></field>
1212             <field name="search_view_id" ref="survey_request_search"/>
1213         </record>
1214
1215         <menuitem name="Survey Requests" id="menu_survey_type_form1"
1216             action="action_survey_request_tree" parent='menu_answer_surveys'
1217             groups="base.group_tool_manager"/>
1218
1219         <!--
1220             Survey Type
1221         -->
1222
1223         <record model="ir.ui.view" id="survey_type_form">
1224             <field name="name">survey_type_form</field>
1225             <field name="model">survey.type</field>
1226             <field name="type">form</field>
1227             <field name="arch" type="xml">
1228                 <form string="Survey Type">
1229                     <field name="name"/>
1230                     <field name="code"/>
1231                 </form>
1232             </field>
1233         </record>
1234
1235         <record model="ir.ui.view" id="survey_type_tree">
1236             <field name="name">survey_type_tree</field>
1237             <field name="model">survey.type</field>
1238             <field name="type">tree</field>
1239             <field name="arch" type="xml">
1240                 <tree string="Survey Type">
1241                     <field name="name"/>
1242                     <field name="code"/>
1243                 </tree>
1244             </field>
1245         </record>
1246
1247         <record model="ir.actions.act_window" id="action_survey_type_form">
1248             <field name="name">Survey Type</field>
1249             <field name="res_model">survey.type</field>
1250             <field name="view_type">form</field>
1251             <field name="view_mode">tree,form</field>
1252             <field name="view_id" ref="survey_type_tree"></field>
1253         </record>
1254
1255         <act_window
1256             context="{'search_default_survey_id': [active_id], 'default_survey_id': active_id}"
1257             id="act_survey_pages"
1258             name="Pages"
1259             res_model="survey.page"
1260             src_model="survey"/>
1261
1262         <act_window
1263             context="{'search_default_survey': active_id, 'default_survey': active_id}"
1264             id="act_survey_question"
1265             name="Questions"
1266             res_model="survey.question"
1267             src_model="survey"/>
1268
1269
1270         <act_window
1271             context="{'search_default_page_id': active_id, 'default_page_id': active_id}"
1272             id="act_survey_page_question"
1273             name="Questions"
1274             res_model="survey.question"
1275             src_model="survey.page"/>
1276
1277         <act_window domain="[('question_id', '=', active_id)]"
1278             id="act_survey_answer"
1279             name="Answers"
1280             res_model="survey.answer"
1281             src_model="survey.question"/>
1282
1283         <menuitem name="Answer a Survey" id="menu_run_survey_form" sequence="2"
1284             action="action_view_survey_name" parent="menu_answer_surveys"            groups="base.group_tool_user,base.group_tool_manager,base.group_survey_user" icon="STOCK_INDEX"/>
1285
1286     </data>
1287 </openerp>