Se rendre au contenu
Menu
Cette question a été signalée
3 Réponses
5063 Vues

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
Ignorer
Meilleure réponse

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
Ignorer
Meilleure réponse

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
Ignorer
Auteur Meilleure réponse

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
Ignorer

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.

Publications associées Réponses Vues Activité
3
mars 21
5651
4
nov. 23
8491
1
mars 15
7598
5
août 24
46625
1
mai 24
2547