Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
6244 Visualizações

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
Cancelar
Melhor resposta

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
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
1
mar. 21
4663
3
mar. 15
9738
2
fev. 23
3215
2
out. 20
5897
2
out. 20
4145