Skip to Content
Menu
This question has been flagged
1 Atsakyti
3997 Rodiniai

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 ?

Portretas
Atmesti
Best Answer

Hi,

Try the following code

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

Regards

Portretas
Atmesti
Autorius

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

Related Posts Replies Rodiniai Veikla
1
rugp. 18
5276
3
rugp. 24
16288
1
kov. 15
7498
1
kov. 24
9290
1
rugs. 23
2127