Odoo Help

Welcome!

This community 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.

0

act window with condition ??

By
kaisusr
on 1/19/15, 12:05 PM 1,182 views

Hi,

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

kaisusr
on 1/19/15, 4:41 PM
0
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">

         <header>

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

        </header>

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

kaisusr
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

kaisusr
on 1/20/15, 8:23 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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