[FIX] FIxed last fix. changed fields must include invisible fields that are in the _track structure.

bzr revid: tde@openerp.com-20121219113205-wa5dt7vpsxjmwav0
This commit is contained in:
Thibault Delavallée 2012-12-19 12:32:05 +01:00
parent 95897cf9ac
commit fd8f0dfa65
2 changed files with 7 additions and 6 deletions

View File

@ -261,7 +261,6 @@ class crm_lead(base_stage, format_address, osv.osv):
multi='day_close', type="float", store=True),
'state': fields.related('stage_id', 'state', type="selection", store=True,
selection=crm.AVAILABLE_STATES, string="Status", readonly=True,
track_visibility=1,
help='The Status is set to \'Draft\', when a case is created. If the case is in progress the Status is set to \'Open\'. When the case is over, the Status is set to \'Done\'. If the case needs to be reviewed then the Status is set to \'Pending\'.'),
# Only used for type opportunity

View File

@ -341,11 +341,13 @@ class mail_thread(osv.AbstractModel):
if record[col_name] == initial[col_name] and getattr(self._all_columns[col_name].column, 'track_visibility', 0) == 2:
tracked_values[col_name] = dict(col_info=col_info['string'],
new_value=convert_for_display(record[col_name], col_info))
elif record[col_name] != initial[col_name] and getattr(self._all_columns[col_name].column, 'track_visibility', 0) in [1, 2]:
tracked_values[col_name] = dict(col_info=col_info['string'],
old_value=convert_for_display(initial[col_name], col_info),
new_value=convert_for_display(record[col_name], col_info))
changes.append(col_name)
elif record[col_name] != initial[col_name]:
if getattr(self._all_columns[col_name].column, 'track_visibility', 0) in [1, 2]:
tracked_values[col_name] = dict(col_info=col_info['string'],
old_value=convert_for_display(initial[col_name], col_info),
new_value=convert_for_display(record[col_name], col_info))
if col_name in tracked_fields:
changes.append(col_name)
if not changes:
continue