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