跳至内容
菜单
此问题已终结
6 回复
5448 查看

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

and show only few modes their others are invisible.

形象
丢弃

Hi,

Have you got the answer ?

编写者

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

最佳答案

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

形象
丢弃
编写者

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

最佳答案

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"/>.

形象
丢弃