コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
4870 ビュー

<button name="add_workorder" type="object" string="Add Workorder" confirm="Are you sure add Workorder?">

<!-- attrs="{'invisible': [('state','!=','draft')]}" -->

</button>


アバター
破棄
最善の回答

Hello delgertsetseg,


Put button in the tree view and apply attrs on it.

You have to also add state field in the tree view because attrs on state field so you can invisible it.

For Ex:-

<tree>

     <field name="state" invisible="1"/>

    <button name="add_workers" type="object" string="Add Workers" attrs="{'invisible' : [('state', '!=', 'draft')]}" confirm="Are You sure you want to Add Workers"/>

</tree>


Hope it will works for you.

Thanks,

アバター
破棄
著作者

Thanks, i will try

著作者

"add_workorder" button is visible , do you have anything idea?

This attrs means, if state is not in draft stage then button is invisible. When the state is draft, button will visible. You want to hide button on draft state or only show button on draft state ?

AFAIK, attrs doesn't work on tree view.

著作者

Okey , I show button on only draft state

関連投稿 返信 ビュー 活動
4
12月 23
38651
0
4月 18
3771
1
4月 24
2505
1
12月 22
6785
0
2月 19
14