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