78 lines
3.7 KiB
XML
78 lines
3.7 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<openerp>
|
|
<data>
|
|
|
|
<!-- add google docs config field in user form -->
|
|
|
|
<record model="ir.ui.view" id="view_google_docs_config_tree">
|
|
<field name="name">google_docs.config.tree</field>
|
|
<field name="model">google.docs.config</field>
|
|
<field name="arch" type="xml">
|
|
<tree string="Google Drive Configuration">
|
|
<field name="model_id"/>
|
|
<field name="name_template"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
|
|
<record model="ir.ui.view" id="view_google_docs_config_form">
|
|
<field name="name">google_docs.config.form</field>
|
|
<field name="model">google.docs.config</field>
|
|
<field name="arch" type="xml">
|
|
<form string="Google Drive Configuration" version="7.0">
|
|
<group>
|
|
<field name="model_id" on_change="onchange_model_id(model_id)"/>
|
|
<label for='filter_id'/>
|
|
<div>
|
|
<field name='filter_id'/>
|
|
<p class="oe_grey">
|
|
To Create a new filter, go to the list of documents you want to attach a google document to and
|
|
save the filter.Then come back ti this view.The saved filter will be available in the filed above.
|
|
For instance,to attach a document to the sales orders of Agrolait,you go to sales orders list view,
|
|
filter on Agrolait and save the filter.
|
|
</p>
|
|
</div>
|
|
<field name='template_url' placeholder="https://docs.google.com/document/d/1vOtpJK9scIQz6taD9tJRIETWbEw3fSiaQHArsJYcua4/edit"/>
|
|
<label for='name_template'/>
|
|
<div>
|
|
<field name='name_template'/>
|
|
<p class="oe_grey">
|
|
The name of the attached document can use fixed or variable data. To distinguish between documents in
|
|
Google Drive,use fixed words and fields.For instance,in the example above,if you wrote Agrolait_%%(name)s_Sales
|
|
in the Google Drive name field,the document in your Google Drive and in OpenERP attachment will be named
|
|
'Agrolait_SO0001_Sales'.
|
|
</p>
|
|
</div>
|
|
</group>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<record model='ir.actions.act_window' id='action_google_docs_users_config'>
|
|
<field name='name'>Models configuration</field>
|
|
<field name='res_model'>google.docs.config</field>
|
|
<field name='type'>ir.actions.act_window</field>
|
|
<field name='view_type'>form</field>
|
|
<field name='view_id' ref='view_google_docs_config_tree'/>
|
|
</record>
|
|
|
|
<record id="inherited_google_view_general_configuration" model="ir.ui.view">
|
|
<field name="name">General Settings</field>
|
|
<field name="model">base.config.settings</field>
|
|
<field name="inherit_id" ref="base_setup.view_general_configuration"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//div[@name='google_docs']" position="after">
|
|
<div attrs="{'invisible': [('module_google_docs','=',False)]}">
|
|
<button type="action"
|
|
name="%(google_docs.action_google_docs_users_config)d"
|
|
string="Configure Template" class="oe_link"/>
|
|
</div>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<menuitem name='Google Drive configuration' id='menu_gdocs_config' parent='base.menu_administration'/>
|
|
<menuitem name='Models configuration' id='menu_gdocs_model_config' parent='menu_gdocs_config' action='action_google_docs_users_config'/>
|
|
</data>
|
|
</openerp>
|