英文:
How to Show image in tree view when there are no records?
问题
Sure, here's the translated code portion:
我想在树视图中显示图像,当没有记录时。这是否可能在此代码内部。
<record id="action_partner_form" model="ir.actions.act_window">
<field name="name">Customers</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.partner</field>
<field name="view_mode">kanban,tree,form</field>
<field name="context">{'res_partner_search_mode': 'customer'}</field>
<field name="search_view_id" ref="view_res_partner_filter"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
在您的地址簿中创建联系人
</p><p>
Odoo可以帮助您跟踪与您的联系人相关的所有活动。
</p>
</field>
</record>
The HTML code you mentioned, <img src="static/description/icon.png"/>
, is already in the provided code. If it's not displaying an image, you may want to check the image path and make sure it is correct and the image file is accessible at that location.
英文:
I want to show image in tree view when there are no records. Can this be possible inside this code.
<record id="action_partner_form" model="ir.actions.act_window">
<field name="name">Customers</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.partner</field>
<field name="view_mode">kanban,tree,form</field>
<field name="context">{'res_partner_search_mode': 'customer'}</field>
<field name="search_view_id" ref="view_res_partner_filter"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a Contact in your address book
</p><p>
Odoo helps you track all activities related to your contacts.
</p>
</field>
</record>
I tried to put <img src="static/description/icon.png"/>
in help but it is showing as no image.
答案1
得分: 1
需要在src中添加模块名称,如下所示:
<img src="/base/static/description/icon.png" class="img img-fluid o_we_custom_image"/>
英文:
You need to add the module name in the src as below:
<img src="/base/static/description/icon.png" class="img img-fluid o_we_custom_image"/>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论