Skip to Content
Menu
This question has been flagged
1 Reply
3680 Views

Odoo v13

I defined field:

my_field = fields.One2many('another.model', 'my_inverse_name', domain="[('another_field', 'in', ????????)]")
<odoo>
    <data noupdate="0">
        <record model="my.magic.model" id="my_magic_id">
            <field name="name">Whatever</field>
        </record>
  </data> </odoo>

I want to write domain depending on record xml id. 

How can I do that?

Avatar
Discard
Best Answer

you can write self.env.ref('my_magic_id').id

Avatar
Discard
Author

Thank You. I saw this solution, but it doesn't work. I used raw database ids. +1 Hilar from me :)

Related Posts Replies Views Activity
2
Dec 23
11087
3
Jul 22
20956
1
Apr 22
18364
0
Jan 22
1349
2
Jun 21
16961