diff --git a/voice_note_in_chatter/README.rst b/voice_note_in_chatter/README.rst new file mode 100755 index 000000000..081f00a7a --- /dev/null +++ b/voice_note_in_chatter/README.rst @@ -0,0 +1,46 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Voice Message In Odoo +===================== +This module allows a option to record voice and send voice messages in chatter. + +Configuration +============= +* No Additional configuration is needed. + +License +======= +GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPLv3) +http://www.gnu.org/licenses/agpl-3.0-standalone.html + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +Developer: (V15) Farhana Jahan PT , Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/voice_note_in_chatter/__init__.py b/voice_note_in_chatter/__init__.py new file mode 100755 index 000000000..67dfba9be --- /dev/null +++ b/voice_note_in_chatter/__init__.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Farhana Jahan PT (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +################################################################################ diff --git a/voice_note_in_chatter/__manifest__.py b/voice_note_in_chatter/__manifest__.py new file mode 100755 index 000000000..7c49f0535 --- /dev/null +++ b/voice_note_in_chatter/__manifest__.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Farhana Jahan PT (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +################################################################################ +{ + 'name': 'Voice Message In Odoo', + 'version': '15.0.1.0.0', + 'category': 'Discuss', + 'summary': 'Send voice message in Chatter.', + 'description': "This module provides an option to record voice and " + "send voice messages in Chatter.", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['base', 'mail'], + 'assets': { + 'web.assets_qweb': [ + '/voice_note_in_chatter/static/src/xml/voice_in_odoo.xml', + ], + 'web.assets_backend': [ + 'voice_note_in_chatter/static/src/js/record_voice_component.js', + 'voice_note_in_chatter/static/src/js/voice_in_odoo.js', + 'voice_note_in_chatter/static/src/js/record_voice_model.js', + 'voice_note_in_chatter/static/src/js/attachment_card.js', + ] + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/voice_note_in_chatter/doc/RELEASE_NOTES.md b/voice_note_in_chatter/doc/RELEASE_NOTES.md new file mode 100755 index 000000000..430125d3a --- /dev/null +++ b/voice_note_in_chatter/doc/RELEASE_NOTES.md @@ -0,0 +1,5 @@ +## Module +#### 01.11.2023 +#### Version 15.0.1.0.0 +#### ADD +-Initial Commit for Voice Message In Odoo diff --git a/voice_note_in_chatter/static/description/assets/icons/check.png b/voice_note_in_chatter/static/description/assets/icons/check.png new file mode 100755 index 000000000..c8e85f51d Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/icons/check.png differ diff --git a/voice_note_in_chatter/static/description/assets/icons/chevron.png b/voice_note_in_chatter/static/description/assets/icons/chevron.png new file mode 100755 index 000000000..2089293d6 Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/icons/chevron.png differ diff --git a/voice_note_in_chatter/static/description/assets/icons/cogs.png b/voice_note_in_chatter/static/description/assets/icons/cogs.png new file mode 100755 index 000000000..95d0bad62 Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/icons/cogs.png differ diff --git a/voice_note_in_chatter/static/description/assets/icons/consultation.png b/voice_note_in_chatter/static/description/assets/icons/consultation.png new file mode 100755 index 000000000..8319d4baa Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/icons/consultation.png differ diff --git a/voice_note_in_chatter/static/description/assets/icons/ecom-black.png b/voice_note_in_chatter/static/description/assets/icons/ecom-black.png new file mode 100755 index 000000000..a9385ff13 Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/icons/ecom-black.png differ diff --git a/voice_note_in_chatter/static/description/assets/icons/education-black.png b/voice_note_in_chatter/static/description/assets/icons/education-black.png new file mode 100755 index 000000000..3eb09b27b Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/icons/education-black.png differ diff --git a/voice_note_in_chatter/static/description/assets/icons/hotel-black.png b/voice_note_in_chatter/static/description/assets/icons/hotel-black.png new file mode 100755 index 000000000..130f613be Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/icons/hotel-black.png differ diff --git a/voice_note_in_chatter/static/description/assets/icons/license.png b/voice_note_in_chatter/static/description/assets/icons/license.png new file mode 100755 index 000000000..a5869797e Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/icons/license.png differ diff --git a/voice_note_in_chatter/static/description/assets/icons/lifebuoy.png b/voice_note_in_chatter/static/description/assets/icons/lifebuoy.png new file mode 100755 index 000000000..658d56ccc Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/icons/lifebuoy.png differ diff --git a/voice_note_in_chatter/static/description/assets/icons/logo.png b/voice_note_in_chatter/static/description/assets/icons/logo.png new file mode 100755 index 000000000..478462d3e Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/icons/logo.png differ diff --git a/voice_note_in_chatter/static/description/assets/icons/manufacturing-black.png b/voice_note_in_chatter/static/description/assets/icons/manufacturing-black.png new file mode 100755 index 000000000..697eb0e9f Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/icons/manufacturing-black.png differ diff --git a/voice_note_in_chatter/static/description/assets/icons/pos-black.png b/voice_note_in_chatter/static/description/assets/icons/pos-black.png new file mode 100755 index 000000000..97c0f90c1 Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/icons/pos-black.png differ diff --git a/voice_note_in_chatter/static/description/assets/icons/puzzle.png b/voice_note_in_chatter/static/description/assets/icons/puzzle.png new file mode 100755 index 000000000..65cf854e7 Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/icons/puzzle.png differ diff --git a/voice_note_in_chatter/static/description/assets/icons/restaurant-black.png b/voice_note_in_chatter/static/description/assets/icons/restaurant-black.png new file mode 100755 index 000000000..4a35eb939 Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/icons/restaurant-black.png differ diff --git a/voice_note_in_chatter/static/description/assets/icons/service-black.png b/voice_note_in_chatter/static/description/assets/icons/service-black.png new file mode 100755 index 000000000..301ab51cb Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/icons/service-black.png differ diff --git a/voice_note_in_chatter/static/description/assets/icons/trading-black.png b/voice_note_in_chatter/static/description/assets/icons/trading-black.png new file mode 100755 index 000000000..9398ba2f1 Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/icons/trading-black.png differ diff --git a/voice_note_in_chatter/static/description/assets/icons/training.png b/voice_note_in_chatter/static/description/assets/icons/training.png new file mode 100755 index 000000000..884ca024d Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/icons/training.png differ diff --git a/voice_note_in_chatter/static/description/assets/icons/update.png b/voice_note_in_chatter/static/description/assets/icons/update.png new file mode 100755 index 000000000..ecbc5a01a Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/icons/update.png differ diff --git a/voice_note_in_chatter/static/description/assets/icons/user.png b/voice_note_in_chatter/static/description/assets/icons/user.png new file mode 100755 index 000000000..6ffb23d9f Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/icons/user.png differ diff --git a/voice_note_in_chatter/static/description/assets/icons/wrench.png b/voice_note_in_chatter/static/description/assets/icons/wrench.png new file mode 100755 index 000000000..6c04dea0f Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/icons/wrench.png differ diff --git a/voice_note_in_chatter/static/description/assets/modules/1.png b/voice_note_in_chatter/static/description/assets/modules/1.png new file mode 100755 index 000000000..1272619b1 Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/modules/1.png differ diff --git a/voice_note_in_chatter/static/description/assets/modules/2.png b/voice_note_in_chatter/static/description/assets/modules/2.png new file mode 100755 index 000000000..6d4cb94bb Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/modules/2.png differ diff --git a/voice_note_in_chatter/static/description/assets/modules/3.jpg b/voice_note_in_chatter/static/description/assets/modules/3.jpg new file mode 100755 index 000000000..f95d9196e Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/modules/3.jpg differ diff --git a/voice_note_in_chatter/static/description/assets/modules/4.png b/voice_note_in_chatter/static/description/assets/modules/4.png new file mode 100755 index 000000000..cdcba33eb Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/modules/4.png differ diff --git a/voice_note_in_chatter/static/description/assets/modules/5.png b/voice_note_in_chatter/static/description/assets/modules/5.png new file mode 100755 index 000000000..8eb268300 Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/modules/5.png differ diff --git a/voice_note_in_chatter/static/description/assets/modules/6.jpg b/voice_note_in_chatter/static/description/assets/modules/6.jpg new file mode 100755 index 000000000..cb354010a Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/modules/6.jpg differ diff --git a/voice_note_in_chatter/static/description/assets/screenshots/hero.gif b/voice_note_in_chatter/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..ef8c2c1bb Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/screenshots/hero.gif differ diff --git a/voice_note_in_chatter/static/description/assets/screenshots/voice_1.png b/voice_note_in_chatter/static/description/assets/screenshots/voice_1.png new file mode 100755 index 000000000..f3b3d1b89 Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/screenshots/voice_1.png differ diff --git a/voice_note_in_chatter/static/description/assets/screenshots/voice_2.png b/voice_note_in_chatter/static/description/assets/screenshots/voice_2.png new file mode 100755 index 000000000..0cdf61a03 Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/screenshots/voice_2.png differ diff --git a/voice_note_in_chatter/static/description/assets/screenshots/voice_3.png b/voice_note_in_chatter/static/description/assets/screenshots/voice_3.png new file mode 100755 index 000000000..243422816 Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/screenshots/voice_3.png differ diff --git a/voice_note_in_chatter/static/description/assets/screenshots/voice_4.png b/voice_note_in_chatter/static/description/assets/screenshots/voice_4.png new file mode 100755 index 000000000..03f788b5a Binary files /dev/null and b/voice_note_in_chatter/static/description/assets/screenshots/voice_4.png differ diff --git a/voice_note_in_chatter/static/description/banner.jpg b/voice_note_in_chatter/static/description/banner.jpg new file mode 100755 index 000000000..7de3c541d Binary files /dev/null and b/voice_note_in_chatter/static/description/banner.jpg differ diff --git a/voice_note_in_chatter/static/description/icon.png b/voice_note_in_chatter/static/description/icon.png new file mode 100755 index 000000000..f9e8da1b3 Binary files /dev/null and b/voice_note_in_chatter/static/description/icon.png differ diff --git a/voice_note_in_chatter/static/description/index.html b/voice_note_in_chatter/static/description/index.html new file mode 100755 index 000000000..7196613ce --- /dev/null +++ b/voice_note_in_chatter/static/description/index.html @@ -0,0 +1,586 @@ +
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+ +
+
+
+
+
+
+
+

