Skip to Content
Menu
This question has been flagged
6 Replies
4843 Views

i want to use Many2one field as a states which is show at the statusbar,

and show only few modes their others are invisible.

Avatar
Discard

Hi,

Have you got the answer ?

Author

I found out one way to do it

That if you like dynamic domain then this is the trick

First you have your stage id( many2one) field

Then you have to create one more many2one field as compute field ...

You compute a list of stage ids in return of that compute function..

Then in xml put a domain like

domain=[('stage_id', 'in', yourcustomfield)]

And that's it

Best Answer

Hi,

Yes you can use many2one field to represent the state. If you install the project module in odoo, you can see similar thing in the task. Where the stage_id is the many2one field with comodel "project.task.type"

in XML,

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

Thanks

Avatar
Discard
Author

thanks for the answer, now i want to show some of them states into statusbar...

in the selection field their is attribute called "statusbar_visible" but in the many2one field that is not acceptable.

In the project module, stages cane be specified for which all the projects task the stage has to be visible, you can use the same concept here too

Best Answer

Hi

you should add another selection field which call "selection_stage_id" and selection list should come from function that function get data from stage_id model.

Then you can use <field name="selection_stage_id" widget="statusbar"/>.

Avatar
Discard