Odoo Help


Why my status bar doesn't have any colors and it's not aligned with the buttons?

Juan Formoso
on 12/1/14, 9:35 AM 1,642 views

I created a field of type selection, this is my Python code:

'state': fields.selection(
    [('draft', 'Draft'),
    ('cancelled', 'Cancelled'),
    ('invited', 'Invited'),
    ('rejected', 'Rejected'),
    ('awaiting', 'Awaiting'),
    ('not_coming', 'Not coming'),
    ('coming', 'Coming'),
    ('absent', 'Absent'),
    ('attended', 'Attended'),
    ('completed', 'Completed')],
    'State', size=16, readonly=True),

I'm trying to see it as a status bar, and this is my XML code:

<form string="Event Meeting Registration" version="7.0">
        <button name="move_to_cancelled" string="Cancel Registration"
         states="draft,invited" type="object"/>
        <field name="state" nolabel="1" widget="statusbar"

The result: I can see the button and the status bar, but the button is a line above the status bar, and the status bar is not highlighting the current state. For example, I open a record with th state draft, and this state is not highlighted, is grey like the other ones, and you can't know which state the object is in.

How can I align the button to the status bar? I tried to put the button and the field state between div tags, and even set their styles with foalt left and right, but when I did that, I wasn't able to see the status bar (I think the button occupies the whole line and the status bar was behind the button).

How can I see the current state highlighted?

Thank you in advance.

Juan Formoso
On 12/1/14, 10:38 AM

Ok, I got the solution to both problems.

In addition to having state in the header, I had it in the form sheet too, this way:

    <field name="state"/>

I had to remove that line, and when I did, both problems were solved at the moment. Hope it helps to anyone.


I was able to solve it that way in OpenERP 7, but now, in Odoo 8, I have just faced the same problem and this time I was able to solve it putting the buttons and the field state inside the same <div>. So I guess if you have this problem, here you can find two possibilities in order to fix it.

You can make it invisible if you don't want it to get displayed.

on 12/1/14, 8:13 PM

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 12/1/14, 9:35 AM
Seen: 1642 times
Last updated: 8/10/15, 6:09 PM