Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How can I make a Popup Warning Message

By
wizardz
on 11/11/15, 4:33 AM 2,498 views

I wanna make a message that says something. I tryed it with raise osv.except_osv

but this is a Error Message.

I want to print a message and that the input is not saved. 

1

Drees Far

--Drees Far--
1130
| 5 2 6
Tunis, Tunisia
--Drees Far--
Drees Far
On 11/16/15, 4:39 AM

Hello friend;

here is how you can print a warning message.

First, you should import:

from openerp.osv.orm import except_orm

And then in your python:

My_error_Msg = 'hello!!'

raise osv.except_osv(_("Error!"), _(My_error_Msg))

return True

So that, there are two possibilities:

- if you want to block the access and the record (return True)

-Only print the warning message, press ok and save the record (return False)

Some useful links:

https://www.odoo.com/fr_FR/forum/help-1/question/using-raise-osv-except-osv-16015

http://odoo-new-api-guide-line.readthedocs.org/en/latest/conventions.html

http://stackoverflow.com/questions/29072343/how-to-display-openerp-error-message

http://stackoverflow.com/questions/30210715/how-to-create-a-function-to-raise-error-in-openerp

Best Regards.

0
Mayank Gosai
On 11/16/15, 2:23 AM

Hello wizards,

You can use "raise Warning" instead of "raise osv.except_osv".


Thank you.


0
sambath
On 11/12/15, 2:08 AM

you can raise a warning message in on_change by

return {

    'warning': {

        'title': 'Warning!',

        'message': 'The warning text'}

}

and this question is already in community hear

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 11/11/15, 4:33 AM
Seen: 2498 times
Last updated: 11/16/15, 4:39 AM