Odoo Help


Get and display the last message associated with a project?

Lee Young
on 12/1/15, 2:08 PM 1,086 views

I am trying to display the last message or note associated with a project in a kanban view. I have the following in a view, but there isn't a value being displayed even though I am sure there are notes on the project. Does anyone have any idea where this might be going wrong?

I removed the irrelevant portions of the xml.

<kanban class="oe_background_grey o_kanban_dashboard o_project_kanban">
     <field name="message_ids"/>
         <div t-if="record.message_ids &amp;&amp; record.message_ids.length &gt; 0">
             <span class="fa fa-comment-o">
                 <t t-esc="record.message_ids[-1].date"/>

At line
div t-if="record.message_ids && record.message_ids.length > 0"
you should use "and" where you are taking "&&"(if i am right, you are using it as && 'and' operator) as its totally working on python systax...
so it should be like:
div t-if="record.message_ids and record.message_ids.length > 0"

on 12/2/15, 5:14 AM

Pawan, Thank you for your reply. I am getting the error; Uncaught TypeError: Cannot read property 'date' of undefined I have tried using message_ids[0].date as well. If I put message_ids.raw_value I do see the list of ids. Any ideas?

Lee Young
on 12/2/15, 9:28 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 12/1/15, 2:08 PM
Seen: 1086 times
Last updated: 2/25/16, 1:52 AM