Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
8129 Lượt xem

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 ?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

What was happening is that apparently on Odoo you can't write a value to a readonly field, so on my XML I doubled my field that was readonly, and the new one I made it just invisible, and now it works perfectly. This is something that I also discovered, you don't need to declare a new field on the .py file and create it on the XML, you can just copy and paste your field, remove the readonly attribute, and add an invisible attribute, works perfectly.


https://stackoverflow.com/questions/50845078/odoo-readonly-field-doesnt-save-value-on-onchange

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello!Actually Probability field's value is dependant upon stage_id field ,there is an onchange method on stage_id so if you put readonly on probability field than it will not store value when you save record because it's readonly. But there is an option to store value in such kind of situation, i.e you have to override create and write method for crm.lead and assign value in probability field from there.

Thanks,
Acespritech Solutions Pvt. Ltd.
Mail: info@acespritech.com
Skype: acespritech
Blog: acespritechblog.wordpress.com

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 3 25
4229
1
thg 12 22
2870
Lead Generation Đã xử lý
3
thg 5 24
3387
3
thg 12 22
23786
2
thg 6 21
6298