|
@ -5,7 +5,7 @@ from openerp import SUPERUSER_ID |
|
|
class mail_thread(osv.Model): |
|
|
class mail_thread(osv.Model): |
|
|
_inherit = "mail.thread" |
|
|
_inherit = "mail.thread" |
|
|
|
|
|
|
|
|
def message_track(self, cr, uid, ids, tracked_fields, initial_values, context=None): |
|
|
|
|
|
|
|
|
def message_track(self, cr, uid, ids, tracked_fields, initial_values, context={}): |
|
|
|
|
|
|
|
|
def convert_for_display(value, col_info): |
|
|
def convert_for_display(value, col_info): |
|
|
if not value and col_info['type'] == 'boolean': |
|
|
if not value and col_info['type'] == 'boolean': |
|
@ -32,6 +32,8 @@ class mail_thread(osv.Model): |
|
|
if not tracked_fields: |
|
|
if not tracked_fields: |
|
|
return True |
|
|
return True |
|
|
|
|
|
|
|
|
|
|
|
update_fields = [f for f in tracked_fields] |
|
|
|
|
|
|
|
|
for browse_record in self.browse(cr, uid, ids, context=context): |
|
|
for browse_record in self.browse(cr, uid, ids, context=context): |
|
|
p = getattr(browse_record, 'partner_id', None) |
|
|
p = getattr(browse_record, 'partner_id', None) |
|
|
if p: |
|
|
if p: |
|
@ -41,6 +43,9 @@ class mail_thread(osv.Model): |
|
|
changes = set() |
|
|
changes = set() |
|
|
tracked_values = {} |
|
|
tracked_values = {} |
|
|
|
|
|
|
|
|
|
|
|
# update translation |
|
|
|
|
|
tracked_fields = self._get_tracked_fields(cr, uid, update_fields, browse_record._context) |
|
|
|
|
|
|
|
|
# generate tracked_values data structure: {'col_name': {col_info, new_value, old_value}} |
|
|
# generate tracked_values data structure: {'col_name': {col_info, new_value, old_value}} |
|
|
for col_name, col_info in tracked_fields.items(): |
|
|
for col_name, col_info in tracked_fields.items(): |
|
|
initial_value = initial[col_name] |
|
|
initial_value = initial[col_name] |
|
|