2

I would like to know if it's possible to show a One2many field in a kanban view in Odoo (note that I'm not talking about Qweb in templates or reports, only about Qweb in kanban views).

I have a model which has a One2many field named other_contact_ids. I want to show the name of each contact in the kanban view:

<t t-foreach="record.other_contact_ids.raw_value" t-as="contact">
   <p>
      <t t-esc="contact.name"/>
   </p>
</t>

I'm getting an error, because the t-as is storing only the ID of the objects in contact instead of storing the whole object with its fields.

And I think that may be this problem is much related to another question I did earlier: How to use the dot notation in a kanban view in Odoo?

Of course I've tried a lot of ways, for example without using raw_value. And then it shows me the list of attributes of the tag field, like required, invisible, depends, value, raw_value, etc...

I've looked for other t-foreach in kanban and for the moment I didn't find anything, so I'm starting to think that it's not possible. Am I right?

Community
  • 1
  • 1
forvas
  • 9,801
  • 7
  • 62
  • 158
  • Please refer this site... https://stackoverflow.com/questions/39038862/how-to-access-one2many-fields-values-on-kanban-view-odoo-0-8 – Vibha Kachhela Feb 22 '18 at 12:15
  • Please use this site... https://stackoverflow.com/questions/39038862/how-to-access-one2many-fields-values-on-kanban-view-odoo-0-8 – Vibha Kachhela Feb 22 '18 at 12:16

3 Answers3

1

Yes, with web_one2many_kanban module is available in apps for V7, V8 and V9. Thanks to Serpent Consulting

StackUP
  • 1,233
  • 12
  • 22
0

If you go to customer view, then there is a tab called contacts. It is actually a one2many to partner model itself. It think it will be helpful.

OmaL
  • 5,037
  • 3
  • 31
  • 48
  • Thank you @OmaL! But that's a form view (I'm in a kanban view), and as they are in a form view, they can use the widget `one2many_list` and add a kanban tag inside. Even so, I've tried the same, why not?, just to try, and I added in my kanban view a field with the `one2many_list` widget and another kanban inside it, but it seems to have no effect. – forvas Jun 15 '15 at 16:10
0

If it is an image

rooms = fields.One2many('block.rooms', 'block_id')

<t t-foreach="record.rooms.raw_value" t-as="room">
    <img t-att-src="kanban_image('block.room', 'image_field_name', room)" t-att-data-member_id="room"/> 
</t>
Shameem
  • 2,664
  • 17
  • 21