+ Voice Message In Odoo

+

+ Option to Record Voice and Send Voice Messages in Chatter. +

+ +
+
+ + + +
+
+

+ Overview +

+
+ +
+

+ In Odoo, we do not have an option to send voice messages. This app will + allow us to record voice. Additionally, we can download this voice. This + app ensures the security of the site, as it will display an alert if + we're using an unsecured site (HTTP). We can only record voice on + secured sites. +

+
+ +
+
+

+ Features +

+
+ +
+
+ +
+
+

Added a new icon for recording voice in odoo.

+
+
+
+
+ +
+
+

We can send recorded voice.

+
+
+ +
+
+ +
+
+

If you're running on unsecured site, an alert will shown, we can not able to record voice in unsecured site(Need HTTPS).

+
+
+
+
+
+

+ Screenshots +

+
+
+

+ If you're running on unsecured site, an alert will shown, we can + not able to record voice in unsecured site( Need HTTPS ).

+ +
+ +
+

+ Here we can record the voice,if we are using HTTPS. The same + button will perform the start and stop function.

+ +
+ +
+

+ The recorded voice will send while clicking send button.

+ +
+
+ +

+ We can also send voice messages in popup chat in odoo.

+ +
+
+
+ +
+
+

Suggested Products

+
+ + +
+
+ + + +
+
+
+

