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

Hi everyone, I have a problem on a readonly field in which its value disappears when I am saving a record in odoo 10. Can you help me about this problem? 

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

Hi,

As you are using odoo 10, you have to use an OCA module:  Read Only ByPass


This module changes the behaviour of Odoo by propagating on_change modifications to readonly fields to the backend create and write methods.

To change that behavior you have to set context on ir.actions.act_window:


{'readonly_by_pass': True}

or by telling fields allowed to change:



{'readonly_by_pass': ['readonly_field_1', 'readonly_field_2',]}


On one2many fields, you can also pass the context in the field definition:


From the version 11 and above, we can use force_save="1" along with the field.

Ảnh đại diện
Huỷ bỏ
Tác giả

Thank you very much for this Niyas Raphy. I appreciated it.

Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 8 19
12837
READONLY PRICE UNIT Đã xử lý
7
thg 7 19
4774
0
thg 6 19
3175
0
thg 3 19
5291
2
thg 9 18
3232