Guys, I need to change the "make_message" function in the chat_manager.js file in the mail module.
Basically, I want to add a new field to the ouput of the function.
How can I do this? I've build a module that does everything well up until the moment I need to change javascript.
odoo.define('MYMODULE.chat_manager', function (require) {
"use strict";
var mail_chatter_manager = require('mail.chat_manager');
mail_chatter_manager.include({
make_message: function make_message (data) {
var msg = {
id: data.id,
author_id: data.author_id,
body: data.body || "",
date: moment(time.str_to_datetime(data.date)),
message_type: data.message_type,
subtype_description: data.subtype_description,
is_author: data.author_id && data.author_id[0] === session.partner_id,
is_note: data.is_note,
is_system_notification: (data.message_type === 'notification' && data.model === 'mail.channel')
|| data.info === 'transient_message',
attachment_ids: data.attachment_ids || [],
subject: data.subject,
email_from: data.email_from,
customer_email_status: data.customer_email_status,
customer_email_data: data.customer_email_data,
record_name: data.record_name,
tracking_value_ids: data.tracking_value_ids,
channel_ids: data.channel_ids,
model: data.model,
res_id: data.res_id,
url: session.url("/mail/view?message_id=" + data.id),
module_icon:data.module_icon,
read_by: data.read_by,
};
//Etc., etc., etc.
},
});
});
I always get a "mail_chatter_manager.include is not a function" error.
A whole module (that could well go public for free is dependent on this!)
read lines from/odoo/addons/mail/static/src/js/chat_manager.js 665-670