Odoo Help


[Solved] Need help with 2 issue for Status bar - Odoo 8

on 6/9/15, 3:09 AM 1,793 views


I have code for a statusbar and it is working but not as I expect:

.py code:

state = fields.Selection({('new','New'), ('open','In Progress'), ('closed','Closed')}, "Status")

.xml code:

<field name="state" widget="statusbar" statusbar_visible="new,open,closed" clickable="True"/>

problem 1:

Even though I have specified in the XML code to show new, open and closed, it shows in the order open, new, closed in Odoo. How do I fix this?

problem 2:

It is on the top left corner of the screen, how do I get it to the top right where most status bars are?

Found another issue I can't find information on. How do I get the created tickets to default to new when saved?

on 6/9/15, 5:38 AM

Ankit Thank you.. Problem 1 sorted. status bar is now on the left side. Problem 2: how do I get them in order new, inprogress, closed and Problem 3: how can I get it to default to new when create is clicked

on 6/10/15, 3:20 AM
Ankit Gauri
On 6/9/15, 6:02 AM

hello siobhan

in .py file

'state': fields.selection([('open', 'Open'), ('post', 'Posted')], "Batch State"),

_defaults = {

'state': 'open',

in.xml file

in tree view :

<field name="state"/>

you can try this in form view: 

<field name="state" widget="statusbar" />

or you can use this

<field name="state" widget="statusbar" statusbar_visible="draft,confirm,done"/>

Thank You

Tried using _defaults. I have no error but state is not defaulting to new. Tree view and form view are already in place.

on 6/9/15, 6:27 AM

it will work if you have put that code in header

Ankit Gauri
on 6/10/15, 3:00 AM

there is no issue in your code also

Ankit Gauri
on 6/10/15, 3:01 AM
On 6/11/15, 6:10 AM

Ok.. got help with answer. I was using dictionary for my list which python will print in random order. Slight change in the code and added the default in same line so solves all my issues:

state = fields.Selection(

[('new','New'), ('open','In Progress'), ('closed','Closed')],




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: 6/9/15, 3:09 AM
Seen: 1793 times
Last updated: 6/11/15, 6:11 AM