콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3 답글
16657 화면

Hello,

I'm asking if there is a way to put a specific background color for some fields on the tree view.

Thanks.

아바타
취소

did you find a solution ?!!

베스트 답변

Hi,

Yes, it is possible to put a specific background color for some fields on the tree view in Odoo by using the List View Background Color app available on the Odoo app store.

You can refer to the following link to access the app on the Odoo app store:

https://apps.odoo.com/apps/modules/16.0/listview_change_background_color/

This app helps to Change The Color Of Important Or Favorite Records From Listview / Treeview. Which Helps To Save Your Time In Search The Records Manually All The Time. No Need To Worry, Now You Can Review Most Priority Records Very Easily And Quickly. It Is Available For Any Listview / Treeview. You Can Customize Color Based Upon Relevant Records And Needs.

Regards

아바타
취소
베스트 답변

Use this module

https://apps.odoo.com/apps/modules/12.0/web_tree_dynamic_colored_field/

아바타
취소
베스트 답변

I think you need to see this: forum.openerp.com/forum/topic28208.html

Below is how he did it:

Original code, form sale.view.xml: Code:

<record id="view_order_tree" model="ir.ui.view">
            <field name="name">sale.order.tree</field>
            <field name="model">sale.order</field>
            <field name="type">tree</field>
            <field name="priority">2</field>
            <field name="arch" type="xml">
                <tree string="Sales Orders" colors="grey:state=='cancel';blue:state in ('waiting_date','manual');red:state in ('invoice_except','shipping_except')">
                    <field name="name"/>
                    <field name="date_order"/>....

New code, in myfile.xml :

Code:

 <!-- Tree view. Replace colors -->
        <record id="sale_view_order_tree_inherit1" model="ir.ui.view">
            <field name="name">sale.view.order.tree.inherit1</field>
            <field name="model">sale.order</field>
            <field name="type">tree</field>
            <field name="inherit_id" ref="sale.view_order_tree"/>
            <field name="arch" type="xml">
                <xpath expr="//tree[@string='Sales Orders']" position="attributes">
                    <attribute name="colors">grey:state=='cancel';orange:state in ('waiting_date','manual');red:state in ('invoice_except','shipping_except')</attribute>
                </xpath>
            </field>
        </record>

I hope this helps you.

아바타
취소
작성자

Hello, Thank you for your answer, but it's not that my problem. I need to change the background color for some column not the color of values.