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

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

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
Buang
Post Terkait Replies Tampilan Aktivitas
1
Mar 21
4850
3
Mar 15
10004
2
Feb 23
3423
2
Okt 20
6076
2
Okt 20
4285