gpt4 book ai didi

python - Openerp-如何删除图像上的编辑选项?

转载 作者:太空宇宙 更新时间:2023-11-04 05:10:11 26 4
gpt4 key购买 nike

我有这个相关图像(只读)字段,一旦我单击编辑,该特定图像字段就会在表单 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 编辑中显示如下:

enter image description here

最佳答案

您必须将 effective_readonly 参数传递给管理图像的 image 小部件。

以下应该有效:

<field name="emp_img" readonly="1" widget='image' class="oe_left oe_avatar" attrs="{'effective_readonly': True}" />

或者您可以在 Debug模式下将下面的属性添加到您想要的表单上:

attrs="{ &quot;effective_readonly&quot;:True}"/>

关于python - Openerp-如何删除图像上的编辑选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43180422/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com