تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
6344 أدوات العرض

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?

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

الكاتب

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

أفضل إجابة

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

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

الكاتب

yes i have tried with domain but still the something

المنشورات ذات الصلة الردود أدوات العرض النشاط
3
يناير 24
8920
0
أبريل 23
1633
1
مارس 24
3579
4
مارس 22
5304
3
أكتوبر 20
7588