Odoo Help


How to write to logger in an osv_memory function?

AJ Schrafel Paper Corp
on 7/2/13, 2:49 AM 613 views

I have created the following class with a function in it. When I call the function with a button nothing is written to the openerp log, either an error or what I want the function to write. What am i doing wrong?

class database_function(osv.osv_memory):
    _name = "database.function"
    _description = "Database Functions"
    _logger = logging.getLogger(__name__)
    _columns = {

    _defaults = {

    def action_button_database_sync(self, cr, uid, ids, context=None):
            _logger.warning("this is a warning")
            _logger.info("this is info")
        return res

On 1/18/15, 11:49 PM


Late answer for bookmark :-):
Could try :
self._logger.info("this is info")

For replacing some variable :

self._logger.info("this is info %s",variable)



Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

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

0 follower(s)


Asked: 7/2/13, 2:49 AM
Seen: 613 times
Last updated: 3/16/15, 8:10 AM