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

Hi all,

Is the following trick to force a view for a field still available in v7 ?

<field name="my_many2many" context="{'tree_view_ref' : 'my_module.my_model_tree_view'}" />

I used it on a many2many field , but it doesn't seem to have any effect .. (nor openerp complains about it)

cheers

อวตาร
ละทิ้ง

Hy, didi you succeed in making this work even with the answer below? Regards

ผู้เขียน

I did indeed. Works as expected.

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


<field name="my_many2many" context="{'tree_view_ref' : 'my_module.my_model_tree_view'}" />

but where you define the view 'my_model_tree_view' ..make priority same as the default view for the many2many or many2one model <field eval="7" name="priority"/>

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Some little tips :

  1. Did you check which view is called from the action?
  2. Maybe the form view called is not the correct one (check priority)
  3. In the web UI, update your module

Hope it can help

 

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

It should work for at least one2many fields since it is also used in the stock.picking object in file stock/stock_view.xml:

<field name="move_lines" context="{'address_in_id': partner_id, 'form_view_ref':'view_move_picking_form', 'tree_view_ref':'view_move_picking_tree', 'picking_type': 'internal'}"/>

You can try to remove the my_module. before the name for the view.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ต.ค. 24
69005
2
ธ.ค. 23
25552
How do I search by country_id in view? แก้ไขแล้ว
1
ต.ค. 21
9444
0
ม.ค. 21
2210
fields context no working แก้ไขแล้ว
2
ส.ค. 18
3741