Skip to Content
Menú
This question has been flagged
1 Respondre
4499 Vistes

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

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

Avatar
Descartar
Autor

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

Related Posts Respostes Vistes Activitat
2
de des. 23
12869
3
de jul. 22
23253
1
d’abr. 22
18364
0
de gen. 22
2437
2
de juny 21
18626