跳至内容
菜单
此问题已终结
1 回复
4495 查看

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?

形象
丢弃
最佳答案

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

形象
丢弃
编写者

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

相关帖文 回复 查看 活动
2
12月 23
12863
3
7月 22
23248
1
4月 22
18364
0
1月 22
2437
2
6月 21
18625