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)