Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
3743 Widoki

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 ?

Awatar
Odrzuć
Najlepsza odpowiedź

Hi,

Try the following code

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

Regards

Awatar
Odrzuć
Autor

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

Powiązane posty Odpowiedzi Widoki Czynność
1
sie 18
5030
3
sie 24
15827
1
mar 15
7211
1
mar 24
5802
1
wrz 23
1869