Merge lp:~therp-nl/openobject-addons/6.1-lp1111597 into lp:openobject-addons/6.1

Proposed by Holger Brunn (Therp)
Status: Needs review
Proposed branch: lp:~therp-nl/openobject-addons/6.1-lp1111597
Merge into: lp:openobject-addons/6.1
Diff against target: 31 lines (+5/-2)
1 file modified
audittrail/audittrail.py (+5/-2)
To merge this branch: bzr merge lp:~therp-nl/openobject-addons/6.1-lp1111597
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+147050@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

7145. By Holger Brunn (Therp)

[FIX] ignore columns that are filtered out in get_data also in
prepare_audittrail_log_line

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'audittrail/audittrail.py'
2--- audittrail/audittrail.py 2012-03-23 14:25:41 +0000
3+++ audittrail/audittrail.py 2013-02-07 09:42:22 +0000
4@@ -173,6 +173,9 @@
5 class audittrail_objects_proxy(object_proxy):
6 """ Uses Object proxy for auditing changes on object of subscribed Rules"""
7
8+ "Columns to be filtered from audited fields"
9+ __filtered_columns = ('__last_update', 'id')
10+
11 def get_value_text(self, cr, uid, pool, resource_pool, method, field, value):
12 """
13 Gets textual values for the fields.
14@@ -328,7 +331,7 @@
15 resource_id = resource['id']
16 # loop on each field on the res_ids we just have read
17 for field in resource:
18- if field in ('__last_update', 'id'):
19+ if field in self.__filtered_columns:
20 continue
21 values[field] = resource[field]
22 # get the textual value of that field for this record
23@@ -385,7 +388,7 @@
24 # loop on all the fields
25 for field_name, field_definition in pool.get(model.model)._all_columns.items():
26 #if the field_list param is given, skip all the fields not in that list
27- if field_list and field_name not in field_list:
28+ if field_list and field_name not in field_list or field_name in self.__filtered_columns:
29 continue
30 field_obj = field_definition.column
31 if field_obj._type in ('one2many','many2many'):