İçereği Atla
Menü
Bu soru işaretlendi
3 Cevaplar
5054 Görünümler

Greeting,

 I create two menu with difference domain for filtering, I have 2 type of document, 

- Payment Voucher - will select 'supplier' only for receiver

- Receive Voucher - will select 'customer' only as sender


how can I achieve this in same view.? I has field 'doctype' to separate between 'payment_voucher' and 'receive_voucher', but got stuck on how to customize "same" view with difference filter


Thank you in advanced,


Avatar
Vazgeç
En İyi Yanıt

Do you want to visible/invisible some fields according to that filter? If yes then you can use attrs. Base on condition you can invisible/readonly some fields in same view.

You can add domain on condition base like :-   <field name="partner_id" domain="[('customer','=', doctype == 'payment_voucher' and True or False)]"/>
Make sure you added "doctype" field invisible in form.



 

Avatar
Vazgeç
En İyi Yanıt

Hello, 

see the example at menu invoicing/accounting, find the menu "payments". here is the example as per your requirement. from  the customers payment menu, in field partner you can see only partner where customer checkbox is checked and from suppliers payment menu, in the field partner you can see only partner which has supplier checkbox is checked.

Avatar
Vazgeç
Üretici En İyi Yanıt

Hi Yogesh,

  Thank you for your recommendation, below is more specific detail for my requirement. I have 2 menu's action as below

(1) after click this menu, I would like to show customer list in form with field => <field name="partner_id" domain="[('customer','=','True')]"

<act_window id="action_payment_voucher" name="Payment Voucher" res_model="xpayment.xpayment" view_mode="tree,form" domain="[('doctype','=','payment_voucher')]" />

(2) after click this menu, I would like to show supplier list in form with field =><field name="partner_id" domain="[('customer','=','False')]"

<act_window id="action_receive_voucher" name="Receive Voucher" res_model="xpayment.xpayment" view_mode="tree,form" domain="[('doctype','=','receive_voucher')]" />

so any recommendation on this ?

Avatar
Vazgeç

You can add domain on condition base like :- <field name="partner_id" domain="[('customer','=', doctype == 'payment_voucher' and True or False)]"/>

Make sure you added "doctype" field invisible in form.

İlgili Gönderiler Cevaplar Görünümler Aktivite
3
Mar 21
5643
4
Kas 23
8489
1
Mar 15
7597
5
Ağu 24
46618
1
May 24
2546