diff options
| author | olt@tinyerp.com <> | 2012-09-20 11:08:13 +0200 |
|---|---|---|
| committer | olt@tinyerp.com <> | 2012-09-20 11:08:13 +0200 |
| commit | 1d25af499b9356111dfe752c7bd87ce3fd40a7b8 (patch) | |
| tree | 12f76b48476940f43041e27bc6b6292c63e10430 /addons/anonymization/anonymization.py | |
| parent | f317c0dc16ee9872cc3eb58247a26a988cd6dea6 (diff) | |
[FIX] create context if None
bzr revid: olt@tinyerp.com-20120920090813-pxb25r4g1zo03jwu
Diffstat (limited to 'addons/anonymization/anonymization.py')
| -rw-r--r-- | addons/anonymization/anonymization.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/addons/anonymization/anonymization.py b/addons/anonymization/anonymization.py index 6b6db168a4f..43d198b27e2 100644 --- a/addons/anonymization/anonymization.py +++ b/addons/anonymization/anonymization.py @@ -68,8 +68,10 @@ class ir_model_fields_anonymization(osv.osv): return state def _check_write(self, cr, uid, context=None): - # check that the field is created from the menu and not from an database update - # otherwise the database update can crash: + """check that the field is created from the menu and not from an database update + otherwise the database update can crash:""" + if context is None: + context = {} if context.get('manual'): global_state = self._get_global_state(cr, uid, context=context) @@ -295,10 +297,10 @@ class ir_model_fields_anonymize_wizard(osv.osv_memory): def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, *args, **kwargs): state = self.pool.get('ir.model.fields.anonymization')._get_global_state(cr, uid, context=context) - + if context is None: context = {} - + step = context.get('step', 'new_window') res = super(ir_model_fields_anonymize_wizard, self).fields_view_get(cr, uid, view_id, view_type, context, *args, **kwargs) |
