我有这个相关图像(只读)字段,一旦我单击编辑,该特定图像字段就会在表单 View 中显示编辑选项。请帮我删除它
字段:-
'emp_img':fields.related('employee_id', 'image_medium', type='char', relation='hr.employee', string='', store=True),
在 xml 中:-
<field name="emp_img" readonly="1" widget='image' class="oe_left oe_avatar" />
在表单 View 编辑中显示如下:
最佳答案
您必须将 effective_readonly
参数传递给管理图像的 image
小部件。
以下应该有效:
<field name="emp_img" readonly="1" widget='image' class="oe_left oe_avatar" attrs="{'effective_readonly': True}" />
或者您可以在 Debug模式下将下面的属性添加到您想要的表单上:
attrs="{ "effective_readonly":True}"/>
关于python - Openerp-如何删除图像上的编辑选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43180422/