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

Hello my friends;

I have an action type ir.actions.act_window. I have some data values to pass to a field through  context.

I do not know if default values are juste giving with active_id or some like default for char or integer.

My field is many2many.

I have tried this but it is not working.

{'default_delivery_types':record.carrier_id.id}

Need Your help please.

Thanks a lot in advance.

Best regards.

อวตาร
ละทิ้ง

How to use context: https://goo.gl/XXg5D3

คำตอบที่ดีที่สุด

For many2many (X2many) field you have to pass a list of ids which you want to set/link by default while creating a new record

so try

​{'default_delivery_types': [record.carrier_id.id]}

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.พ. 22
2191
3
มิ.ย. 19
7169
1
มี.ค. 24
2799
1
ม.ค. 25
1364
Odoo Mail Sending Limit แก้ไขแล้ว
2
ธ.ค. 23
14753