On CRM
opportunity form view, i added readonly="1"
for probability field. When i saved, whatever the value of my probability, it's stored with NULL value.
Is it a bug on OpenERP
?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
In openerp Readonly field is use to just display the content but it will not store any data in database. So it is displaying Null value. Readonly is just for informative purpose only.
change your probability field to function field, and write a function (ex _get_probability). And keep the current probability calculating function as it is. Now default probability calculate function display the value and second function (_get_probability) will save the value.
We have two values like client side and server side. In Server side coding done like float value have 0.0 etc. Read only field doesn't take value from the Client side because it's read only. In View, we see that 0.0 for float value because of server side coding. If you remove read only attribute, you can get value from the Client side and that value pass to the Server and store into the Database. Field with read only attribute, can't get value from the client side and store NULL into the Database.
Hope this will help you.
I think its a bug in openerp. I have created a patch for that. In the openerp addons, web module, goto static/src/js/view_form.js.