mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
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:
committed by
Sandy Carter
parent
b6118fbed3
commit
9226e46818
@@ -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': [],
|
||||
|
||||
Reference in New Issue
Block a user