Odoo Help


How can I make a Popup Warning Message

on 11/11/15, 4:33 AM 7,614 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. 


Drees Far

--Drees Far--

| 5 2 7
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:





Best Regards.

On 10/31/17, 8:54 AM

you can use warning or RaiseError ,or you can create your default pop up or wizard like the example below

from odoo import api, fields, models 

class hr_wizard(models.TransientModel):

    _name = 'hr.wizard'

    _description = 'HR employee wizard'

    message = fields.Text(string="Your file is stored in the directory C:/", readonly=True, store=True)

now create your view like this

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


        <record id="view_hr_wizard" model="ir.ui.view">

            <field name="name">Pdf.generation.form</field>

            <field name="model">hr.wizard</field>

            <field name="arch" type="xml">

            <form string="generation fichier">


                    <field name="message" />



                    <button string="OK" special="cancel" class="oe_highlight"/>






and you can call it in other function like this

return {

    'name': 'Pdf.generation.form',

    'type': 'ir.actions.act_window',

    'res_model': 'hr.wizard',

    'view_mode': 'form',

    'view_type': 'form',

    'target': 'new'


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

Hello wizards,

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

Thank you.

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

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 11/11/15, 4:33 AM
Seen: 7614 times
Last updated: 10/31/17, 8:54 AM