[FIX] mutable default argument values
authorXavier Morel <xmo@openerp.com>
Fri, 14 Dec 2012 13:17:20 +0000 (14:17 +0100)
committerXavier Morel <xmo@openerp.com>
Fri, 14 Dec 2012 13:17:20 +0000 (14:17 +0100)
bzr revid: xmo@openerp.com-20121214131720-jll2i2y0ph7aexox

openerp/addons/base/ir/ir_model.py
openerp/addons/base/ir/ir_needaction.py

index 4e21f83..e015860 100644 (file)
@@ -257,7 +257,7 @@ class ir_model_fields(osv.osv):
         'selection': "",
         'domain': "[]",
         'name': 'x_',
-        'state': lambda self,cr,uid,ctx={}: (ctx and ctx.get('manual',False)) and 'manual' or 'base',
+        'state': lambda self,cr,uid,ctx=None: (ctx and ctx.get('manual',False)) and 'manual' or 'base',
         'on_delete': 'set null',
         'select_level': '0',
         'size': 64,
index 39432ca..12f0fcc 100644 (file)
@@ -56,7 +56,7 @@ class ir_needaction_mixin(osv.AbstractModel):
     # "Need action" API
     #------------------------------------------------------
 
-    def _needaction_count(self, cr, uid, domain=[], context=None):
+    def _needaction_count(self, cr, uid, domain=None, context=None):
         """ Get the number of actions uid has to perform. """
         dom = self._needaction_domain_get(cr, uid, context=context)
         if not dom: