Author: |
Vertel AB |
License: |
AGPL-3 |
Branch: |
master |
Repository: |
abdo3247/odoo-export-xml |
Dependencies: |
web |
Languages: |
JavaScript (87, 32.2%),
Python (123, 45.6%),
XML (22, 8.1%),
and
reStructuredText (38, 14.1%) |
Other repositories: |
AyoubZahid/odoo-export-xml,
Lioncode/odoo-export-xml,
OdooBulgaria/odoo-export-xml,
amon-ra/odoo-export-xml,
aschenkels-ictstudio/odoo-export-xml,
edsersolis/odoo-export-xml,
initOS/server-tools,
kossovo/odoo-export-xml,
odoousers2014/odoo-export-xml,
patok/odoo-export-xml,
rkhalil1990/odoo-export-xml,
sjpatel21/odoo-export-xml,
vertelab/odoo-export-xml,
and
yustas147/odoo-export-xml |
<img alt="License" src="https://img.shields.io/badge/licence-AGPL--3-blue.svg">
<a name="export-current-model-as-xml"></a>
<h2>Export Current Model as XML</h2>
<p>One of the best Odoo's features is exporting custom data as CSV. That
feature is as great and advanced as limited for an everyday experience.
A lot of users want simply to export the tree view they are looking to
without bother what related records there are and what fields you need.</p>
<p>Exporting to XML are much easier as long as yout target system handles this
format. This export creates XML-records the pointed records and for all related
records. The method tries to use external identifiers and when its missing it
creates new ones.</p>
<a name="usage"></a>
<h2>Usage</h2>
<p>1) /model/<model-id>/<record_id>/xml
# <a class="reference external" href="http://stage.smart-eu.org/model/93/6/xml">http://stage.smart-eu.org/model/93/6/xml</a> = exports all res.users id=6
2) /model/<model-id>/all/xml
# <a class="reference external" href="http://stage.smart-eu.org/model/93/all/xml">http://stage.smart-eu.org/model/93/all/xml</a> = exports all res.users</p>
<p># Example
# se_demo05 res.user id=93</p>
<p>You can find the model id in settings/database structure/models (technical settings)
and the record id for each instance of a model using the tree-view.</p>
<p>Many2many fields are not correctly exported yet.</p>
<p>not yet:
After you installed it, you'll find an additional link 'Export current Model'
right below the 'Export' one. By clicking on it you'll get a XML file contains
the same data of the Model you are looking at.</p>
<a name="the-methods"></a>
<h2>The methods</h2>
<p>This module consists of two methods/functions.</p>
<p>export_xml([records]) # returns each record with all fields for that model as an xml-record
get_related([records]) # returns all related records for the list of records recursively</p>
<dl class="docutils">
<dt>example:</dt>
<dd>document = etree.tostring(export_xml(get_related(request.registry[model.model].browse(request.cr,request.uid,records),0)),pretty_print=True,encoding="utf-8")</dd>
</dl>
<a name="credits"></a>
<h2>Credits</h2>
<p>Vertel AB</p>
<a name="contributors"></a>
<h3>Contributors</h3>
<blockquote>
<ul class="simple">
<li>Anders Wallenquist <<a class="reference external" href="mailto:anders.wallenquist@vertel.se">anders.wallenquist@vertel.se</a>></li>
</ul>
</blockquote>