Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
6179 Visninger

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
Kassér
Bedste svar

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
Kassér
Related Posts Besvarelser Visninger Aktivitet
1
mar. 21
4638
3
mar. 15
9714
2
feb. 23
3179
2
okt. 20
5866
2
okt. 20
4125