[FIX]Take a copy of the context before update

If the method `import_file` is called with the new API, the context is a frozendict and the update will raise `NotImplementedError: 'update' not supported on frozendict`
PR on master: https://github.com/odoo/odoo/pull/5798
This commit is contained in:
Laurent Mignon (ACSONE)
2015-03-17 17:36:37 +01:00
parent c8c6df3913
commit 9a11b67d6a

View File

@@ -35,8 +35,7 @@ class account_bank_statement_import(osv.TransientModel):
def import_file(self, cr, uid, ids, context=None): def import_file(self, cr, uid, ids, context=None):
""" Process the file chosen in the wizard, create bank statement(s) and go to reconciliation. """ """ Process the file chosen in the wizard, create bank statement(s) and go to reconciliation. """
if context is None: context = dict(context or {})
context = {}
#set the active_id in the context, so that any extension module could #set the active_id in the context, so that any extension module could
#reuse the fields chosen in the wizard if needed (see .QIF for example) #reuse the fields chosen in the wizard if needed (see .QIF for example)
context.update({'active_id': ids[0]}) context.update({'active_id': ids[0]})