Community mailing list archives

community@mail.odoo.com

Re: Record in tree view with different colors

by
maalej mohamed
- 02/19/2016 14:05:41
of course with pleasure

        </record>
                <record id="view_article_tree" model="ir.ui.view">
                <field name="name">view.article.tree</field>
                <field name="model">article.article</field>
                <field name="arch" type="xml">
                    <tree colors="red:not(marg>60)">
                        <field name="name"/>
                        <field name="dp"/>
                        <field name="pa"/>
                        <field name="marg"/>
                        <field name="pv"/>
                    </tree>
                </field>
            </record>


Le Vendredi 19 février 2016 19h13, Luis Panozzo <luis.panozzo@elmatica.com> a écrit :


Could you share the tree statement you generated?


Luis Panozzo (Lp)
Technology Manager
Elmatica AS
luis.panozzo@elmatica.com
Skype: luispanozzo

On 19 February 2016 at 18:47, MOHAMED MAALEJ <maalej_info@yahoo.fr> wrote:
thanks for all
the problem is resolved
the problem was with the operator '<' used for comparaison is not allowed
we use not(field>value) and it work very fine




Le Vendredi 19 février 2016 17h51, Luis Panozzo <luis.panozzo@elmatica.com> a écrit :


This works fine in my V8 installation (Supplier invoices)
<tree colors="blue:state == 'draft';black:state in ('proforma','proforma2','open');gray:state == 'cancel';red:state == 'waiting'" string="Invoice" default_order="id desc">


Luis Panozzo (Lp)
Technology Manager
Elmatica AS
luis.panozzo@elmatica.com
Skype: luispanozzo

On 19 February 2016 at 16:37, Damien Crier <damien.crier@camptocamp.com> wrote:
Hi,

As Martin said, coloring full line (e.g. text) is supported by default in odoo.
If you want to change background.forground color of a record (line in tree view), you can have a look at this module (v8): https://github.com/OCA/web/tree/8.0/web_tree_dynamic_colored_field.


On Fri, Feb 19, 2016 at 3:39 PM, MOHAMED MAALEJ <maalej_info@yahoo.fr> wrote:
hello for all

I need to give differents colors for records in a tree view. the color is choose according a condition.
Exp : a tree view of product. those having quantity less than 10 will be in red and others in green.
in this case, when i use in the xml file  colors="red:qty<10" it ive error.

any help please

thank in advance

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe



--
Damien Crier

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac Cedex
http://www.camptocamp.com
_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe