class account_journal_column(osv.osv):
- def _col_get(self, cr, user, context={}):
+ def _col_get(self, cr, user, context=None):
result = []
cols = self.pool.get('account.move.line')._columns
for col in cols:
In the first case, no need to initialize context as the function don't access it directly (it just pass the context to other functions).
In the second case, the context is not initialized. I assume that's a bug in your script.
Also, there is are some place in the code where "if not context:" is done instead of "if context is None:". Your patch can't detect it.
For this reasons, I refuse your patch. In fact this changes have to be done by the developer when he found it when working on a piece of code. An automatic massive change will lead to errors and more bugs.
Your patch is not usable.
Here is a sample of your patch:
@@ -443,7 +465,9 @@
self. _check_ moves(cr, uid, ids, "write", context) account, self).write(cr, uid, ids, vals, context=context)
return super(account_
- def unlink(self, cr, uid, ids, context={}):
self. _check_ moves(cr, uid, ids, "unlink", context) account, self).unlink(cr, uid, ids, context)
+ def unlink(self, cr, uid, ids, context=None):
+ if context is None:
+ context = {}
return super(account_
@@ -461,7 +485,7 @@
class account_ journal_ column( osv.osv) : get('account. move.line' )._columns
- def _col_get(self, cr, user, context={}):
+ def _col_get(self, cr, user, context=None):
result = []
cols = self.pool.
for col in cols:
In the first case, no need to initialize context as the function don't access it directly (it just pass the context to other functions).
In the second case, the context is not initialized. I assume that's a bug in your script.
Also, there is are some place in the code where "if not context:" is done instead of "if context is None:". Your patch can't detect it.
For this reasons, I refuse your patch. In fact this changes have to be done by the developer when he found it when working on a piece of code. An automatic massive change will lead to errors and more bugs.