[IMP]improve view in contract
[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"/>
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                         <filter icon="terp-document-new" string="New" domain="[('state','=', 'draft')]" help="All New Survey"/>
262                         <filter icon="terp-camera_test" string="Open" domain="[('state','=','open')]" help="All Open Survey"/>
263                         <separator orientation="vertical"/>
264                         <field name="title"/>
265                         <field name="type" widget="selection"/>
266                         <field name="responsible_id">
267                             <filter string="MY" icon="terp-personal" domain="[('responsible_id','=',uid)]" help="My Survey(s)"/>
268                         </field>
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">
306                     <field name="title" colspan="4" select="1"/>
307                     <field name="survey_id" select="1"/>
308                     <field name="sequence"/>
309                     <separator string="Description" colspan="4"/>
310                     <field name="note" colspan="4" nolabel="1"/>
311                     <field name="question_ids" colspan="4" nolabel="1">
312                     <form string="Survey Question">
313                         <field name="question" colspan="4" select="1"/>
314                         <field name="sequence"/>
315                         <field name="tot_resp"/>
316                         <field name="type" on_change="on_change_type(type)"/>
317                         <field name="in_visible_rating_weight" invisible="1"/>
318                         <field name="in_visible_menu_choice" invisible="1"/>
319                         <field name="in_visible_answer_type" invisible="1"/>
320                         <notebook colspan="4">
321                             <page string="Options">
322                                 <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')]}">
323                                   <separator string="Answer" colspan="4"/>
324                                    <group colspan="4" attrs="{'invisible':[('type','=','table')]}">
325                                        <field name="answer_choice_ids" nolabel="1" colspan="4" context="{'in_visible_answer_type': in_visible_answer_type}"/>
326                                    </group>
327                                    <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')]}">
328                                        <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}"/>
329                                         <group colspan="4" attrs="{'invisible':[('type','!=','table')]}">
330                                            <field name="no_of_rows"/>
331                                         </group>
332                                    </group>
333                                 </group>
334                                 <newline/>
335                                 <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')]}">
336                                     <separator string="Comment Field" colspan="4"/>
337                                     <group colspan="4">
338                                         <field name="is_comment_require"/>
339                                     </group>
340                                     <group attrs="{'invisible':[('is_comment_require','=',False)]}">
341                                         <group col="4" colspan="4">
342                                             <field name="comment_field_type" colspan="1"/>
343                                             <group colspan="2" attrs="{'invisible':[('comment_field_type','!=','char'),('comment_field_type','!=','text')]}">
344                                                 <field colspan="2" name="comment_label" />
345                                             </group>
346                                         </group>
347                                         <group col="6" colspan="4" attrs="{'invisible':[('comment_field_type','!=','char'),('comment_field_type','!=','text')]}">
348                                             <field name="comment_valid_type" colspan="2"/>
349                                             <group colspan="2" attrs="{'invisible':[('comment_valid_type','!=','must_be_specific_length'), ('comment_valid_type','!=','must_be_whole_number')]}">
350                                                 <field name="comment_minimum_no" string="Between"/>
351                                                 <field name="comment_maximum_no" string="and"/>
352                                             </group>
353                                             <group colspan="4" attrs="{'invisible':[('comment_valid_type','!=','must_be_decimal_number')]}">
354                                                 <field name="comment_minimum_float" string="Between"/>
355                                                 <field name="comment_maximum_float" string="and"/>
356                                             </group>
357                                             <group colspan="4" attrs="{'invisible':[('comment_valid_type','!=','must_be_date')]}">
358                                                 <field name="comment_minimum_date" string="Between"/>
359                                                 <field name="comment_maximum_date" string="and"/>
360                                             </group>
361                                             <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')]}">
362                                                 <label string="When the comment is an invalid format, display this error message" colspan="4"/>
363                                                 <field name="comment_valid_err_msg" nolabel="1" colspan="4"/>
364                                             </group>
365                                         </group>
366                                     </group>
367                                 </group>
368                                 <newline/>
369                                 <group attrs="{'invisible':[('type','!=','matrix_of_choices_only_one_ans'),('type','!=','rating_scale')]}">
370                                     <field name="comment_column"/>
371                                     <group colspan="2" attrs="{'invisible':[('comment_column','!=',True)]}">
372                                         <field name="column_name" colspan="2"/>
373                                     </group>
374                                 </group>
375                                 <newline/>
376                                 <group attrs="{'invisible':[('type','!=','single_textbox'), ('type','!=','multiple_textboxes')]}">
377                                     <separator string="Validation" colspan="4"/>
378                                     <group colspan="4">
379                                         <field name="is_validation_require"/>
380                                     </group>
381                                     <group col="6" colspan="4" attrs="{'invisible':[('is_validation_require','=',False)]}">
382                                         <field name="validation_type" colspan="2"/>
383                                         <group colspan="2" attrs="{'invisible':[('validation_type','!=','must_be_specific_length'), ('validation_type','!=','must_be_whole_number')]}">
384                                             <field name="validation_minimum_no" string="Between"/>
385                                             <field name="validation_maximum_no" string="and"/>
386                                         </group>
387                                         <group colspan="4" attrs="{'invisible':[('validation_type','!=','must_be_decimal_number')]}">
388                                             <field name="validation_minimum_float" string="Between"/>
389                                             <field name="validation_maximum_float" string="and"/>
390                                         </group>
391                                         <group colspan="4" attrs="{'invisible':[('validation_type','!=','must_be_date')]}">
392                                             <field name="validation_minimum_date" string="Between"/>
393                                             <field name="validation_maximum_date" string="and"/>
394                                         </group>
395                                     </group>
396                                     <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')]}">
397                                         <label string="When the comment is an invalid format, display this error message" colspan="4"/>
398                                         <field name="validation_valid_err_msg" nolabel="1" colspan="4"/>
399                                     </group>
400                                 </group>
401                                 <newline/>
402                                 <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')]}">
403                                     <separator string="Required Answer" colspan="4"/>
404                                     <newline/>
405                                     <field name="is_require_answer"/>
406                                     <group col="6" colspan="4" attrs="{'invisible':[('is_require_answer','=',False)]}">
407                                         <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')]}">
408                                             <field name="required_type"/>
409                                             <group colspan="2" attrs="{'invisible':[('required_type','!=','at least'),('required_type','!=','at most'),('required_type','!=','exactly')]}">
410                                                 <field name="req_ans" />
411                                             </group>
412                                             <group colspan="4" attrs="{'invisible':[('required_type','!=','a range')]}">
413                                                 <field name="minimum_req_ans"/>
414                                                 <field name="maximum_req_ans"/>
415                                             </group>
416                                         </group>
417                                         <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)]}">
418                                             <label string="When the question is not answered, display this error message:"/>
419                                             <field name="req_error_msg" colspan="4" nolabel="1"/>
420                                         </group>
421                                         <group colspan="4" attrs="{'invisible':[('type','!=','numerical_textboxes')]}">
422                                             <group colspan="2" >
423                                                 <field name="numeric_required_sum"/>
424                                             </group>
425                                             <newline/>
426                                             <label string="When the choices do not add up correctly, display this error message"/>
427                                             <field name="numeric_required_sum_err_msg" colspan="4" nolabel="1"/>
428                                         </group>
429                                         <group colspan="4" attrs="{'invisible':[('type','!=','rating_scale')]}">
430                                             <field name="rating_allow_one_column_require"/>
431                                         </group>
432                                     </group>
433                                 </group>
434                                 <newline/>
435                                 <group attrs="{'invisible':[('type','!=','descriptive_text')]}">
436                                     <separator string="Descriptive Text" colspan="4"/>
437                                     <field name="descriptive_text" colspan="4" nolabel="1"/>
438                                 </group>
439                             </page>
440                         </notebook>
441
442                     </form>
443                     <tree string="Survey Question">
444                         <field name="sequence" string="Seq"/>
445                         <field name="question" colspan="4" select="1"/>
446                         <field name="answer_choice_ids"/>
447                     </tree>
448                     </field>
449                 </form>
450             </field>
451         </record>
452
453
454         <record model="ir.ui.view" id="survey_page_tree">
455             <field name="name">survey_page_tree</field>
456             <field name="model">survey.page</field>
457             <field name="type">tree</field>
458             <field name="arch" type="xml">
459                 <tree string="Survey Page">
460                     <field name="sequence" string="Seq"/>
461                     <field name="title"/>
462                     <field name="survey_id"/>
463                     <field name="question_ids" string="#Questions"/>
464                 </tree>
465             </field>
466         </record>
467
468         <record id="view_survey_page_filter" model="ir.ui.view">
469             <field name="name">survey.page.list.select</field>
470             <field name="model">survey.page</field>
471             <field name="type">search</field>
472             <field name="arch" type="xml">
473                 <search string="Search Survey Page">
474                     <field name="title"/>
475                     <field name="survey_id"/>
476                     <newline/>
477                     <group expand="0" string="Group By...">
478                         <filter string="Survey" icon="terp-stock_align_left_24" domain="[]"  context="{'group_by':'survey_id'}"/>
479                     </group>
480                 </search>
481             </field>
482         </record>
483
484         <record model="ir.actions.act_window" id="action_survey_page_form">
485             <field name="name">Survey Pages</field>
486             <field name="res_model">survey.page</field>
487             <field name="view_type">form</field>
488             <field name="view_mode">tree,form</field>
489             <field name="view_id" ref="survey_page_tree"></field>
490         </record>
491
492         <menuitem name="Survey Pages" id="menu_survey_page_form1"
493             action="action_survey_page_form" parent='menu_define_survey'
494             groups="base.group_tool_manager"/>
495
496         <record model="ir.ui.view" id="survey_page_wizard_test1">
497             <field name="name">survey_page_wizard_test</field>
498             <field name="model">survey.page</field>
499             <field name="type">form</field>
500             <field name="priority">20</field>
501             <field name="arch" type="xml">
502                 <form string="Survey Pages">
503                     <field name="title" colspan="4" select="1"/>
504                     <field name="sequence"/>
505                     <separator string="Description" colspan="4"/>
506                     <field name="note" colspan="4" nolabel="1"/>
507                       <group colspan="4">
508                           <label string="" colspan="3"/>
509                         <button name="survey_save"  string="Ok" type="object" icon="gtk-go-forward"/>
510                     </group>
511                 </form>
512             </field>
513         </record>
514
515         <!--
516             Survey Question
517         -->
518
519         <record model="ir.ui.view" id="survey_question_form">
520             <field name="name">survey_question_form</field>
521             <field name="model">survey.question</field>
522             <field name="type">form</field>
523             <field name="arch" type="xml">
524                 <form string="Survey Question">
525                     <field name="question" colspan="4"/>
526                     <field name="page_id"/>
527                     <field name="sequence"/>
528                     <field name="tot_resp"/>
529                     <field name="type" on_change="on_change_type(type)"/>
530                     <field name="in_visible_rating_weight" invisible="1"/>
531                     <field name="in_visible_menu_choice" invisible="1"/>
532                     <field name="in_visible_answer_type" invisible="1"/>
533                     <notebook colspan="4">
534                         <page string="Options">
535                             <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')]}">
536                               <separator string="Answer" colspan="4"/>
537                                <group colspan="4" attrs="{'invisible':[('type','=','table')]}">
538                                    <field name="answer_choice_ids" nolabel="1" colspan="4" context="{'in_visible_answer_type': in_visible_answer_type}"/>
539                                </group>
540                                <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')]}">
541                                    <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}"/>
542                                     <group colspan="4" attrs="{'invisible':[('type','!=','table')]}">
543                                        <field name="no_of_rows"/>
544                                     </group>
545                                </group>
546                             </group>
547                             <newline/>
548                             <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')]}">
549                                 <separator string="Comment Field" colspan="4"/>
550                                 <group colspan="4">
551                                     <field name="is_comment_require"/>
552                                 </group>
553                                 <group attrs="{'invisible':[('is_comment_require','=',False)]}">
554                                     <group col="4" colspan="4">
555                                         <field name="comment_field_type" colspan="1"/>
556                                         <group colspan="2" attrs="{'invisible':[('comment_field_type','!=','char'),('comment_field_type','!=','text')]}">
557                                             <field colspan="2" name="comment_label" />
558                                         </group>
559                                     </group>
560                                     <group col="6" colspan="4" attrs="{'invisible':[('comment_field_type','!=','char'),('comment_field_type','!=','text')]}">
561                                         <field name="comment_valid_type" colspan="2"/>
562                                         <group colspan="2" attrs="{'invisible':[('comment_valid_type','!=','must_be_specific_length'), ('comment_valid_type','!=','must_be_whole_number')]}">
563                                             <field name="comment_minimum_no" string="Between"/>
564                                             <field name="comment_maximum_no" string="and"/>
565                                         </group>
566                                         <group colspan="4" attrs="{'invisible':[('comment_valid_type','!=','must_be_decimal_number')]}">
567                                             <field name="comment_minimum_float" string="Between"/>
568                                             <field name="comment_maximum_float" string="and"/>
569                                         </group>
570                                         <group colspan="4" attrs="{'invisible':[('comment_valid_type','!=','must_be_date')]}">
571                                             <field name="comment_minimum_date" string="Between"/>
572                                             <field name="comment_maximum_date" string="and"/>
573                                         </group>
574                                         <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')]}">
575                                             <label string="When the comment is an invalid format, display this error message" colspan="4"/>
576                                             <field name="comment_valid_err_msg" nolabel="1" colspan="4"/>
577                                         </group>
578                                     </group>
579                                 </group>
580                             </group>
581                             <newline/>
582                             <group attrs="{'invisible':[('type','!=','matrix_of_choices_only_one_ans'),('type','!=','rating_scale')]}">
583                                 <field name="comment_column"/>
584                                 <group colspan="2" attrs="{'invisible':[('comment_column','!=',True)]}">
585                                     <field name="column_name" colspan="2"/>
586                                 </group>
587                             </group>
588                             <newline/>
589                             <group attrs="{'invisible':[('type','!=','single_textbox'), ('type','!=','multiple_textboxes')]}">
590                                 <separator string="Validation" colspan="4"/>
591                                 <group colspan="4">
592                                     <field name="is_validation_require"/>
593                                 </group>
594                                 <group col="6" colspan="4" attrs="{'invisible':[('is_validation_require','=',False)]}">
595                                     <field name="validation_type" colspan="2"/>
596                                     <group colspan="2" attrs="{'invisible':[('validation_type','!=','must_be_specific_length'), ('validation_type','!=','must_be_whole_number')]}">
597                                         <field name="validation_minimum_no" string="Between"/>
598                                         <field name="validation_maximum_no" string="and"/>
599                                     </group>
600                                     <group colspan="4" attrs="{'invisible':[('validation_type','!=','must_be_decimal_number')]}">
601                                         <field name="validation_minimum_float" string="Between"/>
602                                         <field name="validation_maximum_float" string="and"/>
603                                     </group>
604                                     <group colspan="4" attrs="{'invisible':[('validation_type','!=','must_be_date')]}">
605                                         <field name="validation_minimum_date" string="Between"/>
606                                         <field name="validation_maximum_date" string="and"/>
607                                     </group>
608                                 </group>
609                                 <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')]}">
610                                     <label string="When the comment is an invalid format, display this error message" colspan="4"/>
611                                     <field name="validation_valid_err_msg" nolabel="1" colspan="4"/>
612                                 </group>
613                             </group>
614                             <newline/>
615                             <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')]}">
616                                 <separator string="Required Answer" colspan="4"/>
617                                 <newline/>
618                                 <field name="is_require_answer"/>
619                                 <group col="6" colspan="4" attrs="{'invisible':[('is_require_answer','=',False)]}">
620                                     <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')]}">
621                                         <field name="required_type"/>
622                                         <group colspan="2" attrs="{'invisible':[('required_type','!=','at least'),('required_type','!=','at most'),('required_type','!=','exactly')]}">
623                                             <field name="req_ans" />
624                                         </group>
625                                         <group colspan="4" attrs="{'invisible':[('required_type','!=','a range')]}">
626                                             <field name="minimum_req_ans"/>
627                                             <field name="maximum_req_ans"/>
628                                         </group>
629                                     </group>
630                                     <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)]}">
631                                         <label string="When the question is not answered, display this error message:"/>
632                                         <field name="req_error_msg" colspan="4" nolabel="1"/>
633                                     </group>
634                                     <group colspan="4" attrs="{'invisible':[('type','!=','numerical_textboxes')]}">
635                                         <group colspan="2" >
636                                             <field name="numeric_required_sum"/>
637                                         </group>
638                                         <newline/>
639                                         <label string="When the choices do not add up correctly, display this error message"/>
640                                         <field name="numeric_required_sum_err_msg" colspan="4" nolabel="1"/>
641                                     </group>
642                                     <group colspan="4" attrs="{'invisible':[('type','!=','rating_scale')]}">
643                                         <field name="rating_allow_one_column_require"/>
644                                     </group>
645                                 </group>
646                             </group>
647                             <newline/>
648                             <group attrs="{'invisible':[('type','!=','descriptive_text')]}">
649                                 <separator string="Descriptive Text" colspan="4"/>
650                                 <field name="descriptive_text" colspan="4" nolabel="1"/>
651                             </group>
652                         </page>
653                     </notebook>
654                 </form>
655             </field>
656         </record>
657
658         <record model="ir.ui.view" id="survey_question_tree">
659             <field name="name">survey_question_tree</field>
660             <field name="model">survey.question</field>
661             <field name="type">tree</field>
662             <field name="arch" type="xml">
663                 <tree string="Survey Question">
664                     <field name="sequence" string="Seq"/>
665                     <field name="question"/>
666                     <field name="page_id"/>
667                     <field name="survey"/>
668                     <field name="type"/>
669                 </tree>
670             </field>
671         </record>
672
673        <record id="survey_question_search" model="ir.ui.view">
674             <field name="name">survey_question_search</field>
675             <field name="model">survey.question</field>
676             <field name="type">search</field>
677             <field name="arch" type="xml">
678                 <search string="Search Question">
679                     <field name="question"/>
680                     <field name="page_id"/>
681                     <field name="survey" widget="selection"/>
682                     <field name="type"/>
683                     <newline/>
684                     <group expand="0" string="Group By...">
685                         <filter string="Page" icon="terp-stock_align_left_24" domain="[]"  context="{'group_by':'page_id'}"/>
686                     </group>
687                </search>
688             </field>
689         </record>
690
691         <record model="ir.actions.act_window" id="action_survey_question_form">
692             <field name="name">Survey Questions</field>
693             <field name="res_model">survey.question</field>
694             <field name="view_type">form</field>
695             <field name="view_mode">tree,form</field>
696             <field name="view_id" ref="survey_question_tree"></field>
697              <field name="search_view_id" ref="survey_question_search"/>
698         </record>
699
700         <record model="ir.ui.view" id="survey_question_wizard_test">
701             <field name="name">survey_question_wizard_test</field>
702             <field name="model">survey.question</field>
703             <field name="priority">20</field>
704             <field name="type">form</field>
705             <field name="arch" type="xml">
706                 <form string="Survey Question">
707                     <field name="question" colspan="4"/>
708                     <field name="sequence"/>
709                     <field name="tot_resp"/>
710                     <field name="type" on_change="on_change_type(type)"/>
711                     <field name="in_visible_rating_weight" invisible="1"/>
712                     <field name="in_visible_menu_choice" invisible="1"/>
713                     <field name="in_visible_answer_type" invisible="1"/>
714                     <notebook colspan="4">
715                         <page string="Options">
716                             <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')]}">
717                               <separator string="Answer" colspan="4"/>
718                                <group colspan="4" attrs="{'invisible':[('type','=','table')]}">
719                                    <field name="answer_choice_ids" nolabel="1" colspan="4" context="{'in_visible_answer_type': in_visible_answer_type}"/>
720                                </group>
721                                <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')]}">
722                                    <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}"/>
723                                     <group colspan="4" attrs="{'invisible':[('type','!=','table')]}">
724                                        <field name="no_of_rows"/>
725                                     </group>
726                                </group>
727                             </group>
728                             <newline/>
729                             <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')]}">
730                                 <separator string="Comment Field" colspan="4"/>
731                                 <group colspan="4">
732                                     <field name="is_comment_require"/>
733                                 </group>
734                                 <group attrs="{'invisible':[('is_comment_require','=',False)]}">
735                                     <group col="4" colspan="4">
736                                         <field name="comment_field_type" colspan="1"/>
737                                         <group colspan="2" attrs="{'invisible':[('comment_field_type','!=','char'),('comment_field_type','!=','text')]}">
738                                             <field colspan="2" name="comment_label" />
739                                         </group>
740                                     </group>
741                                     <group col="6" colspan="4" attrs="{'invisible':[('comment_field_type','!=','char'),('comment_field_type','!=','text')]}">
742                                         <field name="comment_valid_type" colspan="2"/>
743                                         <group colspan="2" attrs="{'invisible':[('comment_valid_type','!=','must_be_specific_length'), ('comment_valid_type','!=','must_be_whole_number')]}">
744                                             <field name="comment_minimum_no" string="Between"/>
745                                             <field name="comment_maximum_no" string="and"/>
746                                         </group>
747                                         <group colspan="4" attrs="{'invisible':[('comment_valid_type','!=','must_be_decimal_number')]}">
748                                             <field name="comment_minimum_float" string="Between"/>
749                                             <field name="comment_maximum_float" string="and"/>
750                                         </group>
751                                         <group colspan="4" attrs="{'invisible':[('comment_valid_type','!=','must_be_date')]}">
752                                             <field name="comment_minimum_date" string="Between"/>
753                                             <field name="comment_maximum_date" string="and"/>
754                                         </group>
755                                         <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')]}">
756                                             <label string="When the comment is an invalid format, display this error message" colspan="4"/>
757                                             <field name="comment_valid_err_msg" nolabel="1" colspan="4"/>
758                                         </group>
759                                     </group>
760                                 </group>
761                             </group>
762                             <newline/>
763                             <group attrs="{'invisible':[('type','!=','matrix_of_choices_only_one_ans'),('type','!=','rating_scale')]}">
764                                 <field name="comment_column"/>
765                                 <group colspan="2" attrs="{'invisible':[('comment_column','!=',True)]}">
766                                     <field name="column_name" colspan="2"/>
767                                 </group>
768                             </group>
769                             <newline/>
770                             <group attrs="{'invisible':[('type','!=','single_textbox'), ('type','!=','multiple_textboxes')]}">
771                                 <separator string="Validation" colspan="4"/>
772                                 <group colspan="4">
773                                     <field name="is_validation_require"/>
774                                 </group>
775                                 <group col="6" colspan="4" attrs="{'invisible':[('is_validation_require','=',False)]}">
776                                     <field name="validation_type" colspan="2"/>
777                                     <group colspan="2" attrs="{'invisible':[('validation_type','!=','must_be_specific_length'), ('validation_type','!=','must_be_whole_number')]}">
778                                         <field name="validation_minimum_no" string="Between"/>
779                                         <field name="validation_maximum_no" string="and"/>
780                                     </group>
781                                     <group colspan="4" attrs="{'invisible':[('validation_type','!=','must_be_decimal_number')]}">
782                                         <field name="validation_minimum_float" string="Between"/>
783                                         <field name="validation_maximum_float" string="and"/>
784                                     </group>
785                                     <group colspan="4" attrs="{'invisible':[('validation_type','!=','must_be_date')]}">
786                                         <field name="validation_minimum_date" string="Between"/>
787                                         <field name="validation_maximum_date" string="and"/>
788                                     </group>
789                                 </group>
790                                 <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')]}">
791                                     <label string="When the comment is an invalid format, display this error message" colspan="4"/>
792                                     <field name="validation_valid_err_msg" nolabel="1" colspan="4"/>
793                                 </group>
794                             </group>
795                             <newline/>
796                             <group attrs="{'invisible':[('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_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')]}">
797                                 <separator string="Required Answer" colspan="4"/>
798                                 <newline/>
799                                 <field name="is_require_answer"/>
800                                 <group col="6" colspan="4" attrs="{'invisible':[('is_require_answer','=',False)]}">
801                                     <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')]}">
802                                         <field name="required_type"/>
803                                         <group colspan="2" attrs="{'invisible':[('required_type','!=','at least'),('required_type','!=','at most'),('required_type','!=','exactly')]}">
804                                             <field name="req_ans" />
805                                         </group>
806                                         <group colspan="4" attrs="{'invisible':[('required_type','!=','a range')]}">
807                                             <field name="minimum_req_ans"/>
808                                             <field name="maximum_req_ans"/>
809                                         </group>
810                                     </group>
811                                     <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)]}">
812                                         <label string="When the question is not answered, display this error message:"/>
813                                         <field name="req_error_msg" colspan="4" nolabel="1"/>
814                                     </group>
815                                     <group colspan="4" attrs="{'invisible':[('type','!=','numerical_textboxes')]}">
816                                         <group colspan="2" >
817                                             <field name="numeric_required_sum"/>
818                                         </group>
819                                         <newline/>
820                                         <label string="When the choices do not add up correctly, display this error message"/>
821                                         <field name="numeric_required_sum_err_msg" colspan="4" nolabel="1"/>
822                                     </group>
823                                     <group colspan="4" attrs="{'invisible':[('type','!=','rating_scale')]}">
824                                         <field name="rating_allow_one_column_require"/>
825                                     </group>
826                                 </group>
827                             </group>
828                             <newline/>
829                             <group attrs="{'invisible':[('type','!=','descriptive_text')]}">
830                                 <separator string="Descriptive Text" colspan="4"/>
831                                 <field name="descriptive_text" colspan="4" nolabel="1"/>
832                             </group>
833                         </page>
834                     </notebook>
835                       <group colspan="4">
836                           <label string="" colspan="3"/>
837                         <button name="survey_save"  string="Ok" type="object" icon="gtk-go-forward"/>
838                     </group>
839                 </form>
840             </field>
841         </record>
842
843         <!--
844             Survey Answer
845         -->
846
847         <record model ="ir.ui.view" id="survey_answer_form">
848             <field name="name">survey_answer_form</field>
849             <field name="model">survey.answer</field>
850             <field name="type">form</field>
851             <field name="arch" type="xml">
852                 <form string="Survey Answer">
853                     <field name="answer" colspan="4" select="1"/>
854                     <field name="sequence"/>
855                     <field name="in_visible_answer_type" invisible="1"/>
856                        <group colspan="4" attrs="{'invisible':[('in_visible_answer_type','=',True)]}">
857                         <field name="type" colspan="2"/>
858                         <group colspan="4" attrs="{'invisible':[('type','!=','selection')]}">
859                             <separator string="Menu Choices (each choice on separate by lines)" colspan="4"/>
860                             <field name="menu_choice" colspan="4" nolabel="1"/>
861                         </group>
862                     </group>
863                 </form>
864             </field>
865         </record>
866
867
868         <record model="ir.ui.view" id= "survey_answer_tree">
869             <field name="name">survey_answer_tree</field>
870             <field name="model">survey.answer</field>
871             <field name="type">tree</field>
872             <field name="arch" type="xml">
873                 <tree editable="bottom" string="Survey Answer">
874                     <field name="sequence" string="Seq"/>
875                     <field name="answer" select="1"/>
876                     <field name="type"/>
877                 </tree>
878             </field>
879         </record>
880
881         <!--
882             Survey Response Line
883         -->
884
885         <record model ="ir.ui.view" id= "survey_response_line_form">
886             <field name="name">survey_response_line_form</field>
887             <field name="model">survey.response.line</field>
888             <field name="type">form</field>
889             <field name="arch" type="xml">
890                 <form string="Survey Answer">
891                     <field name="question_id"/>
892                     <field name="date_create" select="1"/>
893                     <notebook colspan="4">
894                         <page string="Answer">
895                             <field name="response_answer_ids" colspan="4" nolabel="1"/>
896                             <group col="5" colspan="4">
897                                 <field name="state"/>
898                             </group>
899                         </page>
900                         <page string="Single Textboxes">
901                             <field name="single_text" colspan="4"/>
902                         </page>
903                         <page string="Comment">
904                             <separator string="Description" colspan="4"/>
905                             <field name="comment" nolabel="1" colspan="4"/>
906                         </page>
907                         <page string="Table Answer">
908                             <field name="response_table_ids" colspan="4" nolabel="1">
909                             <form string="Table">
910                                 <field name="column_id"/>
911                                 <field name="name"/>
912                                 <field name="value"/>
913                             </form>
914                             <tree string="Table">
915                                 <field name="column_id"/>
916                                 <field name="name"/>
917                                 <field name="value"/>
918                             </tree>
919                             </field>
920                         </page>
921                     </notebook>
922                 </form>
923             </field>
924         </record>
925
926         <record model="ir.ui.view" id="survey_response_line_tree">
927             <field name="name">survey_response_line_tree</field>
928             <field name="model">survey.response.line</field>
929             <field name="type">tree</field>
930             <field name="arch" type="xml">
931                 <tree string="Survey Answer Line">
932                     <field name="page_id"/>
933                     <field name="question_id"/>
934                     <field name="date_create" select="1"/>
935                     <field name="state"/>
936                 </tree>
937             </field>
938         </record>
939
940         <!--
941             Survey Response
942         -->
943
944         <record model="ir.ui.view" id="survey_response_form">
945             <field name="name">survey_response_form</field>
946             <field name="model">survey.response</field>
947             <field name="type">form</field>
948             <field name="arch" type="xml">
949                 <form string="Survey Answer">
950                     <field name="survey_id" select="1"/>
951                     <field name="date_create" select="1"/>
952                     <field name="user_id" select="1"/>
953                     <field name="response_type" select="1"/>
954                     <field name="question_ids" nolabel="1" colspan="4" />
955                     <field name="state" select="1"/>
956                 </form>
957             </field>
958         </record>
959
960         <record model="ir.ui.view" id="survey_response_tree">
961             <field name="name">survey_response_tree</field>
962             <field name="model">survey.response</field>
963             <field name="type">tree</field>
964             <field name="arch" type="xml">
965                 <tree string="Survey Answer">
966                     <field name="survey_id" select="1"/>
967                     <field name="date_create" select="1"/>
968                     <field name="user_id" select="1"/>
969                     <field name="response_type" select="1"/>
970                     <field name="state" select="1"/>
971                 </tree>
972             </field>
973         </record>
974
975         <!--
976             Survey Response Answer
977         -->
978
979         <record model="ir.ui.view" id="survey_response_answer_form">
980             <field name="name">survey_response_answer_form</field>
981             <field name="model">survey.response.answer</field>
982             <field name="type">form</field>
983             <field name="arch" type="xml">
984                 <form string="Survey Answer">
985                     <group colspan="4">
986                         <field name="answer_id"/>
987                         <field name="answer" />
988                     </group>
989                     <field name="value_choice"/>
990                     <label string="(Use Only Question Type is matrix_of_drop_down_menus)" align="0.0"/>
991                     <group colspan="4" col="4">
992                         <field name="comment_field"/>
993                         <field name="column_id"/>
994                     </group>
995                 </form>
996             </field>
997         </record>
998
999         <record model="ir.ui.view" id="survey_response_answer_tree">
1000             <field name="name">survey_response_answer_tree</field>
1001             <field name="model">survey.response.answer</field>
1002             <field name="type">tree</field>
1003             <field name="arch" type="xml">
1004                 <tree editable="top" string="Survey Answer">
1005                     <field name="answer_id"/>
1006                     <field name="answer" />
1007                     <field name="value_choice" />
1008                     <field name="column_id"/>
1009                     <field name="comment_field"/>
1010                 </tree>
1011             </field>
1012         </record>
1013
1014         <!--
1015             Survey Question Column Heading
1016     -->
1017
1018         <record model="ir.ui.view" id="survey_question_column_heading_form">
1019             <field name="name">survey_question_column_heading_form</field>
1020             <field name="model">survey.question.column.heading</field>
1021             <field name="type">form</field>
1022             <field name="arch" type="xml">
1023                 <form string="Column Heading">
1024                     <field name="title"/>
1025                     <field name="in_visible_rating_weight" invisible="1"/>
1026                     <field name="in_visible_menu_choice" invisible="1"/>
1027                     <group colspan="4" attrs="{'invisible':[('in_visible_rating_weight','!=',False)]}">
1028                         <field name="rating_weight"/>
1029                         <label align="0.0" string="Use if question type is rating_scale" />
1030                     </group>
1031                     <group colspan="4" attrs="{'invisible':[('in_visible_menu_choice','!=',False)]}">
1032                         <separator string="Menu Choices (each choice on separate lines)" colspan="4"/>
1033                         <field name="menu_choice" nolabel="1" colspan="4"/>
1034                     </group>
1035                 </form>
1036             </field>
1037         </record>
1038
1039         <record model="ir.ui.view" id="survey_question_column_heading_tree">
1040             <field name="name">survey_question_column_heading_tree</field>
1041             <field name="model">survey.question.column.heading</field>
1042             <field name="type">tree</field>
1043             <field name="arch" type="xml">
1044                 <tree editable="bottom" string="Column Heading">
1045                     <field name="title"/>
1046                 </tree>
1047             </field>
1048         </record>
1049
1050         <!--
1051             Survey Request
1052         -->
1053
1054         <record model="ir.ui.view" id="survey_request_form">
1055             <field name="name">survey_request_form</field>
1056             <field name="model">survey.request</field>
1057             <field name="type">form</field>
1058             <field name="arch" type="xml">
1059                 <form version="7.0">
1060                 <header>
1061                     <button name="survey_req_draft" string="Set to Draft" states="cancel,done" type="object"/>
1062                     <button name="survey_req_waiting_answer" string="Waiting Answer" states="draft" type="object"/>
1063                     <button name="survey_req_done" string="Done" states="waiting_answer" type="object"/>
1064                     <button name="survey_req_cancel" string="Cancel" states="waiting_answer" type="object"/>
1065                     <field name="state" widget="statusbar" statusbar_visible="draft,waiting_answer"/>
1066                 </header>
1067                 <sheet string="Survey Request" layout="auto">
1068                     <group class="oe_form_header">
1069                     <field name="date_deadline"/>
1070                     <field name="survey_id"/>
1071                     <field name="user_id" on_change="on_change_user(user_id)"/>
1072                      <field name="response" readonly="1"/>
1073                     </group>
1074                     </sheet>
1075                 </form>
1076             </field>
1077         </record>
1078
1079         <record model="ir.ui.view" id="survey_request_tree">
1080             <field name="name">survey_request_tree</field>
1081             <field name="model">survey.request</field>
1082             <field name="type">tree</field>
1083             <field name="arch" type="xml">
1084                 <tree string="Evaluation Plan Phase" colors="red:date_deadline&lt;current_date">
1085                     <field name="date_deadline"/>
1086                     <field name="user_id"/>
1087                     <field name="survey_id"/>
1088                     <field name="response" />
1089                     <field name="state" />
1090                 </tree>
1091             </field>
1092         </record>
1093
1094        <record id="survey_request_search" model="ir.ui.view">
1095             <field name="name">survey_request_search</field>
1096             <field name="model">survey.request</field>
1097             <field name="type">search</field>
1098             <field name="arch" type="xml">
1099                 <search string="Search Survey">
1100                    <group>
1101                         <filter icon="terp-gtk-media-pause" string="Waiting Answer" domain="[('state','=','waiting_answer')]"/>
1102                         <filter icon="terp-emblem-important" string="Late" domain="[('date_deadline','&lt;',current_date)]"/>
1103                         <separator orientation="vertical"/>
1104                         <field name="survey_id" widget="selection"/>
1105                         <field name="email"/>
1106                         <field name="user_id">
1107                         <filter string="MY" icon="terp-personal" domain="[('user_id','=',uid)]"/>
1108                         </field>
1109                     </group>
1110                     <newline/>
1111                     <group expand="0" string="Group By...">
1112                         <filter string="User" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
1113                         <separator orientation="vertical"/>
1114                         <filter string="Survey" icon="terp-stock_align_left_24" domain="[]"  context="{'group_by':'survey_id'}"/>
1115                         <separator orientation="vertical"/>
1116                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]"  context="{'group_by':'state'}"/>
1117                     </group>
1118                </search>
1119             </field>
1120         </record>
1121
1122         <record model="ir.actions.act_window" id="action_survey_request_tree">
1123             <field name="name">Survey Requests</field>
1124             <field name="res_model">survey.request</field>
1125             <field name="view_type">form</field>
1126             <field name="view_mode">tree,form</field>
1127             <field name="domain">[('user_id','=',uid)]</field>
1128             <field name="view_id" ref="survey_request_tree"></field>
1129             <field name="search_view_id" ref="survey_request_search"/>
1130         </record>
1131
1132         <menuitem name="Survey Requests" id="menu_survey_type_form1"
1133             action="action_survey_request_tree" parent='menu_answer_surveys'
1134             groups="base.group_tool_manager"/>
1135
1136         <!--
1137             Survey Type
1138         -->
1139
1140         <record model="ir.ui.view" id="survey_type_form">
1141             <field name="name">survey_type_form</field>
1142             <field name="model">survey.type</field>
1143             <field name="type">form</field>
1144             <field name="arch" type="xml">
1145                 <form string="Survey Type">
1146                     <field name="name" select="1"/>
1147                     <field name="code" select="1"/>
1148                 </form>
1149             </field>
1150         </record>
1151
1152         <record model="ir.ui.view" id="survey_type_tree">
1153             <field name="name">survey_type_tree</field>
1154             <field name="model">survey.type</field>
1155             <field name="type">tree</field>
1156             <field name="arch" type="xml">
1157                 <tree string="Survey Type">
1158                     <field name="name" select="1"/>
1159                     <field name="code" select="1"/>
1160                 </tree>
1161             </field>
1162         </record>
1163
1164         <record model="ir.actions.act_window" id="action_survey_type_form">
1165             <field name="name">Survey Type</field>
1166             <field name="res_model">survey.type</field>
1167             <field name="view_type">form</field>
1168             <field name="view_mode">tree,form</field>
1169             <field name="view_id" ref="survey_type_tree"></field>
1170         </record>
1171
1172         <act_window
1173             context="{'search_default_survey_id': [active_id], 'default_survey_id': active_id}"
1174             id="act_survey_pages"
1175             name="Pages"
1176             res_model="survey.page"
1177             src_model="survey"/>
1178
1179         <act_window
1180             context="{'search_default_survey': active_id, 'default_survey': active_id}"
1181             id="act_survey_question"
1182             name="Questions"
1183             res_model="survey.question"
1184             src_model="survey"/>
1185
1186
1187         <act_window
1188             context="{'search_default_page_id': active_id, 'default_page_id': active_id}"
1189             id="act_survey_page_question"
1190             name="Questions"
1191             res_model="survey.question"
1192             src_model="survey.page"/>
1193
1194         <act_window domain="[('question_id', '=', active_id)]"
1195             id="act_survey_answer"
1196             name="Answers"
1197             res_model="survey.answer"
1198             src_model="survey.question"/>
1199
1200         <menuitem name="Answer a Survey" id="menu_run_survey_form" sequence="2"
1201             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"/>
1202
1203     </data>
1204 </openerp>