Community mailing list archives

community@mail.odoo.com

Re: Referencing a Many2many field in a format string in a Kanban view

by
Hieu Nguyen
- 08/21/2015 03:31:54
Thank you for your response, Leonardo.

A single integer is what I get from `record.pages.raw_value[0]` since odoo creates a separate table to store ids for many2many relationships. Is there anyway we can reference many2many field in {{ }} format string?

Regards,
Hieu

On 14/08/15 18:23, Leonardo "LeartS" Donelli wrote:
<blockquote cite="mid:CADMExDFFo-krfAf8FFDFs4zFn5q-DLF0XUdTBzZqDR0vbhFczQ@mail.gmail.com" type="cite">
2015-08-10 15:16 GMT+02:00 Hieu Nguyen <hieutngn@gmail.com>:
> Hello everyone,
>
> In my Kaban views, I have a Many2many field named "pages". If i used " name="pages" />", it works fine and show the Many2many tags. However, if I
> use: "".
>
> The part {{ record.pages.raw_value[0].site }} return undefined when I check
> with Firebug.

I should check, but I think that ``raw_value`` returns just the list
of ids, so you can't refer to the related fields. In your case,
``record.pages.raw_value[0]`` is just a single integer (the id of the
first record), so ``.site`` is undefined

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe