Author: |
IT Projects Labs, Ivan Yelizariev |
License: |
Other OSI approved licence |
Branch: |
14.0 |
Repository: |
trojikman/sync-addons |
Dependencies: |
base,
base_automation,
http_routing,
mail,
and
queue_job |
Languages: |
HTML (101, 2.1%),
Python (2022, 41.4%),
XML (2134, 43.7%),
and
reStructuredText (630, 12.9%) |
Other branches: |
11.0,
11.0-sync-port,
11.0-sync-transfer-major-update,
12.0,
12.0-openapi-cors-with-swagger,
12.0-sync-no-imports-2,
12.0-sync-no-imports-2-test,
12.0-sync_woo,
13.0,
13.0-sync-port,
14.0-sync-clear-links,
14.0-sync-fix-test,
14.0-sync-test-remove-record,
14.0-sync_facebook,
14.0-sync_telegram-channel-settings,
and
14.0-sync_twindis |
Other repositories: |
SeuMarco/sync-addons,
brain-tec/sync-addons,
em230418/sync-addons,
itpp-labs/sync-addons,
and
yelizariev/sync-addons |
<a class="reference external image-reference" href="https://itpp.dev"><img alt="Tested and maintained by IT Projects Labs" src="https://itpp.dev/images/infinity-readme.png" /></a>
<a class="reference external image-reference" href="https://opensource.org/licenses/MIT"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-blue.svg">
</a>
<a name="sync-studio"></a>
<h2>Sync Studio</h2>
<p>Synchronize anything with anything:</p>
<ul class="simple">
<li>System X ↔ Odoo</li>
<li>Odoo 1 ↔ Odoo 2</li>
<li>System X ↔ System Y</li>
</ul>
<p>Provides a single place to handle synchronization trigered by one of the following events:</p>
<ul class="simple">
<li><strong>Cron</strong> -- provided by <code>ir.cron</code></li>
<li><strong>DB Event</strong> -- provided by <code>base.automation</code></li>
<li><strong>Incoming webhook</strong> -- modified version of <code>/website/action</code> controller from <code>website</code> module</li>
<li><strong>Manual Triggering</strong> -- provided by <code>ir.actions.server</code>. User needs to click a button to run this action</li>
</ul>
<p>Difference with built-in code evaluation:</p>
<ul class="simple">
<li>Allows to use json format for incomming webhooks</li>
<li>Provides helpers for resource linking. See <em>Links</em> section in <a class="reference external" href="doc/index.rst">doc/index.rst</a></li>
<li>Uses queue_job module as a job broker</li>
<li>Asynchronous calls to split big task into few small ones</li>
<li>Allows repeat job on temporary fails (e.g. when external API is not available)</li>
</ul>
<a name="roadmap"></a>
<h3>Roadmap</h3>
<ul class="simple">
<li>Code widget: show line numbers</li>
<li>Webhooks: add a possibility to retry failed webhook (e.g. to debug code)</li>
<li>Webhooks: during the migration rename <cite>website</cite> appearances in links to <cite>sync</cite>. We decided not to do this in the stable branch to not break existing integrations</li>
</ul>
<a name="developer-hints"></a>
<h3 class="with-subtitle">Developer Hints</h3>
<h3 class="section-subtitle" id="public-webhook-address"><span class="section-subtitle">Public webhook address</span></h3>
<p>If you run Odoo locally and need to test webhook, your Odoo server should be available via public URL. You can either use specialized services like <a class="reference external" href="https://ngrok.com/">https://ngrok.com/</a> or make proxing via ssh tunneling as described in the next section. Once it's done set corresponding <code>https://...</code> value for <code>web.base.url</code> parameter (menu <code>[[ Settings ]] >> System Parameters</code>). Also, you should set any value to <a class="reference external" href="https://odoo-source.com/?q=web.base.url.freeze&i=nope&files=&excludeFiles=po%24%7Cpot%24%7Cyml%24%7Cyaml%24%7Ccss%24%7C%2Fstatic%2Flib%2F&repos=odoo">web.base.url.freeze</a> to avoid automatic change of <code>web.base.url</code>.</p>
<a name="ssh-tunneling"></a>
<h4>SSH tunneling</h4>
<ul>
<li><p class="first">Connect your server:</p>
<ul>
<li><p class="first">Edit file <code>/etc/ssh/sshd_config</code>:</p>
<ul class="simple">
<li>Find <code>GatewayPorts</code> attribute and set value to <code>yes</code></li>
</ul>
</li>
<li><p class="first">Restart ssh daemon:</p>
<pre>
<code>service ssh restart</code>
</pre>
</li>
</ul>
</li>
<li><p class="first">Connect to your server with <code>-R</code> attribute:</p>
<pre>
<code>ssh user@yourserver.example -R 0.0.0.0:8069:localhost:8069</code>
</pre>
</li>
</ul>
<p>Now you can use <code>http://yourserver.example:8069</code> as a value for <code>web.base.url</code> in Odoo.</p>
<p>Few more steps requires to use https connection (e.g. telegram api works with https only). In your server do as following:</p>
<ul>
<li><p class="first">Install nginx in your server</p>
</li>
<li><p class="first">Add nginx config:</p>
<pre>
<code>server {
listen 80;
server_name yourserver.example;
location / {
proxy_set_header Host $host;
proxy_pass http://localhost:8069;
}
}</code>
</pre>
</li>
<li><p class="first">Install <a class="reference external" href="https://certbot.eff.org/lets-encrypt/ubuntuxenial-nginx.html">certbot</a></p>
</li>
<li><p class="first">Run</p>
<pre>
<code>sudo certbot --nginx</code>
</pre>
</li>
<li><p class="first">Done!</p>
</li>
</ul>
<a name="questions"></a>
<h3>Questions?</h3>
<p>To get an assistance on this module contact us by email :arrow_right: <a class="reference external" href="mailto:help@itpp.dev">help@itpp.dev</a></p>
<a name="contributors"></a>
<h3>Contributors</h3>
<ul>
<li><p class="first"><a class="reference external" href="https://twitter.com/yelizariev">Ivan Yelizariev</a>:</p>
<blockquote>
<ul class="simple">
<li><table class="first docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">one::two:</th><td class="field-body">init version of the module</td>
</tr>
</tbody>
</table>
</li>
<li><table class="first docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">one::two:</th><td class="field-body">redesign module to prevent odoo container escapes</td>
</tr>
</tbody>
</table>
</li>
</ul>
</blockquote>
</li>
</ul>
<a name="further-information"></a>
<h3>Further information</h3>
<p>Odoo Apps Store: <a class="reference external" href="https://apps.odoo.com/apps/modules/14.0/sync/">https://apps.odoo.com/apps/modules/14.0/sync/</a></p>
<p>Notifications on updates: <a class="reference external" href="https://github.com/itpp-labs/sync-addons/commits/14.0/sync.atom">via Atom</a>, <a class="reference external" href="https://blogtrottr.com/?subscribe=https://github.com/itpp-labs/sync-addons/commits/14.0/sync.atom">by Email</a></p>
<p>Tested on <a class="reference external" href="https://github.com/odoo/odoo/commit/6916981f56783de7008cd04d4e37e80166150ff7">Odoo 14.0</a></p>