跳至內容
選單
此問題已被標幟
1 回覆
4498 瀏覽次數

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
12868
3
7月 22
23252
1
4月 22
18364
0
1月 22
2437
2
6月 21
18626