This question has been flagged
1 Reply
5101 Views

I was asked to change the thread view that shows at the bottom of pages.


I've created a file and loaded it in the __manifest__.py 


Here's the code:..


<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">

<t t-extend="mail.ChatThread.Message" t-name="ChatThread">
<t t-jquery=".o_mail_timestamp" t-operation="replace">
<small class="o_mail_timestamp" t-att-title="message.date">
<t t-esc="message.date"/>
</small>
</t>
</t>

</templates>


However, changes are not applied. Has anyone done this before?
Avatar
Discard
Best Answer

You could do it like:

<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">

<t t-extend="mail.ChatThread.Message">
<t t-jquery=".o_mail_timestamp" t-operation="replace">
<small class="o_mail_timestamp" t-att-title="message.date">
<t t-esc="message.date"/>
</small>
</t>
</t>

</templates>

Using different values for t-extend and t-name will create a new template with the value name of t-name that will inherit from the template with the value name of t-extend. Like models prototypal inheritance

Using just t-extend will inherit the original template in-place without creating a new one. The same applies for using only t-name overriding completely the original template and also using t-extend and t-name with the same value of the original template creating a new template with the name of the original one that inherits from that original one (no need to complicate it like that but works)



Avatar
Discard
Author

Thanks Alex!

how can i do same code in V14