Search 1.9 billion lines of Odoo code on GitHub

multi_livechat

Author: IT Projects Labs, Ivan Yelizariev
License: Other OSI approved licence
Branch: 16.0
Repository: brain-tec/sync-addons
Dependencies: mail
Languages: JavaScript (177, 35.0%), Python (203, 40.1%), XML (67, 13.2%), and reStructuredText (59, 11.7%)
Other branches: 13.0, 13.0-exodus-17, 13.0-exodus-19, 14.0, 14.0-exodus-17, 14.0-exodus-19, 15.0, 15.0-sync_odoo2odoo, 15.0-sync_telegram, and 15.0-sync_viber
Other repositories: SeuMarco/sync-addons, em230418/sync-addons, itpp-labs/sync-addons, trojikman/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="customer-chat"></a> <h2>Customer Chat</h2> <p>Base module to implement Live Chat through different channels (Telegram, WhatsApp, Instragram, etc.).</p> <a name="usage"></a> <h3>Usage</h3> <p>Add following code to your module. Replace MODULE and NAME for your custom values, e.g.</p> <ul class="simple"> <li><cite>MODULE</cite> is <cite>sync_telegram</cite></li> <li><cite>NAME</cite> is <cite>telegram</cite></li> </ul> <a name="module-manifest-py"></a> <h4>MODULE/__manifest__.py</h4> <pre> <code lang="py">&quot;depends&quot;: [&quot;multi_livechat&quot;], &quot;assets&quot;: { &quot;web.assets_backend&quot;: [ &quot;MODULE/static/src/models/discuss/discuss.js&quot;, &quot;MODULE/static/src/models/discuss_sidebar_category/discuss_sidebar_category.js&quot;, ], },</code> </pre> <a name="module-models-init-py"></a> <h4>MODULE/models/__init__.py</h4> <pre> <code lang="py">from . import res_users_settings from . import mail_channel</code> </pre> <a name="module-models-res-users-settings-py"></a> <h4>MODULE/models/res_users_settings.py</h4> <pre> <code lang="py">from odoo import fields, models class ResUsersSettings(models.Model): _inherit = 'res.users.settings' is_discuss_sidebar_category_NAME_open = fields.Boolean(&quot;Is category NAME open&quot;, default=True)</code> </pre> <a name="module-models-mail-channel-py"></a> <h4>MODULE/models/mail_channel.py</h4> <pre> <code lang="py">from odoo import fields, models class MailChannel(models.Model): _inherit = &quot;mail.channel&quot; channel_type = fields.Selection( selection_add=[(&quot;multi_livechat_NAME&quot;, &quot;Channel Description&quot;)], ondelete={&quot;multi_livechat_NAME&quot;: &quot;cascade&quot;} )</code> </pre> <a name="module-static-src-models-discuss-js"></a> <h4>MODULE/static/src/models/discuss.js</h4> <pre> <code lang="js">/** &#64;odoo-module **/ import { registerPatch } from '&#64;mail/model/model_core'; import { one } from '&#64;mail/model/model_field'; registerPatch({ name: 'Discuss', fields: { categoryMLChat_echo_demo: one('DiscussSidebarCategory', { default: {}, inverse: 'discussAsMLChat_NAME', }), }, });</code> </pre> <a name="module-static-src-models-discuss-sidebar-category-js"></a> <h4>MODULE/static/src/models/discuss_sidebar_category.js</h4> <pre> <code lang="js">/** &#64;odoo-module **/ import { registerPatch } from '&#64;mail/model/model_core'; import { one } from '&#64;mail/model/model_field'; import { clear } from '&#64;mail/model/model_field_command'; registerPatch({ name: 'DiscussSidebarCategory', fields: { categoryItemsOrderedByLastAction: { compute() { if (this.discussAsMLChat_NAME) { return this.categoryItems; } return this._super(); }, }, discussAsMLChat_NAME: one('Discuss', { identifying: true, inverse: 'categoryMLChat_NAME', }), isServerOpen: { compute() { // there is no server state for non-users (guests) if (!this.messaging.currentUser) { return clear(); } if (!this.messaging.currentUser.res_users_settings_id) { return clear(); } if (this.discussAsMLChat_NAME) { return this.messaging.currentUser.res_users_settings_id.is_discuss_sidebar_category_NAME_open; } return this._super(); }, }, name: { compute() { if (this.discussAsMLChat_NAME) { return this.env._t(&quot;NAME&quot;); } return this._super(); }, }, orderedCategoryItems: { compute() { if (this.discussAsMLChat_NAME) { return this.categoryItemsOrderedByLastAction; } return this._super(); }, }, serverStateKey: { compute() { if (this.discussAsMLChat_NAME) { return 'is_discuss_sidebar_category_NAME_open'; } return this._super(); }, }, supportedChannelTypes: { compute() { if (this.discussAsMLChat_NAME) { return ['NAME']; } return this._super(); }, }, }, });</code> </pre> <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&#64;itpp.dev">help&#64;itpp.dev</a></p> <a name="further-information"></a> <h3>Further information</h3> <p>Apps store: <a class="reference external" href="https://apps.odoo.com/apps/modules/16.0/multi_livechat/">https://apps.odoo.com/apps/modules/16.0/multi_livechat/</a></p> <p>Notifications on updates: <a class="reference external" href="https://github.com/itpp-labs/sync-addons/commits/16.0/multi_livechat.atom">via Atom</a>, <a class="reference external" href="https://blogtrottr.com/?subscribe=https://github.com/itpp-labs/sync-addons/commits/16.0/multi_livechat.atom">by Email</a></p> <p>Tested on <a class="reference external" href="https://github.com/odoo/odoo/commit/9917d841fa38ccc1e6d67875a665494dc22ef92f">Odoo 16.0</a></p>