Merge lp:~therp-nl/therp-backports/6.1-lp1111597 into lp:therp-backports

Proposed by Holger Brunn (Therp)
Status: Merged
Merged at revision: 6709
Proposed branch: lp:~therp-nl/therp-backports/6.1-lp1111597
Merge into: lp:therp-backports
Diff against target: 30 lines (+4/-2)
1 file modified
audittrail/audittrail.py (+4/-2)
To merge this branch: bzr merge lp:~therp-nl/therp-backports/6.1-lp1111597
Reviewer Review Type Date Requested Status
Stefan Rijnhart (Opener) (community) Approve
Review via email: mp+147079@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) :
review: Approve

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-11-14 12:14:58 +0000
3+++ audittrail/audittrail.py 2013-02-07 12:08:22 +0000
4@@ -174,6 +174,8 @@
5 """ Uses Object proxy for auditing changes on object of subscribed Rules"""
6
7 _default_recursive_level = 1
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@@ -332,7 +334,7 @@
14 resource_id = resource['id']
15 # loop on each field on the res_ids we just have read
16 for field in resource:
17- if field in ('__last_update', 'id'):
18+ if field in self.__filtered_columns:
19 continue
20 values[field] = resource[field]
21 # get the textual value of that field for this record
22@@ -391,7 +393,7 @@
23 # loop on all the fields
24 for field_name, field_definition in pool.get(model.model)._all_columns.items():
25 #if the field_list param is given, skip all the fields not in that list
26- if field_list and field_name not in field_list:
27+ if field_list and field_name not in field_list or field_name in self.__filtered_columns:
28 continue
29 field_obj = field_definition.column
30 if field_obj._type in ('one2many','many2many') and recursive_level:

Subscribers

People subscribed via source and target branches

to all changes: