Skip to Content
Menú
This question has been flagged
1 Respondre
3689 Vistes

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
Descartar
Best Answer

Hi,

Try the following code

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

Regards

Avatar
Descartar
Autor

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

Related Posts Respostes Vistes Activitat
1
d’ag. 18
4982
3
d’ag. 24
15789
1
de març 15
7179
1
de març 24
5616
1
de set. 23
1832