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
=== modified file 'audittrail/audittrail.py'
--- audittrail/audittrail.py 2012-03-23 14:25:41 +0000
+++ audittrail/audittrail.py 2013-02-07 09:42:22 +0000
@@ -173,6 +173,9 @@
173class audittrail_objects_proxy(object_proxy):173class audittrail_objects_proxy(object_proxy):
174 """ Uses Object proxy for auditing changes on object of subscribed Rules"""174 """ Uses Object proxy for auditing changes on object of subscribed Rules"""
175175
176 "Columns to be filtered from audited fields"
177 __filtered_columns = ('__last_update', 'id')
178
176 def get_value_text(self, cr, uid, pool, resource_pool, method, field, value):179 def get_value_text(self, cr, uid, pool, resource_pool, method, field, value):
177 """180 """
178 Gets textual values for the fields.181 Gets textual values for the fields.
@@ -328,7 +331,7 @@
328 resource_id = resource['id']331 resource_id = resource['id']
329 # loop on each field on the res_ids we just have read332 # loop on each field on the res_ids we just have read
330 for field in resource:333 for field in resource:
331 if field in ('__last_update', 'id'):334 if field in self.__filtered_columns:
332 continue335 continue
333 values[field] = resource[field]336 values[field] = resource[field]
334 # get the textual value of that field for this record337 # get the textual value of that field for this record
@@ -385,7 +388,7 @@
385 # loop on all the fields388 # loop on all the fields
386 for field_name, field_definition in pool.get(model.model)._all_columns.items():389 for field_name, field_definition in pool.get(model.model)._all_columns.items():
387 #if the field_list param is given, skip all the fields not in that list390 #if the field_list param is given, skip all the fields not in that list
388 if field_list and field_name not in field_list:391 if field_list and field_name not in field_list or field_name in self.__filtered_columns:
389 continue392 continue
390 field_obj = field_definition.column393 field_obj = field_definition.column
391 if field_obj._type in ('one2many','many2many'):394 if field_obj._type in ('one2many','many2many'):