Our Services

+
+
+ +
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+
+ + + +
+
+
+

Our Industries

+
+
+ +
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+ +
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

+
+
+ +
+
+ + + + + +
+
+
+

Need Help?

+
+
+
+ + +
+ +
+ +
+ +
+ WhatsApp +
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/voice_note_in_chatter/static/src/js/attachment_card.js b/voice_note_in_chatter/static/src/js/attachment_card.js new file mode 100755 index 000000000..747af4842 --- /dev/null +++ b/voice_note_in_chatter/static/src/js/attachment_card.js @@ -0,0 +1,25 @@ +/** @odoo-module */ +import { + AttachmentCard +} from "@mail/components/attachment_card/attachment_card"; +import { + patch +} from "@web/core/utils/patch"; + +patch(AttachmentCard.prototype, "attachment_card", { + /** + * Play Audio Attachment. + */ + onPlay(ev) { + var audioElements = $('.o_attachment_audio'); + //Pause Audio When other Audio plays + audioElements.each(function(index, element) { + if (ev.target != element.children[0]) { + for (let i = 0; i < element.children.length; i++) { + const childElement = element.children[i]; + childElement.pause() + } + } + }); + } +}); diff --git a/voice_note_in_chatter/static/src/js/record_voice_component.js b/voice_note_in_chatter/static/src/js/record_voice_component.js new file mode 100755 index 000000000..b9413a5bc --- /dev/null +++ b/voice_note_in_chatter/static/src/js/record_voice_component.js @@ -0,0 +1,17 @@ +/** @odoo-module **/ +import { registerMessagingComponent } from '@mail/utils/messaging_component'; +const { Component } = owl; + +export class AttachmentAudio extends Component { + /** + * @returns {AttachmentAudio} + */ + get attachmentAudio() { + return this.props.record; + } +} +Object.assign(AttachmentAudio, { + props: { record: Object }, + template: 'web.AttachmentAudioField', +}); +registerMessagingComponent(AttachmentAudio); diff --git a/voice_note_in_chatter/static/src/js/record_voice_model.js b/voice_note_in_chatter/static/src/js/record_voice_model.js new file mode 100755 index 000000000..46686e159 --- /dev/null +++ b/voice_note_in_chatter/static/src/js/record_voice_model.js @@ -0,0 +1,28 @@ +/** @odoo-module **/ +import { registerNewModel } from '@mail/model/model_core'; +import { attr, one2one } from '@mail/model/model_field'; + +function audio(dependencies) { + class AttachmentAudio extends dependencies['mail.model'] {} + + AttachmentAudio.fields = { + + /** + * Determines the attachment of this Audio. + */ + attachment:one2one('mail.attachment', { + inverse: 'attachment', + readonly: true + }), + /** + * Download Audio Attachment. + */ + downloadUrl: attr({ + related:'attachment.downloadUrl' + }), + }; + AttachmentAudio.identifyingFields = ['attachment']; + AttachmentAudio.modelName = 'mail.attachmentAudio'; + return AttachmentAudio; +} +registerNewModel('mail.attachmentAudio', audio); diff --git a/voice_note_in_chatter/static/src/js/voice_in_odoo.js b/voice_note_in_chatter/static/src/js/voice_in_odoo.js new file mode 100755 index 000000000..a4acf8076 --- /dev/null +++ b/voice_note_in_chatter/static/src/js/voice_in_odoo.js @@ -0,0 +1,105 @@ +/** @odoo-module **/ +import { + registerInstancePatchModel, + registerFieldPatchModel, + registry +} from '@mail/model/model_core'; +import Dialog from "web.Dialog"; +const { + _t +} = require('web.core'); +const composer_view = registry['mail.composer_view'] +import { + one2one +} from '@mail/model/model_field'; +var flag = false; +var recorder, gumStream; +registerInstancePatchModel('mail.composer_view', 'mail/static/src/models/composer_view/composer_view.js', { + recordVoice: function() { + //Check security of site + if (location.href.includes('https:')) { + /** + * Asks for access to the user's microphone if not granted yet, then + * starts recording. + */ + var self = this; + if (recorder && recorder.state == "recording") { + recorder.stop(); + gumStream.getAudioTracks()[0].stop(); + if (this.el.children.length == 4) { + this.el.children[2].children[1].children[0].children[1].children[1].style.color = ""; + this.el.children[2].children[1].children[0].children[1].children[1].style.background = ""; + } else { + this.el.children[1].children[1].children[0].children[1].children[1].style.color = ""; + this.el.children[1].children[1].children[0].children[1].children[1].style.background = ""; + } + } else { + if (this.el.children.length == 4) { + this.el.children[2].children[1].children[0].children[1].children[1].style.color = "#008000"; + this.el.children[2].children[1].children[0].children[1].children[1].style.background = "#b5f1b5"; + } else { + this.el.children[1].children[1].children[0].children[1].children[1].style.color = "#008000"; + this.el.children[1].children[1].children[0].children[1].children[1].style.background = "#b5f1b5"; + } + var audioElements = $('.o_attachment_audio'); + //Pause Audio When Recording a new Audio + audioElements.each(function(index, element) { + for (let i = 0; i < element.children.length; i++) { + const childElement = element.children[i]; + childElement.pause() + } + }); + navigator.mediaDevices.getUserMedia({ + audio: true + }).then((stream) => { + gumStream = stream; + recorder = new MediaRecorder(stream); + recorder.ondataavailable = async function(event) { + var reader = new FileReader(); + reader.readAsDataURL(event.data); + reader.onloadend = async function() { + var data = reader.result; + var fl = []; + var array = data.split(','), + mime = array[0].match(/:(.*?);/)[1], + bstr = atob(array[1]), + n = bstr.length, + u8arr = new Uint8Array(n); + while (n--) { + u8arr[n] = bstr.charCodeAt(n); + } + var voice_file = new File([u8arr], 'message.mp3', { + type: mime + }); + fl.push(voice_file); + await self._fileUploaderRef.comp.uploadFiles(fl) + }; + }; + recorder.start(); + }); + } + } else { + //If the site is not https,an alert will display. + if (flag == false) { + flag = true + var dialog = new Dialog(this, { + size: 'medium', + buttons: '', + $content: $('
', { + text: _t("Site is not secure,use secured site(https)") + }), + }).open() + } + } + }, +}); + +/** + * Registers a field patch model for the 'mail.attachment' model. + */ +registerFieldPatchModel('mail.attachment', 'mail/static/src/models/attachment/attachment.js', { + attachment: one2one('mail.attachmentAudio', { + inverse: 'attachment', + isCausal: true, + }), +}); \ No newline at end of file diff --git a/voice_note_in_chatter/static/src/xml/voice_in_odoo.xml b/voice_note_in_chatter/static/src/xml/voice_in_odoo.xml new file mode 100755 index 000000000..777516151 --- /dev/null +++ b/voice_note_in_chatter/static/src/xml/voice_in_odoo.xml @@ -0,0 +1,101 @@ + +