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 ?

 

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.

Index: view_form.js
===================================================================
--- openerp/addons/web/static/src/js/view_form.js   
+++ openerp/addons/web/static/src/js/view_form.js   
@@ -833,11 +833,9 @@
                     // Special case 'id' field, do not save this field
                     // on 'create' : save all non readonly fields
                     // on 'edit' : save non readonly modified fields
-                    if (!f.get("readonly")) {
-                        values[f.name] = f.get_value();
-                    } else {
-                        readonly_values[f.name] = f.get_value();
-                    }
+                   values[f.name] = f.get_value();
+                    if (f.get("readonly"))
+                       readonly_values[f.name] = f.get_value();
                 }
             }
             if (form_invalid) {

相关文章:

  • 2021-05-30
  • 2017-12-04
  • 2021-11-12
  • 2021-07-01
  • 2021-11-03
  • 2022-12-23
  • 2021-07-25
猜你喜欢
  • 2022-12-23
  • 2021-07-25
  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
  • 2022-12-23
  • 2021-06-15
相关资源
相似解决方案