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.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Buchhaltung
- Lager
- PoS
- Project
- MRP
Diese Frage wurde gekennzeichnet
1
Antworten
6178
Ansichten
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
Diskutieren Sie gerne? Treten Sie bei, statt nur zu lesen!
Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!
RegistrierenVerknüpfte Beiträge | Antworten | Ansichten | Aktivität | |
---|---|---|---|---|
|
1
März 21
|
4638 | ||
|
3
März 15
|
9714 | ||
|
2
Feb. 23
|
3179 | ||
|
2
Okt. 20
|
5866 | ||
|
2
Okt. 20
|
4125 |