Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
6194 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
bře 21
4645
3
bře 15
9723
2
úno 23
3187
2
říj 20
5873
2
říj 20
4131