跳至內容
選單
此問題已被標幟
6 回覆
5471 瀏覽次數

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

頭像
捨棄