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