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