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