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

Hi there!

What I need to do:
Disable the "Create..." and "Create and edit..." options from Many2one field dropdown menu based on the value of anorhter field in the same model and view, using only XML files.

What I know:
1) options field attribute doesn't accept reference to another field value directly ('condition_field_name'), and also can't use context.get(). So the examples below don't work:

<field name="my_m2o_field" options="{'no_create': [('condition_field_name', '=', False)]}"/>

<field name="my_m2o_field" options="{'no_create': context.get('conition_field_name', 'False')}" context="'conition_field_name': condition_field_name"/>

2) can_create field attribute seems not to be working even with plain "False" / "True" values.

Any help is really appreciated. 

Also, if anyone has any sort of documentation available on this matter, please share! 

Thanks.


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
เม.ย. 22
18364
0
ม.ค. 22
2376
2
ก.พ. 19
6541
Showing many2one fields in other modules แก้ไขแล้ว
2
ก.พ. 18
12307
2
ก.ค. 25
373