Thank you for your answer, but I'm in need of displaying custom icons according 
to a field value of a record line.
So far icons can only be set for buttons, or am I wrong?

Von: [email protected] 
[mailto:[email protected]] Im 
Auftrag von Eric Caudal
Gesendet: Mittwoch, 27. Juni 2012 13:19
An: [email protected]
Betreff: Re: [Openerp-community] Solution/Example for displaying icons in a 
Tree View (OpenERP 6.1)?

I would follow what is done in the following code:

    <!-- CRM Lead Tree View -->

    <record model="ir.ui.view" id="crm_case_tree_view_leads">
        <field name="name">Leads</field>
        <field name="model">crm.lead</field>
        <field name="type">tree</field>
        <field name="arch" type="xml">
            <tree string="Leads"  colors="blue:state=='pending';grey:state in 
('cancel', 'done')">
                <field name="date_deadline" invisible="1"/>
                <field name="create_date"/>
                <field name="name" string="Subject"/>
                <field name="contact_name"/>
                <field name="country_id" 
invisible="context.get('invisible_country', True)" />
                <field name="email_from"/>
                <field name="phone"/>

                <field name="categ_id" invisible="1"/>
                <field name="type_id" invisible="1"/>
                <field name="referred" invisible="1"/>
                <field name="channel_id" invisible="1"/>
                <field name="subjects" invisible="1"/>

                <field name="stage_id"/>
                <button name="stage_previous" string="Previous Stage"
                    states="open,pending" type="object" icon="gtk-go-back" />
                <button name="stage_next" string="Next Stage"
                    states="open,pending" type="object"
                    icon="gtk-go-forward" />
                <field name="section_id" 
invisible="context.get('invisible_section', True)" />
                <field name="user_id" />
                <field name="state" />
                <button name="case_open" string="Open"
                    states="draft,pending" type="object"
                    icon="gtk-go-forward" />
                <button name="case_close" string="Close"
                    states="open,draft,pending" type="object"
                    icon="gtk-close" />
                <button name="%(crm.action_crm_lead2opportunity_partner)d"
                    string="Convert to Opportunity"
                    states="draft,open,pending" icon="gtk-index"
                    type="action" />
                <button name="case_escalate" string="Escalate"
                    states="open,draft,pending" type="object"
                    icon="gtk-go-up" />
            </tree>
        </field>
    </record>

You need to place your png file in the following 
directory:path-to-your-openerp/openerp/addons/web/static/src/img/icons


[cid:[email protected]]


Eric CAUDAL, Elico Corp, Shanghai.

[email protected]<mailto:[email protected]>

Cell: + 86 186 2136 1670. Skype: elico.corp

Premium Certified Training Partner - OpenERP Ready Partner.


[cid:[email protected]]
http://www.openerp.net.cn

On 06/27/2012 06:52 PM, Sven Petersen wrote:
Hello Community!

does anyone know of a Solution or Example for displaying (custom) icons in a 
Tree View (OpenERP 6.1)?

Thanks in Advance!

with kind regards,
conexus,
Sven Petersen




_______________________________________________

Mailing list: https://launchpad.net/~openerp-community

Post to     : 
[email protected]<mailto:[email protected]>

Unsubscribe : https://launchpad.net/~openerp-community

More help   : https://help.launchpad.net/ListHelp

<<inline: image002.jpg>>

<<inline: image004.png>>

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp

Reply via email to