Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

coloring a sale order line

By
abdelwahed chiheb
on 5/26/13, 5:11 PM 1,559 views

Hello community, i'm trying to change the default color in a sale order line in my custom module.

i'm trying with this approach but this didn't work :(

    <record id="view_order_form_inherit" model="ir.ui.view">
    <field name="name">sale.form.inherit</field>
    <field name="model">sale.order</field>
    <field name="inherit_id" ref="sale.view_order_form"/>
    <field name="arch" type="xml">
        <data>
            <tree position="attributes">
                <attribute name="colors">red:state='draft'</attribute>
            </tree>     
        </data>
    </field>
</record>
2

Borni DHIFI

--Borni DHIFI--
5102
| 6 8 9
Tunis, Tunisia
--Borni DHIFI--

Techno Functional Consultant Odoo(OpenERP) 

http://www.linkedin.com/in/borni

Skype : dhifi.borni

Borni DHIFI
On 5/26/13, 7:19 PM

Hi,

take this code :

<openerp>
    <data>
        <record id="view_order_tree_inherit" model="ir.ui.view">
            <field name="name">sale.tree.inherit</field>
            <field name="model">sale.order</field>
            <field name="inherit_id" ref="sale.view_quotation_tree" />  
              <field name="arch" type="xml">                 
                    <tree position="attributes">
                        <attribute name="colors">red:state=='draft'</attribute>
                    </tree>          
            </field>
        </record>
    </data>
</openerp>

This code mark color line in red if state='draft'

thanks.

i updated the module but this didn't work

abdelwahed chiheb
on 5/26/13, 7:21 PM

i edit my answer

Borni DHIFI
on 5/26/13, 7:50 PM

Hi Borni, I tried your code, and it does not work. I met some discussion on this topic. most of the people say that this method does not work, replace the old <tree> by another new. you've got an idea

abdelwahed chiheb
on 5/26/13, 8:45 PM

before I posted this code i tested and it works well. in list view quotation it displays red lines when state=draft.

Borni DHIFI
on 5/26/13, 8:51 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 5/26/13, 5:11 PM
Seen: 1559 times
Last updated: 3/16/15, 8:10 AM