Domanda

I want to make some fields (checkboxes) readonly if the record is saved. the next assigned person can change in some fields. But some fields must be restricted that no body can change them. One way is to do so is to put user or group rights. But I want it in another way. Any way there?

È stato utile?

Soluzione

This condition is work perfectly

<field name="freezing_on_all_channels" attrs="{'readonly':[('id','!=', False)]}"/>

or attrs="{'readonly':[('id','!=',0)]}" (note: the 0 not in quotes '0'),

you just made one mistake; if you put <"field name="id" invisible="1"/> in the view as well, then it will work as expected.

Thanks

Altri suggerimenti


It's possible when state is change.
You can do it by writing "attrs={}" attribute in your .xml.
For example:

< field name="your_field" attrs="{'readonly':[('state','=','saved')]}"/>


Hope this will solve your problem.
Thank You...

try with below

'your_field': fields.char('Name', type='char',store=True,readonly=True),
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top