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

I have this button

<button name="%(payment_action)d" context="{'ref':investment_id}" string="View Payments" col="1" type="action"/>

This button passes 'investment_id' as 'ref' field through the context written as above. The action looks like this:

<record id="payment_action" model="ir.actions.act_window">

<field name="name">Payments</field>

<field name="res_model">account.move</field>

<field name="view_type">tree</field>

<field name="view_mode">tree</field>

<field name="domain">[('ref','=','ref')]</field>

<field name="view_id" ref="account.view_move_tree"/>

<field name="target">new</field>

</record>

This action displays a list of all journal entries. In journal entries, there is a field called 'ref' which contains a reference ID. I want to display only those journal entries whose 'ref' is same as the 'investment_id' passed by the button into 'ref' field. My current domain in the action displays just a blank tree view. So what domain do I need to write to make this work right?

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

Try,

<field name="domain">[('ref','=',context.get('ref'))]</field>

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 11 24
45478
0
thg 7 24
9389
0
thg 1 21
4772
3
thg 4 17
24433
naked domain set up Đã xử lý
3
thg 7 25
4308