Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
6260 Представления

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
4677
3
мар. 15
9771
2
февр. 23
3232
2
окт. 20
5913
2
окт. 20
4159