Skip to Content
Menu
This question has been flagged
3 Replies
2530 Views

How i can show a alert message to the client 

Avatar
Discard
Best Answer

from openerp.tools.translate import _

raise osv.except_osv(_('Invalid Action!'), _('You can not create this payment. reconfirm the form once again.'))



Avatar
Discard
Best Answer

Isio,

Exception is the way to go, but for an another idea , please check if the popup reminder helps you on this.

Here is the module : https://www.odoo.com/apps/modules/8.0/popup_reminder

Thanks.

Avatar
Discard
Best Answer

Could you explain the use case in more detail?

  • If you want to pop up the alert on click of a button, you could use:

<button string="my_button" confirm="Are you sure?" />

         This will be in the XML file


  • If you want to raise it as an alert on programming logic, you could use:

raise osv.except_osv(('Permission Denied!'),('You are not allowed to perform this operation.')) 

         This will be in .py file


  • If you want it on click of some javascript event, then:

alert("Error !");

         This would be in your .js file.


Please describe the scenario you want to show this error.





Avatar
Discard