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