How to set an attribute of a field like this self._fields['name'].readonly=True ?
No errors but it does not work.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
How to set an attribute of a field like this self._fields['name'].readonly=True ?
No errors but it does not work.
Do you wish to make the field readonly? In this case you either define it on the just created field (something like: your_field = fields.Char(string='My string', readonly=True)
or in XML by doing this:
<field name="your_field" readonly="1"/>
I need to be able to write into a field and later on some conditions make the field readonly. As I know it can be done with 'state' field in this way:
my_field=field.Char(readonly=True, states={'draft': [('readonly', False)]})
Set the readonly in python code, like this:
my_field = fields.Char(readonly=True)
or in a xml, like this:
<field name="my_field" readonly="1"/>
| 관련 게시물 | 답글 | 화면 | 활동 | |
|---|---|---|---|---|
|
0
2월 25
|
2106 | |||
|
0
1월 25
|
1837 | |||
|
Field service upgrade
해결 완료
|
1
12월 24
|
2303 | ||
|
1
12월 23
|
1977 | |||
|
1
6월 22
|
6744 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.