Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
5177 Visualizzazioni

I have a module with some fields are readonly.I use onchange function in  this module.The onchange is based on partner_id.
I selected partner_id and some fields are automatically loaded in my form.

phone,email,mobile fields are readonly in my module.When i save the module these fields are automatically disabled. 
I changed these fields readonly =False then it is working properly.The fields do not disabled.
Question

What  are the phenomena behind this concept?

Avatar
Abbandona
Risposta migliore

Hi  Aslam,

The word "Read-only" itself said this cannot be write simply. it is only Readable.

The values of read-only fields  will be display when if there is onchange() method written for thosefields, but values of those fields will not be saved because the field is only in Read mode (Read only).

If you want to write the data inside the Readonly field. you need to override the write() and create() method of ORM.

Hope this will clear your idea about read-only  fields.

Happy Odooing.

Regards,

Anil.
Avatar
Abbandona
Autore

Thanks, Anil, I understand the concept behind readonly

Post correlati Risposte Visualizzazioni Attività
2
giu 17
4125
1
giu 17
4813
1
mag 21
6461
0
apr 20
4260
1
nov 19
4568