首页 > 代码库 > ReadOnly field saved with NULL value
ReadOnly field saved with NULL value
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) {
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。