简体   繁体   中英

How to show a message to user on success in openerp

Could somebody please tell me how to show a message when the operation has been completed successfully. I am using openerp v.6 and gtk-client. I don´t want to use osv.except_osv because it has a rollback procedure. I have tried this but it doesn´t anything.

_logger = logging.getLogger(__name__)                
message = _("Data has been sent %s " % r.text)
_logger.info(message)

And also this one.

self.log(cr,uid,context.get('active_id'),message)

Perhaps you can use on_change method, and you can return a warning:

warning = {
    'title': 'Warning!',
    'message' : 'Your message.'
}
return {'warning': warning}

Or an action.window may be your perfect way. You can create an invisible 'state' filed (it can be function field and boolean or selection). If user push the button and everything is perfect, openerp return an window with your message. This message may label or text field. (label has a character limit, it is huge, but sometimes not enough)

Naturally, you can do it all with fields_view_get method. With this method, you can create some 'fantom' field, but in my opinion, this way is the hardest way, because fields_view_get is poorly documented.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM