Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
6399 มุมมอง

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

Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ม.ค. 24
9043
0
เม.ย. 23
1676
1
มี.ค. 24
3646
4
มี.ค. 22
5366
Hide an "act_window id" แก้ไขแล้ว
3
ต.ค. 20
7626