Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
3984 Vues

state = fields.Selection([
                                        ('draft','Draft'),
                                        ('confirm','Confirmed'),
                                        ('process','Processing'),
                                        ('paid','Paid'),        
                                        ('failed','Failed'),
                                        ('success','Success'),
                                        ('cancel','Cancelled')], string='Status', default='draft')

bill_by = fields.Selection([('individual','Individual'),('company','Company')], default="individual", string='Bill by')

<field name="batch_no" attrs="{'readonly': [('state', 'not in', ('paid')), ('bill_by', '!=', 'company')]}"/>


so i want to make batch_no is not readonly when state = paid and  when bill by = company and state = confirm


is that possible ?

Avatar
Ignorer
Meilleure réponse

Hi,

Try the following code

<field name="batch_no" attrs="{'readonly': [('state', 'not in', ['paid','confirm']), ('bill_by', '!=', 'company')]}"/>

Regards

Avatar
Ignorer
Auteur

i already test with this code before you told me. it can't

Publications associées Réponses Vues Activité
1
août 18
5265
3
août 24
16249
1
mars 15
7458
1
mars 24
9057
1
sept. 23
2112