← Back to team overview

openerp-expert-framework team mailing list archive

Re: Warning message when creating/writing objects

 

On Wed, Nov 7, 2012 at 10:09 AM, Damian Soriano (Gmail) <
damiansoriano@xxxxxxxxx> wrote:

> Dear Framwork Experts,
>
> I face this same problem many times during the development of modules, I
> want to show some warning message when a an object is created or written
> but still allow the operation to take place.
>
> The normal way I do this is by raising an exception from python to show
> the message. Unfortunately, if I raise an exception when creating/writing
> an object the operation is aborted, so I cannot do that. I tried to return
> an action from the create function but unsuccessfully.
>

I highly recommend you check viewform.js in web addons (v6.1), there is a
method on_created you can redefined and does what you want.

Regards,

>
> Is there any way to accomplish this?
>
> If not I strongly believe that OpenERP should give support for that.
>
> Regards
>
> Damián Soriano
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openerp-expert-framework
> Post to     : openerp-expert-framework@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~openerp-expert-framework
> More help   : https://help.launchpad.net/ListHelp
>
>


-- 
Cristian Salamea
@ovnicraft

References