Search 1.9 billion lines of Odoo code on GitHub

web_syncer

Author: Odoo Community Association (OCA), Modoolar
License: LGPL-3
Branch: 12.0
Repository: MathBenTech/scrummer
Dependencies: bus, and web
Languages: JavaScript (61, 11.6%), Python (435, 82.9%), XML (8, 1.5%), and reStructuredText (21, 4.0%)
Other branches: 11.0, 12.0_dev, 12.0_dev_simplify_scrummer_view, and 12.0_dev_track
Other repositories: HelloXMFJ/web, Idealisconsulting/scrummer, TeclibERP/scrummer, VbossEkat/scrummer, darshan-odoo/scrummer, dsasoftware/scrummer, galeote/scrummer, igor-mitin/scrummer, isoscl/scrummer, mgielissen/scrummer, modoolar/oca-project-agile, and sc4you/scrummer

<a class="reference external image-reference" href="https://www.gnu.org/licenses/lgpl-3.0.en.html"><img alt="License: LGPL-v3" src="https://www.gnu.org/graphics/lgplv3-147x51.png" /></a> <a name="web-syncer"></a> <h2>Web Syncer</h2> <p>This module provides generic interface to receive CUD model notifications on web client side.</p> <a name="usage"></a> <h3>Usage</h3> <p>To use this module functionality you need to:</p> <ul class="simple"> <li>Inherit <code>web.syncer</code> model at the backend side</li> </ul> <pre> <code lang="python">class Task(models.Model): _name = 'project.task' _inherit = ['web.syncer', 'project.task']</code> </pre> <ul class="simple"> <li>Instantiate web.syncer and subscribe to the notifications for your model</li> </ul> <pre> <code lang="javascript">const Syncer = require('web.syncer').Syncer; var sync = new Syncer(); sync.subscribe(odoo.session_info.db + &quot;:&quot; + &quot;project.task&quot;, notification =&gt; { let id = notification[0][2]; let payload = notification[1]; switch (notification[1].method) { case &quot;write&quot;: // Handle record update this.recordUpdated(id, payload.data, payload); break; case &quot;create&quot;: // Handle created record this.recordCreated(id, payload.data, payload); break; case &quot;unlink&quot;: // Handle removed record let task = this.records.get(id); if (task) { this.records.delete(id); payload.data = task; this.recordDeleted(id, payload); } break; } });</code> </pre> <a name="credits"></a> <h3>Credits</h3> <a name="contributors"></a> <h4>Contributors</h4> <ul class="simple"> <li>Aleksandar Gajić &lt;<a class="reference external" href="mailto:aleksandar.gajic&#64;modoolar.com">aleksandar.gajic&#64;modoolar.com</a>&gt;</li> </ul> <a name="maintainer"></a> <h4>Maintainer</h4> <a class="reference external image-reference" href="https://modoolar.com"><img alt="Modoolar" src="https://www.modoolar.com/web/image/ir.attachment/3461/datas" /></a> <p>This module is maintained by Modoolar.</p> <pre> <code>As Odoo Gold partner, our company is specialized in Odoo ERP customization and business solutions development. Beside that, we build cool apps on top of Odoo platform.</code> </pre> <p>To contribute to this module, please visit <a class="reference external" href="https://modoolar.com">https://modoolar.com</a></p>