Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
4513 Prikazi

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
Opusti
Best Answer

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

Avatar
Opusti
Avtor

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

Related Posts Odgovori Prikazi Aktivnost
2
dec. 23
12886
3
jul. 22
23282
1
apr. 22
18364
0
jan. 22
2450
2
jun. 21
18634