İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
6263 Görünümler

i need a option once i click a button, particular field option should be change to readonly in form. Is it possible to change a field with readonly, after pressing a button? Explain me in detail with example.

Avatar
Vazgeç
En İyi Yanıt

After Clicking the button Can Update the record State

And set field readonly based on Updated record state

For example,

'name': fields.char('Date', size=64, states={'new': [('readonly', True)]}),

def button_click(self, cr, uid, ids, context=None):
    self.write(cr, uid, ids, {'state': 'new'}, context=context)
    return True
Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Mar 21
4678
3
Mar 15
9775
2
Şub 23
3236
2
Eki 20
5915
2
Eki 20
4160