Skip to Content
Menu
This question has been flagged
1 Atsakyti
4505 Rodiniai

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?

Portretas
Atmesti
Best Answer

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

Portretas
Atmesti
Autorius

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

Related Posts Replies Rodiniai Veikla
2
gruod. 23
12883
3
liep. 22
23268
1
bal. 22
18364
0
saus. 22
2442
2
birž. 21
18627