[FIX]journal_id and period_id check wrong in _get_date
authorDenis Ledoux dle@openerp.com <>
Tue, 27 Nov 2012 10:04:18 +0000 (11:04 +0100)
committerDenis Ledoux dle@openerp.com <>
Tue, 27 Nov 2012 10:04:18 +0000 (11:04 +0100)
bzr revid: dle@openerp.com-20121127100418-iv8gkbh4r391qz6m

addons/account/account_move_line.py

index 84de554..e96853f 100644 (file)
@@ -476,7 +476,7 @@ class account_move_line(osv.osv):
             context or {}
         period_obj = self.pool.get('account.period')
         dt = time.strftime('%Y-%m-%d')
-        if ('journal_id' in context) and ('period_id' in context):
+        if context.get('journal_id') and context.get('period_id'):
             cr.execute('SELECT date FROM account_move_line ' \
                     'WHERE journal_id = %s AND period_id = %s ' \
                     'ORDER BY id DESC limit 1',