I try to add a function to message in Inbox - send message to lead.
Ok, I've made like it is made by Odoo("dive into"): added a button near to "Mark as read"
/addons/mail/static/src/xml/thread.xml: added new with
class="fa fa-book o_thread_icon o_thread_message_message_to_lead"
then in
/addons/mail/static/src/js/thread.js
/addons/mail/static/src/js/client_action.js
/addons/mail/static/src/js/chat_manager.js
i've duplicated "mark_as_read" functions and replaced function name.
in addons/mail/models/mail_message.py
added my function
So, it works! But I didn't find a way to pack it to a custom module: odoo reads /addons/mail/static/src/xml/thread.xml direct from the source and do not store it in DB. Ok, it is no problem, to add this line to one file, but how can I make it without js-modifying?
I've tried to put link or button there, but didn't find a way to make it like <record id="message_to_lead" model="ir.actions.server">..</record>
Can someone help me to find a way to make action-button for message, that calls a function in mail.message model?