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