← Back to team overview

openerp-community team mailing list archive

Re: Solution/Example for displaying icons in a Tree View (OpenERP 6.1)?

 

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: openerp-community-bounces+office=conexus.at@xxxxxxxxxxxxxxxxxxx [mailto:openerp-community-bounces+office=conexus.at@xxxxxxxxxxxxxxxxxxx] Im Auftrag von Eric Caudal
Gesendet: Mittwoch, 27. Juni 2012 13:19
An: openerp-community@xxxxxxxxxxxxxxxxxxx
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:image002.jpg@01CD546A.13996920]


Eric CAUDAL, Elico Corp, Shanghai.

eric.caudal@xxxxxxxxxxxxxx<mailto:eric.caudal@xxxxxxxxxxxxxx>

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

Premium Certified Training Partner - OpenERP Ready Partner.


[cid:image004.png@01CD546A.13996920]
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     : openerp-community@xxxxxxxxxxxxxxxxxxx<mailto:openerp-community@xxxxxxxxxxxxxxxxxxx>

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

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

JPEG image

PNG image


Follow ups

References