i have an Problem with Openerp 7.0. I want to loop over a one2many Field. Here is my Model class:
class my_class(osv.osv):
_name = "my.name"
_inherit = 'mail.thread'
_columns = {
'partners' : fields.one2many('my.other.class', 'other_id' , 'partner'),
}
my_class()
class my_other_class(osv.osv)
_name = 'my.other.class'
_columns = {
'type' : fields.char( .... ),
....
'other_id' : fields.many2one('my.class')
}
my_other_class()
And the XML Part File:
<t t-foreach="record.partners.raw_value" t-as="p">
<div>
Out:
<t t-esc="p" />
<t t-esc="p.type" />
<t t-esc="p.cid" />
<t t-esc="p.notification" />
</div>
</t>
I have multible Partners:
- ID TYPE NOTIFICATION
- 1 Customer True
- 2 Installer True
- 3 Employee False
If i run the Code, it only prints: Out: 12 Out: 13
12,13 are the internal IDs
How can i loop correctly over my one2many Field? I found many solutions for Odoo 8, but they dont work at Openerp 7 :/
Thank you, AntiMuffin