コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
3929 ビュー

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 ?

アバター
破棄
最善の回答

Hi,

Try the following code

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

Regards

アバター
破棄
著作者

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

関連投稿 返信 ビュー 活動
1
8月 18
5199
3
8月 24
16153
1
3月 15
7402
1
3月 24
8559
1
9月 23
2048