This question has been flagged
1 Reply
8913 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?

Avatar
Discard

I think statusbar widget is only used with selection fields.

Best Answer

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,

Avatar
Discard
Author

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?

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

Author

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?

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.