2b1f1c1730a1d05f3654d11659fc5fa79f85f2a0
[odoo/odoo.git] / addons / google_docs / res_config_user_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4
5         <!-- add google docs config field in user form -->
6
7         <record model="ir.ui.view" id="view_google_docs_config_tree">
8             <field name="name">google_docs.config.tree</field>
9             <field name="model">google.docs.config</field>
10             <field name="arch" type="xml">
11                 <tree string="Google Drive Configuration">
12                     <field name="model_id"/>
13                     <field name="name_template"/>
14                 </tree>
15             </field>
16         </record>
17
18         <record model="ir.ui.view" id="view_google_docs_config_form">
19             <field name="name">google_docs.config.form</field>
20             <field name="model">google.docs.config</field>
21             <field name="arch" type="xml">
22                 <form string="Google Drive Configuration" version="7.0">
23                 <group>
24                         <field name="name"/>
25                     <field name="model_id" on_change="onchange_model_id(model_id)"/>
26                     <label for='filter_id'/>
27                     <div>
28                         <field name='filter_id'/>
29                         <p class="oe_grey">
30                                         To Create a new filter, go to the list of documents you want to attach a google document to and 
31                                         save the filter.Then come back ti this view.The saved filter will be available in the filed above.
32                                         For instance,to attach a document to the sales orders of Agrolait,you go to sales orders list view,
33                                         filter on Agrolait and save the filter.
34                         </p>
35                     </div>
36                     <field name='gdocs_template_url' placeholder="https://docs.google.com/document/d/1vOtpJK9scIQz6taD9tJRIETWbEw3fSiaQHArsJYcua4/edit" required="1"/>
37                     <field name='gdocs_resource_id' invisible="1"/>
38                     <label for='name_template'/>
39                     <div>
40                         <field name='name_template'/>
41                         <p class="oe_grey">
42                                 The name of the attached document can use fixed or variable data. To distinguish between documents in
43                                         Google Drive,use fixed words and fields.For instance,in the example above,if you wrote Agrolait_%%(name)s_Sales
44                                         in the Google Drive name field,the document in your Google Drive and in OpenERP attachment will be named
45                                         'Agrolait_SO0001_Sales'.
46                         </p>
47                     </div>
48                 </group>
49                 </form>
50             </field>
51         </record>
52
53         <record model='ir.actions.act_window' id='action_google_docs_users_config'>
54             <field name='name'>Models configuration</field>
55             <field name='res_model'>google.docs.config</field>
56             <field name='type'>ir.actions.act_window</field>
57             <field name='view_type'>form</field>
58             <field name='view_id' ref='view_google_docs_config_tree'/>
59             <field name="help" type="html">
60               <p>
61                "Link your first Google document to openERP documents
62                 You use to control the quality of your product in a spreadheet ?
63                 You review the delivery checklist for each delivery order in a  foreign country ? ...
64                 Link your own templates on any documents of OpenERP
65               </p>
66             </field>
67         </record>
68
69         <record id="inherited_google_view_general_configuration" model="ir.ui.view">
70         <field name="name">General Settings</field>
71         <field name="model">base.config.settings</field>
72         <field name="inherit_id" ref="base_setup.view_general_configuration"/>
73         <field name="arch" type="xml">
74           <xpath expr="//div[@name='google_docs']" position="after">
75             <div attrs="{'invisible': [('module_google_docs','=',False)]}">
76                 <button type="action"
77                 name="%(google_docs.action_google_docs_users_config)d"
78                 string="Configure Template" class="oe_link"/>
79             </div>
80           </xpath>
81         </field>
82     </record>
83
84         <menuitem name='Google Drive configuration' id='menu_gdocs_config' parent='base.menu_administration'/>
85         <menuitem name='Models configuration' id='menu_gdocs_model_config' parent='menu_gdocs_config' action='action_google_docs_users_config'/>
86     </data>
87 </openerp>