[FIX] auditrail: in case of unlink retrieve first the record and then execute the unlink (the other way around is causes problems for name_get...)

bzr revid: mat@openerp.com-20140204142825-jtln4kyfmfhgq4sd
This commit is contained in:
Martin Trigaux 2014-02-04 15:28:25 +01:00
parent 45f52a3493
commit 985ddf3baf
1 changed files with 3 additions and 1 deletions

View File

@ -286,7 +286,9 @@ class audittrail_objects_proxy(object_proxy):
elif method == 'unlink':
res_ids = args[0]
old_values = self.get_data(cr, uid_orig, pool, res_ids, model, method)
res = fct_src(cr, uid_orig, model.model, method, *args, **kw)
# process_data first as fct_src will unlink the record
self.process_data(cr, uid_orig, pool, res_ids, model, method, old_values, new_values, field_list)
return fct_src(cr, uid_orig, model.model, method, *args, **kw)
else: # method is write, action or workflow action
res_ids = []
if args: