Odoo Help


This community 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.


Get and display the last message associated with a project?

Lee Young
on 12/1/15, 2:08 PM 437 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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


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