Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
4851 Visualizzazioni

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

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

</button>


Avatar
Abbandona
Risposta migliore

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,

Avatar
Abbandona
Autore

Thanks, i will try

Autore

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

Autore

Okey , I show button on only draft state

Post correlati Risposte Visualizzazioni Attività
4
dic 23
38556
0
apr 18
3757
1
apr 24
2477
1
dic 22
6766
0
feb 19
14