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