Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
7229 Visualizzazioni

I found that a field could be made required based on the state of the record, using the state expression as follows:

'check_total': fields.float('Verification Total', digits_compute=dp.get_precision('Account'), readonly=True,  states={'draft':[('readonly',False)]}),

where this is a field in the account_invoice table

I need to extend this behavior to use any other field, how can I achieve this.


Avatar
Abbandona
Risposta migliore

I don't know if it's possible on a field definition level, but on a view level it is :

<field name="default_debit_account_id" attrs="{'required':[('type','in', ('cash', 'bank'))]}" />
Avatar
Abbandona
Autore

Thx for help, it worked fine. I 'm also pleased that I'm the first one who upvoted one of your answers.

Post correlati Risposte Visualizzazioni Attività
6
dic 15
14446
3
mag 25
1611
1
apr 25
1219
3
set 24
14073
2
feb 24
2395