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

I have built an editable treeview, and inserted an icon button on each row which returns an act_window action which loads the form view inside a modal / popup (having the tree beneath)

The action buttons (Save and Discard) are added automatically and working pretty fine

Except the fact that I really want to automatically close the modal when using either of them (save or discard), without having to manually closing it afterwards, without having to go the complex way to override client-side code just for that.

I've searched Odoo's code base and found out that in form_controller.js does just that if the button has attribute: close, but I don't know how can I easily inject that attribute from python or action / view XML code

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

Hi,

Try use the data-dismiss="modal" with your button.

<div class="modal-footer">             <button type="button" t-on-click="your button name" data-dismiss="modal">Name</button>              </div>


Regards

الصورة الرمزية
إهمال

unfortunately this doesn't work

المنشورات ذات الصلة الردود أدوات العرض النشاط
0
أبريل 23
2901
2
مارس 24
3383
1
أبريل 23
112
1
ديسمبر 22
2632
2
أغسطس 22
5754