90 lines
4.3 KiB
XML
90 lines
4.3 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="name"/>
|
|
<field name="model_id"/>
|
|
</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="name"/>
|
|
<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 to this view. The saved filter will be available in the field above.
|
|
For instance, to attach a document to the sales orders of Agrolait, go to sale orders list view,
|
|
filter on Agrolait and save the filter.
|
|
</p>
|
|
</div>
|
|
<field name='gdocs_template_url' placeholder="https://docs.google.com/document/d/1vOtpJK9scIQz6taD9tJRIETWbEw3fSiaQHArsJYcua4/edit" required="1"/>
|
|
<field name='gdocs_resource_id' invisible="1"/>
|
|
<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'>Google Drive Templates</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'/>
|
|
<field name="help" type="html">
|
|
<p class="oe_view_nocontent_create">
|
|
Click to add a new template.
|
|
</p><p>
|
|
Link your first Google document to OpenERP documents.
|
|
You can use it to control the quality of your product in a spreadsheet or
|
|
review the delivery checklist for each delivery order in a foreign country
|
|
and in many more ways. Link your own templates on any documents of OpenERP.
|
|
</p>
|
|
</field>
|
|
</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 id='menu_gdocs_model_config' parent='menu_gdocs_config' action='action_google_docs_users_config'/>
|
|
</data>
|
|
</openerp>
|