Remove dangerous default value

Default values in python are created before the method is called,
as a result. Any mutable object defined as default value will be the
same object for each method call. It's only safe to use immutable
objects as default value.
This commit is contained in:
Loïc Faure-Lacroix
2015-03-18 00:41:24 +03:00
committed by Sandy Carter
parent b6118fbed3
commit 9226e46818

View File

@@ -70,7 +70,10 @@ class bank_acc_rec_statement(orm.Model):
)
return True
def copy(self, cr, uid, id, default={}, context=None):
def copy(self, cr, uid, id, default=None, context=None):
if not default:
default = {}
default.update({
'credit_move_line_ids': [],
'debit_move_line_ids': [],