[WIP] Correct check for context.

This commit is contained in:
Ronald Portier (Therp BV)
2015-02-26 16:49:48 +01:00
committed by Stefan Rijnhart
parent 158ecaa401
commit 42bbc31d2b
2 changed files with 2 additions and 2 deletions

View File

@@ -29,7 +29,7 @@ class AccountBankStatementLine(orm.Model):
def process_reconciliation(
self, cr, uid, id, mv_line_dicts, context=None):
"""Put marker in context to use period from date in move line."""
ctx = context.copy() or {}
ctx = context and context.copy() or {}
ctx['override_period_from_date'] = True
return super(AccountBankStatementLine, self).process_reconciliation(
cr, uid, id, mv_line_dicts, context=ctx)

View File

@@ -28,7 +28,7 @@ class AccountMoveLine(orm.Model):
def create(self, cr, uid, vals, context=None, check=True):
"""If requested, override period from date."""
ctx = context.copy() or {}
ctx = context and context.copy() or {}
if (('override_period_from_date' in ctx or
'period_id' not in vals) and 'date' in vals):
period_model = self.pool['account.period']