Show message to user (or popup)

Asked by Damián Soriano

I am overriding the write method of the sale.order object. I want to inform the user of some things when the object is successfully saved (and I cannot raise an exception since it will roll back the write).

I tried returning something like

result = {'view_type' : 'form',
                'view_mode' : 'form',
                'view_id' : the_id_of_the_view,
                'res_model' : 'model_of_the_view',
                'type' : 'ir.actions.act_window',
                'target' : 'new',
                'context' : context,}

but still I cannot show any information to the user. I thought that it may be possible to call an action to display a view, something like wizards do, but cannot find any information or nothing.

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Server (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Solved by:
Serpent Consulting Services
Solved:
Last query:
Last reply:
Revision history for this message
Serpent Consulting Services (serpent-consulting-services) said :
#1

Damian,

You can surely use a wizard just to notify the user in terms of a popup.

Additionally, if you are using web client, you would love to use the logging feature of OpenERP.

Example:
message = _("The sales order has been confirmed.")
self.log(cr, uid, id, message)

Hope this helps certainly.

Regards,
Serpent Consulting Services.

Revision history for this message
Damián Soriano (damiansoriano) said :
#2

But it is possible to lunch the wizard from the ORM method 'write'?? How?

Regarding the logging, if I didn't misunderstood it, in the OpenERP days last week someone said that this facility will be removed, right?

Regards

Revision history for this message
Damián Soriano (damiansoriano) said :
#3

I mean, will be remove in version 7.0

Revision history for this message
Best Serpent Consulting Services (serpent-consulting-services) said :
#4

Heard and Caught rightly, the 7.0 will remove it. But, there will be an alternate for it.

For now, this can serve your aim.

And, write cannot use the wizard call unfortunately.

Regards.

Revision history for this message
Damián Soriano (damiansoriano) said :
#5

Thanks Serpent Consulting Services, that solved my question.