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

Hello, I am developing a module in Odoo8 and I want to show a message box with the buttons "Yes" and "No". If the user presses "Yes", te execution of the method continues, if presses not, no. How can I do this?

Thanks!

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

You can use confirm="Some confirm message" tag in xml view definition (put it on button)... 
It will popup a message with cancel/continue (not realy yes/no, but works the same)

 

hope it helps

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

Thanks! How can I control this messagebox from Python code? For example, when the message box is showed and what action do if the user presses confirm, or not?

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

Well, you put confirm tag on BUTTON, and user has to decide based on message will he continue or not, but if you place3 it on BUTTON, then logicaly, it will or not continue execution of whatever button triggers (method, action, workflow...)

الكاتب

Sorry but I am principiant. Can you tell me an example of how can I display a confirm message from a method in Python and then catch the result in this method, to decide how continue? Thanks!

المنشورات ذات الصلة الردود أدوات العرض النشاط
0
أبريل 24
1957
4
نوفمبر 23
6060
0
أكتوبر 23
1800
0
ديسمبر 22
2703
2
ديسمبر 23
19482