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

I want to put an image inside a button of a custom module in odoo 9.


I have 2 buttons in my_module.xml:

<?xml version="1.0"?>
<openerp>
    <data>
        <record id="view_my_module_tree" model="ir.ui.view">
            <field name="name">my.module.tree</field>
            <field name="model">my.module</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="my_module_tree" create="false" delete="false">
                    <button name="button_form" icon="cat" type="object"/>
                    <button name="button_form" icon="dog" type="object"/>                   
                </tree>
            </field>
        </record>  
    </data>
</openerp>


That works if the icons 'cat.png' and dog.png' are inside 'addons/web/static/src/img/icons/'. But I want to put this icons in my custom module.

I have created the 'my_module/static/src/img/icons/' hierarchy and put both images inside, but none of them appear in the buttons.

What I am doing wrong?

Do I need to put something in openerp.py file?

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ก.ย. 19
3843
why the print button does not work แก้ไขแล้ว
1
ก.ย. 19
3974
0
ธ.ค. 17
5613
1
เม.ย. 16
4216
3
ม.ค. 19
6180