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

Hi. I created a model called PC that has a Many2One field called  x_studio_pc_owner which lets you define who owns the PC. My customer model has a custom One2Many relationship which shows which PCs it owns.

In my invoice, I want to choose a PC, only if my customer owns it.


I tried setting up a domain rule in the Invoice Many2One field but it does not work.

I tried this: [('x_studio_pc_owner','=','parent.partner_id')] to see if it would filter my results but it returns nothing.


Please help!

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

Hi,

You need to mention the id of partner in your domain, instead of that you mentioned your record, do as like this

[('x_studio_pc_owner','=','parent.partner_id.id')] 

Regards

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 7 21
2748
1
thg 2 20
3581
1
thg 12 16
17461
3
thg 3 25
2903
1
thg 10 24
1753