Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
5 Trả lời
9660 Lượt xem

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

Ảnh đại diện
Huỷ bỏ

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

Tác giả

I did indeed. Works as expected.

Câu trả lời hay nhất


<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"/>

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

 

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 10 24
68942
2
thg 12 23
25510
1
thg 10 21
9415
0
thg 1 21
2198
2
thg 8 18
3723