Odoo Help

1

Using status widget with fields not named state?

By
mike
on 4/30/13, 3:21 PM 2,856 views

I want to use the statusbar widget with a field named status. However this results in Client Errors apparently because I'm not using a field named state for this widget. In this custom model state and status are quite different things and not interchangeable so I cannot just switch fields. I also do not need to display state at all. Is there some way around this limitation?

I think statusbar widget is only used with selection fields.

Sudhir Arya (SA)
on 5/1/13, 2:43 AM
1
Naresh Soni (nch)
On 5/1/13, 4:56 AM

Hi Mike,

It should work normal as long as your field is of type selection / many2one. widget=statusbar should work. There is no MUST HAVE (name=state) for this widget.Check the example in project issue model the field stage_id is a many2one and used as widget=statusbar.

Hope this helps !

Thanks,

I have the statusbar for another model used on the selection field "state" and it works as expected. On this model I try using it with a selection field named status and it results in this even though the code is almost identical to the other model - client error unknown field state in domain (state = decertified) is it because I set one the button attribute "states" to "decertified"? Perhaps the "states" attribute only works with fields named state?

mike
on 5/1/13, 10:25 AM

yes the attribute 'states' on button will work only if you have 'state' field in your model.

Naresh Soni (nch)
on 5/1/13, 10:39 AM

Yes this is the problem. Since I cannot use the buttons I now need a normal select widget for this field. Can I use that and still use the statusbar since they will be set to the same field?

mike
on 5/1/13, 10:51 AM

yes as I said " It should work normal as long as your field is of type selection / many2one" but the states attribute on button will work only with 'state' field.

Naresh Soni (nch)
on 5/1/13, 1:43 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.

Register

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

0 follower(s)

Stats

Asked: 4/30/13, 3:21 PM
Seen: 2856 times
Last updated: 3/16/15, 8:10 AM