Odoo Help


Popup messages wizzard - how to

Dr Obx
on 2/2/16, 4:59 AM 1,103 views

My new module require to inform user about some things like stock levels, quantities etc. I can of course display it on screen but i would like to have it as a popup instead to make sure that the user is seeing it and react on this information.

For example if stock level is LOW message will popup "Hey you, do you know that your stock level is almost zero ? ;)" or something :)

If it's only on the screen among many other can be easily overlooked but if message popup, user must click to close it so I can record this information and if something will be wrong and for example order will not created I will know who is responsible for this mess ;)

I was trying to use warnings but warning stops all processes and roll them back. How to create popup message using other solution ?

Have some ideas but i'm not sure will it work.

def popup_method(...........):
    return {
              'name': _(some name),
              'view_type': 'form',
              "view_mode": 'form',
              'res_model': model-name,
              'type': 'ir.actions.act_window',
              'target': 'new',

and call it conditionally. What do you think guys ?

Atul Arvind

--Atul Arvind--
| 3 3 5
vadodara, India
--Atul Arvind--


I am odoo Enthusiast/Developer from Vadodara, India. Working with odoo from v5 to v11 and other opensource technology since 5+ years. Having Strong Expertise in

Odoo Development

Odoo Customization

Odoo Training

Odoo Integration

Server Administration

Odoo Migration


Here is my StackOverflow profile.  you can also find me on LinkedIn.

Contact: atul.surficle@gmail.com.

Atul Arvind
On 2/2/16, 5:53 AM

Yes, you can use the wizard to display the pop up message in order to show dynamic message and it will not stop the process. 

if you have a button and the text is static, can also use a button confirm attribute in xml, like

<button name="method" string="Confirm" type="object" confirm="are you sure you want to continue?"/>

It will display a confirmation dialog with yes and no button on it and won't break the process.

This second method is useless because as you said is static text only. I'm interested in first one ;) But how, never used wizards or things like that. Have you got any examples ?

Dr Obx
on 2/2/16, 6:09 AM

and also must be triggered depending on if condition ;)

Dr Obx
on 2/2/16, 6:11 AM
On 3/26/18, 6:58 AM

How to add or display confirmation display box / message box on button click. Before going into deep we need to know problem statement. In some scenario we need to ask from user is he/she want to do further processing or not on button click.

For example we have some document which needs to be approved by vice chancellor of a university. And before submitting it to the vice chancellor we want to ask confirmation from user. So guys to achieve this goal follow these steps.

# Confirmation msg box for ORIC
from openerp.osv import fields,osv
from openerp.tools.translate import _
class thesis_approval_message_oric(osv.osv_memory):
    _name = "thesis.approval.message.oric"
        'text': fields.text(),


     <!--Wizard For Raise Apprval Messages Thesis ORIC-->
    <record id="wizard_message_form_for_oric" model="ir.ui.view">
            <field name="name">Thesis Wizard Message Approval Message ORIC</field>
            <field name="model">thesis.approval.message.oric</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Message" version="7.0">
                    <separator string="Message" colspan="6"/>
                    <field name="text" colspan="4" nolabel="1" readonly="1"  widget="html"/>                                                            
                    <separator colspan="6"/>
                        <button name="btn_approve_oric" type="object" string="Yes" class="oe_highlight"/>                             
                        <button special="cancel" string="No"/>                    

Get complete code and description from here: http://learnopenerp.blogspot.com/2017/12/how-to-display-confirmation-display-box.html

Dr Obx
On 2/3/16, 5:57 AM

Hah, that's simple, thank you Pawan :)




| 4 4 6
Hyderabad, India

On 2/3/16, 12:51 AM


Create a new object as osv.osv_memory( as its data will not be stored in database and is for temporary use only.

class YOUR_CLASS(osv.osv_memory):

and then keep one field in it:

_columns = {'name': fields.char('Message', readonly="1"),

Now under your if condition when u are calling that action as u have in ur part, modify it as:


return {
              'name': _(some name),
              'view_type': 'form',
              "view_mode": 'form',
              'res_model': YOUR_CLASS,
              'type': 'ir.actions.act_window',    
          'context': {'default_name': 'YOUR CUSTOM MESSAGE'}
     'target': 'new', }

and design your xml as needed...

Hope it helps you!    

Testing ;)

Dr Obx
on 2/3/16, 6:25 AM

Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 530, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 567, in dispatch result = self._call_function(**self.params) File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 303, in _call_function return checked_call(self.db, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 113, in wrapper return f(dbname, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 300, in checked_call return self.endpoint(*a, **kw) File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 796, in __call__ return self.method(*args, **kw) File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 396, in response_wrap response = f(*args, **kw) File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 944, in call_kw return self._call_kw(model, method, args, kwargs) File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 936, in _call_kw return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 241, in wrapper return old_api(self, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 336, in old_api result = method(recs, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/openerp/addons/connector/producer.py", line 48, in create record_id = create_original(self, vals) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 239, in wrapper return new_api(self, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 4074, in create record = self.browse(self._create(old_vals)) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 239, in wrapper return new_api(self, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 462, in new_api result = method(self._model, cr, uid, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 4265, in _create recs._validate_fields(vals) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 239, in wrapper return new_api(self, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 1262, in _validate_fields res_msg = trans._get_source(self._name, 'constraint', self.env.lang, msg) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 239, in wrapper return new_api(self, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 441, in new_api result = method(self._model, cr, uid, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_translation.py", line 369, in _get_source return self.__get_source(cr, uid, name, types, lang, source, res_id) File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 241, in wrapper return old_api(self, *args, **kwargs) File "", line 2, in __get_source File "/usr/lib/python2.7/dist-packages/openerp/tools/cache.py", line 74, in lookup value = d[key] = self.method(*args, **kwargs) File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_translation.py", line 336, in __get_source cr.execute(query, params) File "/usr/lib/python2.7/dist-packages/openerp/sql_db.py", line 158, in wrapper return f(self, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/openerp/sql_db.py", line 234, in execute res = self._obj.execute(query, params) InternalError: current transaction is aborted, commands ignored until end of transaction block

Dr Obx
on 2/3/16, 6:28 AM

Its a bit messy , can u pls figure out your file in it ..

on 2/4/16, 1:05 AM

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: 2/2/16, 4:59 AM
Seen: 1103 times
Last updated: 3/26/18, 6:58 AM