javascript - Odoo 9 How to edit chatter opportunity notes view -
i spent plenty of hours, trying solve issue, want edit view of note in chatter in odoo crm.lead, because want add subtype of note (email or note or task etc.) after author of note, know how value have no idea need edit change message view in chatter, know line view declaring whole chatter:
<field name="message_ids" widget="mail_thread"/> so please tell me , need change add subtype note in chatter:
ok guys, always, must myself, post found maybe someone:
you need go static > src > xml > thread.xml there must search in website source thing want edit:
then search o_thread_message_core in xml file
when found need search things our line example res.partner or date can add things, added line code:
<t t-if="message.model == 'crm.lead' && (message.is_note)"> type: <t t-esc="message.subtype_id[1]"/> </t> after all, code of line looks that:
<div t-att-class="'o_thread_message_core' + (message.is_note ? ' o_mail_note' : '')"> <p t-if="message.display_author" class="o_mail_info"> <t t-if="message.is_note"> note </t> <strong t-if="message.mailto"> <a class="o_mail_mailto" t-attf-href="mailto:#{message.mailto}?subject=re: #{message.subject}"> <t t-esc="message.mailto"/> </a> </strong> <strong t-if="!message.mailto && message.author_id[0]" data-oe-model="res.partner" t-att-data-oe-id="message.author_redirect ? message.author_id[0] : ''" t-attf-class="#{message.author_redirect ? 'o_mail_redirect' : ''}"> <t t-esc="message.displayed_author"/> </strong> <strong t-if="!message.mailto && !message.author_id[0]"> <t t-esc="message.displayed_author"/> </strong> <small t-att-title="message.date"> - <t t-esc="message.hour"/> </small> <!-- vvv here added vvv--> <t t-if="message.model == 'crm.lead' && (message.is_note)"> type: <t t-esc="message.subtype_id[1]"/> </t> <!-- ^^^ here added ^^^--> <t t-if="message.model && (message.model != 'mail.channel') && options.display_document_link"> on <a t-att-href="message.url" t-att-data-oe-model="message.model" t-att-data-oe-id="message.res_id"><t t-esc="message.record_name"/></a> </t> <t t-if="message.origin_id && (message.origin_id !== options.channel_id)"> (from <a t-att-data-oe-id="message.origin_id" href="#">#<t t-esc="message.origin_name"/></a>) </t> <span> <i t-if="options.display_stars && !message.is_system_notification" t-att-class="'fa fa-lg o_thread_message_star ' + (message.is_starred ? 'fa-star' : 'fa-star-o')" t-att-data-message-id="message.id" title="mark todo"/> <i t-if="message.record_name && message.model != 'mail.channel' && options.display_reply_icon" class="fa fa-reply o_thread_message_reply" t-att-data-message-id="message.id" title="reply"/> <i t-if="message.is_needaction && options.display_needactions" class="fa fa-check o_thread_message_needaction" t-att-data-message-id="message.id" title="mark read"/> </span> </p> but there 1 more thing yet: subtype wasn't default imported message data need search typical variable isn't normal in message information (for me subtype_description) , find place imported , declared.
i found in static > src > js > chat_manager.js:
as see added line importing subtype_id message info, after can use message.subtype_id in xml value, searching for.
finally in odoo message looks that:
next thing make custom module because did, did on local odoo database, quite easy, issue solved, have nice day ;)




Comments
Post a Comment