Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
6 ตอบกลับ
25494 มุมมอง

Hi,

I have created a custom module and placed the app icon under module_name/static/description/icon.png but the image won't display in apps screens. What am i missing?

P.S: I have also tried placing the icon under module_name/static/img/icon.png, this didn't work as well!

I'm using Odoo V12

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello ,

Check below code may be it's help you

Like define your icon path in web_icon.

<menuitem id="rental__management_menu"
name="Rental"
web_icon="rental,static/description/icon.png"/>


Thanks






อวตาร
ละทิ้ง
ผู้เขียน

It throws an error saying it didn't find the view in parent view. Maybe i'm defining it in the wrong file, where do you think i should define this?

may be this error because of parent menu.

and this code is define in your xml file where you define your menu item.

below check you define like

<menuitem name="Rental Management" id="rental_management" web_icon="rental,static/description/icon.png"/>

In above code this is your main menu and your below code is your child menu.

<menuitem name="Record" id="menu_record_rental" parent="rental_management" sequence="1"/>

ผู้เขียน

Hi Manish,

Thank you for you answer, I have tried this but still the logo image was not displaying in app modules screen.

Can you share your code ?

ผู้เขียน

I got the issue cleared, it was a stupid mistake though. Thanks for your timely reply :)

The issue was i was using windows and the png file extension was in caps like PNG, now in windows it didn't matter but Linux didn't accept it so changing it lowercase solved it.

คำตอบที่ดีที่สุด

Web icon:

https://github.com/odoo/odoo/blob/12.0/addons/crm/views/crm_views.xml#L12

อวตาร
ละทิ้ง
ผู้เขียน

Thanks for the link, though it didn't solve my problem it sure helped me to know stuff :)

คำตอบที่ดีที่สุด

           menuitem id="menu_item_id"

​ name="Your Module name or menu you want to show"       

            web_icon="Your_module,static/description/icon.png"/>


-> Your main menu_item write this . 

web_icon = "Your module name, static/description/icon.png"/>



อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Your icon image should be 64x64 and also the "rental,static/description/icon.png" should be module name

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi 

1- Upgrade base module 

2- restart server

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

In my case, it wasn't the filename that was the issue, but the file permission.

Ensure that your file is system readable:

chmod 755 static/description/icon.png

 
อวตาร
ละทิ้ง

755 is not required, 644 should be enough

In my case I had to restart server after changed permissions

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.พ. 25
1820
2
ก.พ. 25
1439
2
มี.ค. 25
5140
2
พ.ย. 24
1853
1
พ.ค. 24
1891