Odoo Help


act window with condition ??

on 1/19/15, 12:05 PM 1,781 views


i have two tree views which have the some model, and i have an act_window which must appear in the first tree view and don't appear in the second tree view, please someone tell me how to hide it in the second tree view

not getting you clearly, what do you mean by having "act_window" in tree view?

Emipro Technologies Pvt. Ltd.
on 1/19/15, 1:12 PM

do you mean the right side panel action window, which works as you select the record in the tree view, is it?

Emipro Technologies Pvt. Ltd.
on 1/19/15, 1:57 PM

yes sir, the select "More" which contains delete , export, ..., in crm module leads have an option which is 'convert to opportunities' and opportunities have also an option 'convert to opportunities, i want to delete 'convert to opportunities' in opportunities

on 1/19/15, 4:41 PM
Kibong Moon
On 1/20/15, 4:15 AM

In the xml file that defines your view, you can hide/show button using states attribute and/or attr attribute like:

<record id="your_form" model="ir.ui.view">

   <field name="name">your_form_name</field>

   <field name="model">your.model</field>

   <field name="arch" type="xml">

      <form string="Your Thing">


            <button name="button_a" states="draft"/>   <!-- puts this button only when it's in draft state -->

            <button name="button_b" attrs="{'invisible': [('state', '=', 'draft')]}"/>  <!-- this button is always put in the form but it's invisible when shows this button if it's in draft state -->


thanx for your answer but it is not a button , it is an act window

on 1/20/15, 4:46 AM

Then, have you tried with domain? [('state','in',('draft'))] ... Hope it helps this time.

Kibong Moon
on 1/20/15, 6:12 AM

yes i have tried with domain but still the something

on 1/20/15, 8:23 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 1/19/15, 12:05 PM
Seen: 1781 times
Last updated: 3/16/15, 8:10 AM