Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
3726 Tampilan

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
Buang
Jawaban Terbai

Hi,

Try the following code

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

Regards

Avatar
Buang
Penulis

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

Post Terkait Replies Tampilan Aktivitas
1
Agu 18
5009
3
Agu 24
15825
1
Mar 15
7207
1
Mar 24
5755
1
Sep 23
1861