تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
2368 أدوات العرض

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? 

الصورة الرمزية
إهمال
أفضل إجابة

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.

الصورة الرمزية
إهمال
الكاتب

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

المنشورات ذات الصلة الردود أدوات العرض النشاط
3
أغسطس 19
12815
READONLY PRICE UNIT تم الحل
7
يوليو 19
4764
0
يونيو 19
3171
0
مارس 19
5280
2
سبتمبر 18
3208