diff --git a/odoo_advanced_chatter/README.rst b/odoo_advanced_chatter/README.rst index 8c916ac42..b5f4db46f 100644 --- a/odoo_advanced_chatter/README.rst +++ b/odoo_advanced_chatter/README.rst @@ -47,5 +47,3 @@ For support and more information, please visit `Our Website `__ - - diff --git a/odoo_advanced_chatter/__init__.py b/odoo_advanced_chatter/__init__.py index 097bdb395..d4b63604d 100644 --- a/odoo_advanced_chatter/__init__.py +++ b/odoo_advanced_chatter/__init__.py @@ -20,3 +20,4 @@ # ############################################################################# from . import models +from . import wizard diff --git a/odoo_advanced_chatter/__manifest__.py b/odoo_advanced_chatter/__manifest__.py index e34e471be..8e2286035 100644 --- a/odoo_advanced_chatter/__manifest__.py +++ b/odoo_advanced_chatter/__manifest__.py @@ -20,34 +20,38 @@ # ############################################################################# { - "name": "Odoo Advanced Chatter", - "version": "16.0.1.0.0", - "category": "Discuss", - "summary": "Schedule Log note and Send Message in Chatter", - "description": """We have the capability to schedule log notes and send - messages within Chatter.Additionally, followers can be managed both from - the followers list and directly within the Schedule form.""", - "author": "Cybrosys Techno Solutions", - "company": "Cybrosys Techno Solutions", - "maintainer": "Cybrosys Techno Solutions", - "website": "https://www.cybrosys.com", - "depends": ["web", "mail"], - "data": [ - "security/ir.model.access.csv", - "data/ir_cron.xml", - "views/schedule_log_views.xml", + 'name': 'Odoo Advanced Chatter', + 'version': '16.0.2.0.0', + 'category': 'Discuss', + 'summary': 'Schedule Log note and Send Message in Chatter', + 'description': """We have the capability to schedule log notes and send + messages within Chatter.Additionally, followers can be + managed both from the followers list and directly within + the Schedule form.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['web', 'mail'], + 'data': [ + 'security/ir.model.access.csv', + 'data/ir_cron.xml', + 'views/schedule_log_view.xml', + 'wizard/mail_wizard_recipients_views.xml', ], "assets": { "web.assets_backend": [ - "odoo_advanced_chatter/static/src/xml/schedule_log.xml", - "odoo_advanced_chatter/static/src/js/schedule_mail.js", - "odoo_advanced_chatter/static/src/xml/follower_list.xml", - "odoo_advanced_chatter/static/src/js/follower_list.js", + 'odoo_advanced_chatter/static/src/xml/schedule_log.xml', + 'odoo_advanced_chatter/static/src/js/schedule_mail.js', + 'odoo_advanced_chatter/static/src/xml/follower_list.xml', + 'odoo_advanced_chatter/static/src/js/follower_list.js', + 'odoo_advanced_chatter/static/src/xml/chatter.xml', + 'odoo_advanced_chatter/static/src/js/composer.js', ] }, - "images": ["static/description/banner.png"], - "license": "LGPL-3", - "installable": True, - "auto_install": False, - "application": False, + 'images': ['static/description/banner.png'], + 'installable': True, + 'license': 'LGPL-3', + 'auto_install': False, + 'application': False, } diff --git a/odoo_advanced_chatter/doc/RELEASE_NOTES.md b/odoo_advanced_chatter/doc/RELEASE_NOTES.md index 161f0912d..c311ef68b 100644 --- a/odoo_advanced_chatter/doc/RELEASE_NOTES.md +++ b/odoo_advanced_chatter/doc/RELEASE_NOTES.md @@ -4,3 +4,8 @@ #### Version 16.0.1.0.0 #### ADD - Initial Commit for Odoo Advanced Chatter + +#### 21.06.2024 +#### Version 16.0.2.0.0 +#### UPDATE +- UPDATE \ No newline at end of file diff --git a/odoo_advanced_chatter/models/__init__.py b/odoo_advanced_chatter/models/__init__.py index 9e51feb5a..8943e6a82 100644 --- a/odoo_advanced_chatter/models/__init__.py +++ b/odoo_advanced_chatter/models/__init__.py @@ -19,4 +19,5 @@ # If not, see . # ############################################################################# +from . import mail_message from . import schedule_log diff --git a/odoo_advanced_chatter/models/mail_message.py b/odoo_advanced_chatter/models/mail_message.py new file mode 100644 index 000000000..37e24967e --- /dev/null +++ b/odoo_advanced_chatter/models/mail_message.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import api, models + + +class MailMessage(models.Model): + """To manage recipients in the reply mail""" + _inherit = "mail.message" + + @api.model + def _get_reply_to(self, values): + """ Return a specific reply_to for the document """ + model = values.get('model', self._context.get('default_model')) + res_id = values.get('res_id', + self._context.get('default_res_id')) or False + email_from = values.get('email_from') + reply_to_id = self.env['ir.config_parameter'].get_param('reply_to') + author1 = self.env['res.users'].browse(int(reply_to_id)) + self.env['ir.config_parameter'].set_param('reply_to', self.env.user.id) + email_from1 = author1.email_formatted + message_type = values.get('message_type') + records = None + if self.is_thread_message({'model': model, 'res_id': res_id, + 'message_type': message_type}): + records = self.env[model].browse([res_id]) + else: + records = self.env[model] if model else self.env['mail.thread'] + if author1.id == self.env.user: + return records._notify_get_reply_to(default=email_from)[res_id] + else: + return records._notify_get_reply_to(default=email_from1)[res_id] diff --git a/odoo_advanced_chatter/models/schedule_log.py b/odoo_advanced_chatter/models/schedule_log.py index fdffcff99..d07c8c850 100644 --- a/odoo_advanced_chatter/models/schedule_log.py +++ b/odoo_advanced_chatter/models/schedule_log.py @@ -19,53 +19,49 @@ # If not, see . # ############################################################################# -from odoo import models, fields + +from odoo import models, fields, _, api import datetime class ScheduleLog(models.Model): """To schedule the log note""" - - _name = "schedule.log" + _name = 'schedule.log' _description = "Schedule log note in chatter" body = fields.Html(string="Body", help="Content of the log", required="1") - partner_ids = fields.Many2many( - "res.partner", string="Recipients", help="To whom the log is Mentioned" - ) - time = fields.Datetime( - string="Scheduled Time", required="1", help="Time at which the log is scheduled" - ) - attachment_ids = fields.Many2many( - comodel_name="ir.attachment", string="Attachments", help="attachments" - ) - is_log = fields.Boolean( - string="Is Log", - default=False, - help="to check whether it is log note or send " "messages", - ) - model = fields.Char(string="Related Model", help="Related Model") + partner_ids = fields.Many2many('res.partner', string='Recipients', + help='To whom the log is Mentioned') + time = fields.Datetime(string="Scheduled Time", required="1", + help="Time at which the log is scheduled") + attachment_ids = fields.Many2many(comodel_name='ir.attachment', + string="Attachments", help="attachments") + is_log = fields.Boolean(string='Is Log', default=False, + help="to check whether it is log note or send " + "messages") + model = fields.Char(string='Related Model', help="Related Model") model_reference = fields.Integer(string="Related Document Id") - status = fields.Selection( - [("draft", "Schedule"), ("post", "Post")], - string="Status", - default="draft", - help="status of the message", - ) + status = fields.Selection([('draft', "Schedule"), ('post', "Post")], + string='Status', default='draft', + help="status of the message") def action_save(self): """Display notification when messages are scheduled""" if self.body: current_time = fields.Datetime.now().replace(second=0) - scheduled_time = fields.Datetime.from_string(self.time).replace(second=0) - time_difference = abs((current_time - scheduled_time).total_seconds()) + scheduled_time = fields.Datetime.from_string(self.time).replace( + second=0) + time_difference = abs( + (current_time - scheduled_time).total_seconds()) acceptable_difference = 5 if time_difference <= acceptable_difference: user_id = self.env.user.commercial_partner_id partner_ids = self.partner_ids.ids if user_id.id in self.partner_ids.ids: partner_ids.remove(user_id.id) - model = self.env[self.model].sudo().browse(self.model_reference) + model = self.env[self.model].sudo().browse( + self.model_reference) + print('elf.is_log', self.is_log) if not self.is_log: message = model.message_post( author_id=self.create_uid.partner_id.id, @@ -75,7 +71,7 @@ class ScheduleLog(models.Model): ) for mail in message.mail_ids: mail.send() - self.status = "post" + self.status = 'post' else: message = model.message_post( author_id=self.create_uid.partner_id.id, @@ -83,37 +79,36 @@ class ScheduleLog(models.Model): body=self.body, partner_ids=partner_ids, attachment_ids=self.attachment_ids.ids, - message_type="comment", - subtype_xmlid="mail.mt_comment", + message_type='comment', + subtype_xmlid='mail.mt_comment' ) + print('notify',message.notification_ids) message.notification_ids = [fields.Command.clear()] - message.notification_ids = [ - fields.Command.create({"res_partner_id": pid}) - for pid in partner_ids - ] - self.status = "post" + message.notification_ids = [fields.Command.create({ + 'res_partner_id': pid + }) for pid in partner_ids] + self.status = 'post' else: return { - "type": "ir.actions.client", - "tag": "display_notification", - "params": { - "title": "Title", - "message": "Message scheduled successfully.", - "sticky": True, - "next": {"type": "ir.actions.act_window_close"}, - }, + 'type': 'ir.actions.client', + 'tag': 'display_notification', + 'params': { + 'title': 'Title', + 'message': "Message scheduled successfully.", + 'sticky': True, + 'next': {'type': 'ir.actions.act_window_close'}, + } } def schedule(self): """To schedule the log note""" date = datetime.datetime.now() - date_sec = date.replace(second=0).strftime("%Y-%m-%d %H:%M:%S") - date_max = date.replace(second=59).strftime("%Y-%m-%d %H:%M:%S") - scheduled_lognotes = self.env["schedule.log"].search( + date_sec = date.replace(second=0).strftime('%Y-%m-%d %H:%M:%S') + date_max = date.replace(second=59).strftime('%Y-%m-%d %H:%M:%S') + scheduled_lognotes = self.search( [ - ("time", ">=", date_sec), - ("time", "<=", date_max), - ("status", "=", "draft"), + ('time', '>=', date_sec), ('time', '<=', date_max), + ('status', '=', 'draft') ] ) for rec in scheduled_lognotes: @@ -121,7 +116,8 @@ class ScheduleLog(models.Model): partner_ids = rec.partner_ids.ids if user_id.id in rec.partner_ids.ids: partner_ids.remove(user_id.id) - model = self.env[rec.model].sudo().browse(rec.model_reference) + model = self.env[rec.model].sudo().browse( + rec.model_reference) if not rec.is_log: message = model.message_post( author_id=rec.create_uid.partner_id.id, @@ -131,7 +127,7 @@ class ScheduleLog(models.Model): ) for mail in message.mail_ids: mail.send() - rec.status = "post" + rec.status = 'post' else: message = model.message_post( author_id=rec.create_uid.partner_id.id, @@ -139,12 +135,11 @@ class ScheduleLog(models.Model): body=rec.body, partner_ids=partner_ids, attachment_ids=rec.attachment_ids.ids, - message_type="comment", - subtype_xmlid="mail.mt_comment", + message_type='comment', + subtype_xmlid='mail.mt_comment' ) message.notification_ids = [fields.Command.clear()] - message.notification_ids = [ - fields.Command.create({"res_partner_id": pid}) - for pid in partner_ids - ] - rec.status = "post" + message.notification_ids = [fields.Command.create({ + 'res_partner_id': pid + }) for pid in partner_ids] + rec.status = 'post' diff --git a/odoo_advanced_chatter/security/ir.model.access.csv b/odoo_advanced_chatter/security/ir.model.access.csv index 2dd0a82e1..fb297d87d 100644 --- a/odoo_advanced_chatter/security/ir.model.access.csv +++ b/odoo_advanced_chatter/security/ir.model.access.csv @@ -1,2 +1,3 @@ id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink -access_schedule_log,access_schedule_log,model_schedule_log,base.group_user,1,1,1,1 \ No newline at end of file +access_schedule_log,access_schedule_log,model_schedule_log,base.group_user,1,1,1,1 +access_mail_wizard_recipient,access_mail_wizard_recipient,model_mail_wizard_recipient,base.group_user,1,1,1,1 diff --git a/odoo_advanced_chatter/static/description/assets/screenshots/11.png b/odoo_advanced_chatter/static/description/assets/screenshots/11.png new file mode 100644 index 000000000..c5b292b96 Binary files /dev/null and b/odoo_advanced_chatter/static/description/assets/screenshots/11.png differ diff --git a/odoo_advanced_chatter/static/description/assets/screenshots/12.png b/odoo_advanced_chatter/static/description/assets/screenshots/12.png new file mode 100644 index 000000000..3f4103aa0 Binary files /dev/null and b/odoo_advanced_chatter/static/description/assets/screenshots/12.png differ diff --git a/odoo_advanced_chatter/static/description/assets/screenshots/13.png b/odoo_advanced_chatter/static/description/assets/screenshots/13.png new file mode 100644 index 000000000..a4e8a0b08 Binary files /dev/null and b/odoo_advanced_chatter/static/description/assets/screenshots/13.png differ diff --git a/odoo_advanced_chatter/static/description/assets/screenshots/14.png b/odoo_advanced_chatter/static/description/assets/screenshots/14.png new file mode 100644 index 000000000..dd10226a1 Binary files /dev/null and b/odoo_advanced_chatter/static/description/assets/screenshots/14.png differ diff --git a/odoo_advanced_chatter/static/description/assets/screenshots/15.png b/odoo_advanced_chatter/static/description/assets/screenshots/15.png new file mode 100644 index 000000000..216dedd08 Binary files /dev/null and b/odoo_advanced_chatter/static/description/assets/screenshots/15.png differ diff --git a/odoo_advanced_chatter/static/description/assets/screenshots/16.png b/odoo_advanced_chatter/static/description/assets/screenshots/16.png new file mode 100644 index 000000000..56f438d6e Binary files /dev/null and b/odoo_advanced_chatter/static/description/assets/screenshots/16.png differ diff --git a/odoo_advanced_chatter/static/description/assets/screenshots/17.png b/odoo_advanced_chatter/static/description/assets/screenshots/17.png new file mode 100644 index 000000000..c19a6b557 Binary files /dev/null and b/odoo_advanced_chatter/static/description/assets/screenshots/17.png differ diff --git a/odoo_advanced_chatter/static/description/assets/screenshots/v16-hero.gif b/odoo_advanced_chatter/static/description/assets/screenshots/v16-hero.gif index 5a3d50906..e033f25aa 100644 Binary files a/odoo_advanced_chatter/static/description/assets/screenshots/v16-hero.gif and b/odoo_advanced_chatter/static/description/assets/screenshots/v16-hero.gif differ diff --git a/odoo_advanced_chatter/static/description/index.html b/odoo_advanced_chatter/static/description/index.html index 4e6e11bcb..396f23709 100644 --- a/odoo_advanced_chatter/static/description/index.html +++ b/odoo_advanced_chatter/static/description/index.html @@ -143,6 +143,11 @@ We can mange Recipients from the follower's list +
+ + We can mange Recipients in the Reply Mail. +
@@ -233,6 +238,38 @@ +
+

