From a62f0bede48c62c3ecb89e16cb0e7449302c6621 Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Tue, 23 Nov 2010 17:40:32 +0200 Subject: [PATCH] ir.model: mutable argument fix bzr revid: p_christ@hol.gr-20101123154032-tuoe1aiy9wpnjp2y --- bin/addons/base/ir/ir_model.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/addons/base/ir/ir_model.py b/bin/addons/base/ir/ir_model.py index 5f9e3347b74..19ef96c1e17 100644 --- a/bin/addons/base/ir/ir_model.py +++ b/bin/addons/base/ir/ir_model.py @@ -75,10 +75,12 @@ class ir_model(osv.osv): fnct_search=_search_osv_memory, help="Indicates whether this object model lives in memory only, i.e. is not persisted (osv.osv_memory)") } + _defaults = { 'model': lambda *a: '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', } + def _check_model_name(self, cr, uid, ids): for model in self.browse(cr, uid, ids): if model.state=='manual':