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