+ A new icon is added in the composer,a wizard is opened to select the recipient to which the reply mail is to be sent. +

+ +
+
+

+ We can choose the recipient to which the reply mail is to be sent. +

+ +
+
+

+ Now sent the message. +

+ +
+
+

+ Go to Settings-> Technical -> Messages , We can see the messages we sent in that we can see the change in Reply-to +

+ +
+
+

+ In the mail also we can see the changes +

+ + + +
diff --git a/odoo_advanced_chatter/static/src/js/composer.js b/odoo_advanced_chatter/static/src/js/composer.js new file mode 100644 index 000000000..1367f5713 --- /dev/null +++ b/odoo_advanced_chatter/static/src/js/composer.js @@ -0,0 +1,34 @@ +/** @odoo-module **/ +import { patch } from "@web/core/utils/patch"; +import { Composer } from "@mail/components/composer/composer"; +import { _t } from 'web.core'; +import { useService } from "@web/core/utils/hooks"; +patch(Composer.prototype, 'chatter_recipients',{ + setup() { + this._super(); + this.orm = useService('orm') + var userId = this.env.searchModel.userService.userId + this.orm.call( + 'mail.wizard.recipient', + 'get_user', + [userId] + ) + }, + replyTo() { + var userId = this.env.searchModel.userService.userId + const action = { + type: "ir.actions.act_window", + res_model: "mail.wizard.recipient", + view_mode: "form", + views: [[false, "form"]], + name: _t("Reply To"), + target: "new", + context: { + default_model: this.props.threadModel, + default_model_reference: this.props.threadId, + default_partner_id:userId, + }, + } + this.env.services.action.doAction(action, {}) + } +}) diff --git a/odoo_advanced_chatter/static/src/js/follower_list.js b/odoo_advanced_chatter/static/src/js/follower_list.js index a4f56965e..c68f11b72 100644 --- a/odoo_advanced_chatter/static/src/js/follower_list.js +++ b/odoo_advanced_chatter/static/src/js/follower_list.js @@ -8,14 +8,14 @@ registerPatch({ recordMethods:{ //---to manage the recipients to whom the message should sent Check(){ - var index = message_list.indexOf(this.follower.partner.id) - if (message_list.includes(this.follower.partner.id)){ - message_list.splice(index, 1) - } - else{ - message_list.push(this.follower.partner.id) - } - this.follower.followedThread.composer.check = message_list + var index = message_list.indexOf(this.follower.partner.id) + if (message_list.includes(this.follower.partner.id)){ + message_list.splice(index, 1) + } + else{ + message_list.push(this.follower.partner.id) + } + this.follower.followedThread.composer.check = message_list } } -}) \ No newline at end of file +}) diff --git a/odoo_advanced_chatter/static/src/js/schedule_mail.js b/odoo_advanced_chatter/static/src/js/schedule_mail.js index b17a583e5..a0d440bb7 100644 --- a/odoo_advanced_chatter/static/src/js/schedule_mail.js +++ b/odoo_advanced_chatter/static/src/js/schedule_mail.js @@ -1,9 +1,6 @@ /** @odoo-module **/ - import { registerPatch } from '@mail/model/model_core'; import { patch } from '@web/core/utils/patch'; - - registerPatch({ name: 'ComposerView', recordMethods: { @@ -14,63 +11,54 @@ registerPatch({ const recipient = this.composer.check var followers_list=[] $.each(composer.thread.followers,(index,follower) => { - followers_list.push(follower.partner.id) + followers_list.push(follower.partner.id) }); if (recipient){ - recipient.forEach(item=>{ - const index = followers_list.indexOf(item); - if (index !== -1) { - followers_list.splice(index, 1); - } - }) + recipient.forEach(item=>{ + const index = followers_list.indexOf(item); + if (index !== -1) { + followers_list.splice(index, 1); + } + }) } if (!this.composer.isLog ){ - const action = { - type: 'ir.actions.act_window', - res_model:'schedule.log', - domain: [], - views: [ [false, "form"],[false, "list"],], - name: this.env._t("Schedule Message"), - target: 'new', - context: { - default_body:postData.body, - default_attachment_ids:postData.attachment_ids, - default_is_log:1, - default_partner_ids:followers_list, - default_model:composer.thread.model, - default_model_reference:composer.thread.id, - }, - }; - this.env.services.action.doAction( - action, - { - } - ); - } - else{ - const action = { - type: 'ir.actions.act_window', - res_model:'schedule.log', - domain: [], - views: [ [false, "form"],[false, "list"],], - name: this.env._t("Schedule Log"), - target: 'new', - context: { - default_body:postData.body, - default_attachment_ids:postData.attachment_ids, - default_partner_ids:followers_list, - default_is_log:0, - default_model:composer.thread.model, - default_model_reference:composer.thread.id, - }, - }; - this.env.services.action.doAction( - action, - { - } - ); - } + const action = { + type: 'ir.actions.act_window', + res_model:'schedule.log', + domain: [], + views: [ [false, "form"],[false, "list"],], + name: this.env._t("Schedule Message"), + target: 'new', + context: { + default_body:postData.body, + default_attachment_ids:postData.attachment_ids, + default_is_log:1, + default_partner_ids:followers_list, + default_model:composer.thread.model, + default_model_reference:composer.thread.id, + }, + }; + this.env.services.action.doAction(action, {}); + } + else{ + const action = { + type: 'ir.actions.act_window', + res_model:'schedule.log', + domain: [], + views: [ [false, "form"],[false, "list"],], + name: this.env._t("Schedule Log"), + target: 'new', + context: { + default_body:postData.body, + default_attachment_ids:postData.attachment_ids, + default_partner_ids:followers_list, + default_is_log:0, + default_model:composer.thread.model, + default_model_reference:composer.thread.id, + }, + }; + this.env.services.action.doAction(action, {}) + } }, - }, }); diff --git a/odoo_advanced_chatter/static/src/xml/chatter.xml b/odoo_advanced_chatter/static/src/xml/chatter.xml new file mode 100644 index 000000000..541147ed6 --- /dev/null +++ b/odoo_advanced_chatter/static/src/xml/chatter.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/odoo_advanced_chatter/static/src/xml/follower_list.xml b/odoo_advanced_chatter/static/src/xml/follower_list.xml index 036e52a89..c757cc15a 100644 --- a/odoo_advanced_chatter/static/src/xml/follower_list.xml +++ b/odoo_advanced_chatter/static/src/xml/follower_list.xml @@ -7,4 +7,4 @@ t-ref="check" value="1" t-on-click="followerView.Check"/> - \ No newline at end of file + diff --git a/odoo_advanced_chatter/static/src/xml/schedule_log.xml b/odoo_advanced_chatter/static/src/xml/schedule_log.xml index 2b330db94..aad04033e 100644 --- a/odoo_advanced_chatter/static/src/xml/schedule_log.xml +++ b/odoo_advanced_chatter/static/src/xml/schedule_log.xml @@ -9,4 +9,4 @@ title="Schedule Mail" aria-label="Schedule Log" type="button" t-on-click="composerView.scheduleLogNote"/> - \ No newline at end of file + diff --git a/odoo_advanced_chatter/views/schedule_log_views.xml b/odoo_advanced_chatter/views/schedule_log_view.xml similarity index 99% rename from odoo_advanced_chatter/views/schedule_log_views.xml rename to odoo_advanced_chatter/views/schedule_log_view.xml index c7fd8aa67..3aef2c248 100644 --- a/odoo_advanced_chatter/views/schedule_log_views.xml +++ b/odoo_advanced_chatter/views/schedule_log_view.xml @@ -28,4 +28,4 @@ schedule.log form - \ No newline at end of file + diff --git a/odoo_advanced_chatter/wizard/__init__.py b/odoo_advanced_chatter/wizard/__init__.py new file mode 100644 index 000000000..148cf4a80 --- /dev/null +++ b/odoo_advanced_chatter/wizard/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import mail_wizard_recipient diff --git a/odoo_advanced_chatter/wizard/mail_wizard_recipient.py b/odoo_advanced_chatter/wizard/mail_wizard_recipient.py new file mode 100644 index 000000000..9dd214445 --- /dev/null +++ b/odoo_advanced_chatter/wizard/mail_wizard_recipient.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import models, fields, api + + +class AddRecipient(models.TransientModel): + """To add more recipients in the chatter""" + _name = 'mail.wizard.recipient' + _description = 'Add more Recipients' + + partner_id = fields.Many2one('res.users', string='Recipients', + help="Choose the user to whom we have to " + "sent the reply mail") + model = fields.Char(string='Related Model', help="Related Model") + model_reference = fields.Integer(string="Related Document Id", + help="Related Document Id") + message_id = fields.Many2one('mail.message') + + def add_recipients(self): + """On selecting the user to whom the mail is sent, the user is then + added to config parameters""" + self.env['ir.config_parameter'].set_param('reply_to', + self.partner_id.id) + + @api.model + def get_user(self, user_id): + self.env['ir.config_parameter'].set_param('reply_to', user_id) diff --git a/odoo_advanced_chatter/wizard/mail_wizard_recipients_views.xml b/odoo_advanced_chatter/wizard/mail_wizard_recipients_views.xml new file mode 100644 index 000000000..3048fa7b5 --- /dev/null +++ b/odoo_advanced_chatter/wizard/mail_wizard_recipients_views.xml @@ -0,0 +1,25 @@ + + + + + + Add Recipients + mail.wizard.recipient + +
+ + + + +
+
+
+
+