From 2dfaecdbdaa1b52ea202db85deb80da8b5229a73 Mon Sep 17 00:00:00 2001 From: Guewen Baconnier Date: Mon, 28 Jan 2013 10:14:31 +0100 Subject: [PATCH] [FIX] copy the context to avoid to propagate the 'from_parent_object' key to callers' context --- account_constraints/account_constraints.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/account_constraints/account_constraints.py b/account_constraints/account_constraints.py index 0b1155380..40e320920 100644 --- a/account_constraints/account_constraints.py +++ b/account_constraints/account_constraints.py @@ -142,6 +142,8 @@ class AccountInvoice(orm.Model): through the cancel button.""" if context is None: context = {} + else: + context = context.copy() context['from_parent_object'] = True return super(AccountInvoice, self).action_cancel(cr, uid, ids, context=context) @@ -150,6 +152,8 @@ class AccountInvoice(orm.Model): the context.""" if context is None: context = {} + else: + context = context.copy() context['from_parent_object'] = True return super(AccountInvoice,self).action_move_create(cr, uid, ids, context=context) @@ -163,6 +167,8 @@ class AccountBankStatement(orm.Model): through the cancel button.""" if context is None: context = {} + else: + context = context.copy() context['from_parent_object'] = True return super(AccountBankStatement, self).button_cancel(cr, uid, ids, context=context) @@ -170,6 +176,8 @@ class AccountBankStatement(orm.Model): """Add the from_parent_object key in context in order to be able to post the move.""" if context is None: context = {} + else: + context = context.copy() context['from_parent_object'] = True return super(AccountBankStatement, self).create_move_from_st_line(cr, uid, st_line_id, company_currency_id, st_line_number, context=context)