Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
4491 มุมมอง

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 :)

Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ธ.ค. 23
12858
3
ก.ค. 22
23243
1
เม.ย. 22
18364
0
ม.ค. 22
2437
2
มิ.ย. 21
18624