Search 1.9 billion lines of Odoo code on GitHub

base_external_import

Author: Jesus Ramiro, Liu Jianyun, Daniel Reis, Odoo Community Association (OCA)
License: no license
Branch: 10.0
Repository: Dgaroc/server-tools
Dependencies: base, and base_external_dbsource
Languages: HTML (76, 13.6%), Python (244, 43.8%), XML (173, 31.1%), and reStructuredText (64, 11.5%)
Other repositories: huntergps/server-tools, lnkdel/server-tools, and mysticalis/server-tools

<a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.svg"> </a> <a name="import-data-from-external-data-sources"></a> <h2>Import data from external data sources.</h2> <p>This module allows import data directly from other databases.</p> <a name="usage"></a> <h3>Usage</h3> <p>Installed in the Administration module, menu Settings -&gt; Technical -&gt; Database Structure -&gt; External Import Task.</p> <dl class="docutils"> <dt>Features:</dt> <dd><ul class="first last simple"> <li>Fetched data from the databases are used to build lines equivalent to regular import files. These are imported using the standard &quot;load()&quot; ORM method, same as regular import function, benefiting from all its features, including xml_ids.</li> <li>Each table import is defined by an SQL statement, used to build the equivalent for an import file. Each column's name should match the column names you would use in an import file. No column can called &quot;id&quot; and The first column must provide an unique identifier for the record, and will be used to build its xml_id.</li> <li>Allow to import many2one fields, same as regular import module.</li> <li>The last sync date is the last successfully execution can be used in the SQL using &quot;?&quot;.</li> <li>When errors are found, only the record with the error fails import. The other correct records are committed. However, the &quot;last sync date&quot; will only be automatically updated when no errors are found.</li> <li>The import execution can be scheduled to run automatically.</li> </ul> </dd> <dt>Examples:</dt> <dd><ul class="first last"> <li><dl class="first docutils"> <dt>Importing suppliers to res.partner:</dt> <dd><pre class="first last"> <code class="first last">SELECT distinct[SUPPLIER_CODE] as &quot;ref&quot;, [SUPPLIER_NAME] as &quot;name&quot;, 'True' as &quot;is_supplier&quot;, [INFO] as &quot;comment&quot; FROM T_SUPPLIERS WHERE INACTIVE_DATE IS NULL and DATE_CHANGED &gt;= CAST(? as datetime)</code> </pre> </dd> </dl> </li> <li><dl class="first docutils"> <dt>Importing products to product.template:</dt> <dd><pre class="first last"> <code class="first last">SELECT Product_Code as &quot;default_code&quot;, Descripc as &quot;name&quot;, active, type, sale_ok, purchase_ok, list_price, standard_price, description_sale, 'res_partner_id_' + SUPPLIER_ID as &quot;seller_ids/name/id&quot; FROM _Products WHERE DATE_CHANGED &gt;= CAST(? as datetime)</code> </pre> </dd> </dl> </li> </ul> </dd> </dl> <a name="credits"></a> <h3>Credits</h3> <a name="contributors"></a> <h4>Contributors</h4> <ul class="simple"> <li>Jesus Ramiro &lt;<a class="reference external" href="mailto:jesus&#64;bilbonet.net">jesus&#64;bilbonet.net</a>&gt;</li> <li>Liu Jianyun &lt;<a class="reference external" href="mailto:lnkdel&#64;gmail.com">lnkdel&#64;gmail.com</a>&gt;</li> <li>Maxime Chambreuil &lt;<a class="reference external" href="mailto:maxime.chambreuil&#64;savoirfairelinux.com">maxime.chambreuil&#64;savoirfairelinux.com</a>&gt;</li> <li>Daniel Reis, Odoo Community Association (OCA)</li> </ul> <a name="maintainer"></a> <h4>Maintainer</h4> <a class="reference external image-reference" href="http://odoo-community.org"><img alt="Odoo Community Association" src="http://odoo-community.org/logo.png" /></a> <p>This module is maintained by the OCA.</p> <p>OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.</p> <p>To contribute to this module, please visit <a class="reference external" href="http://odoo-community.org">http://odoo-community.org</a>.</p>