[FIX] _(): avoid useless warning where translating string without a cursor
authorChristophe Simonis <chs@openerp.com>
Thu, 6 Feb 2014 10:51:41 +0000 (11:51 +0100)
committerChristophe Simonis <chs@openerp.com>
Thu, 6 Feb 2014 10:51:41 +0000 (11:51 +0100)
bzr revid: chs@openerp.com-20140206105141-7e8bv8ordqqsswh7

openerp/tools/translate.py

index c7933c3..4dc4990 100644 (file)
@@ -172,7 +172,7 @@ class GettextAlias(object):
             cr = getattr(s, 'cr', None)
         if not cr and allow_create:
             db = self._get_db()
-            if db:
+            if db is not None:
                 cr = db.cursor()
                 is_new_cr = True
         return cr, is_new_cr