Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
6253 Переглядів

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.

Аватар
Відмінити
Найкраща відповідь

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
Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
бер. 21
4675
3
бер. 15
9766
2
лют. 23
3229
2
жовт. 20
5905
2
жовт. 20
4156