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


I've created a button in the list view that performs an action and it works, but I want to hide it when the user select a value in the listview.

How can I achieve this?

Thanks for your help.

الصورة الرمزية
إهمال
أفضل إجابة

Hi,

On the xml file where we added the button(Test) add the condition like below.

<?xml version="1.0" encoding="UTF-8"?>


<templates id="template" xml:space="preserve">


    <t t-extend="ListView.buttons" t-name="button_near_create.button">


       <t t-jquery="button" t-operation="after">


           <t t-if="widget.is_action_enabled('export_xlsx') and widget.isExportEnable">


               <button t-if="widget.modelName == 'res.partner'"


                   class="btn btn-primary o_list_export_xlsx open_wizard_action_kanban oe_highlight"


                   type="button">Open Wizard</button>


           </t>


       </t>


   </t>


</templates>


Regards

الصورة الرمزية
إهمال
الكاتب

It works! Thank you for you help

Regards

المنشورات ذات الصلة الردود أدوات العرض النشاط
2
مايو 23
5141
3
أبريل 24
2738
2
يوليو 22
4577
1
ديسمبر 21
5437
0
أغسطس 24
44