Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
3 Risposte
5062 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Risposta migliore

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
Abbandona
Autore Risposta migliore

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
Abbandona

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.

Post correlati Risposte Visualizzazioni Attività
3
mar 21
5651
4
nov 23
8491
1
mar 15
7598
5
ago 24
46625
1
mag 24
2547