|
@ -358,6 +358,7 @@ class auditlog_rule(models.Model): |
|
|
if field_name in FIELDS_BLACKLIST: |
|
|
if field_name in FIELDS_BLACKLIST: |
|
|
continue |
|
|
continue |
|
|
field = self._get_field(log.model_id, field_name) |
|
|
field = self._get_field(log.model_id, field_name) |
|
|
|
|
|
# not all fields have an ir.models.field entry (ie. related fields) |
|
|
if field: |
|
|
if field: |
|
|
log_vals = self._prepare_log_line_vals_on_read( |
|
|
log_vals = self._prepare_log_line_vals_on_read( |
|
|
log, field, read_values) |
|
|
log, field, read_values) |
|
@ -389,9 +390,11 @@ class auditlog_rule(models.Model): |
|
|
if field_name in FIELDS_BLACKLIST: |
|
|
if field_name in FIELDS_BLACKLIST: |
|
|
continue |
|
|
continue |
|
|
field = self._get_field(log.model_id, field_name) |
|
|
field = self._get_field(log.model_id, field_name) |
|
|
log_vals = self._prepare_log_line_vals_on_write( |
|
|
|
|
|
log, field, old_values, new_values) |
|
|
|
|
|
log_line_model.create(log_vals) |
|
|
|
|
|
|
|
|
# not all fields have an ir.models.field entry (ie. related fields) |
|
|
|
|
|
if field: |
|
|
|
|
|
log_vals = self._prepare_log_line_vals_on_write( |
|
|
|
|
|
log, field, old_values, new_values) |
|
|
|
|
|
log_line_model.create(log_vals) |
|
|
|
|
|
|
|
|
def _prepare_log_line_vals_on_write( |
|
|
def _prepare_log_line_vals_on_write( |
|
|
self, log, field, old_values, new_values): |
|
|
self, log, field, old_values, new_values): |
|
@ -434,9 +437,11 @@ class auditlog_rule(models.Model): |
|
|
if field_name in FIELDS_BLACKLIST: |
|
|
if field_name in FIELDS_BLACKLIST: |
|
|
continue |
|
|
continue |
|
|
field = self._get_field(log.model_id, field_name) |
|
|
field = self._get_field(log.model_id, field_name) |
|
|
log_vals = self._prepare_log_line_vals_on_create( |
|
|
|
|
|
log, field, new_values) |
|
|
|
|
|
log_line_model.create(log_vals) |
|
|
|
|
|
|
|
|
# not all fields have an ir.models.field entry (ie. related fields) |
|
|
|
|
|
if field: |
|
|
|
|
|
log_vals = self._prepare_log_line_vals_on_create( |
|
|
|
|
|
log, field, new_values) |
|
|
|
|
|
log_line_model.create(log_vals) |
|
|
|
|
|
|
|
|
def _prepare_log_line_vals_on_create(self, log, field, new_values): |
|
|
def _prepare_log_line_vals_on_create(self, log, field, new_values): |
|
|
"""Prepare the dictionary of values used to create a log line on a |
|
|
"""Prepare the dictionary of values used to create a log line on a |
|
|