[IMP] orm,res.log: better handling of context in res.log entries

bzr revid: odo@openerp.com-20101021144546-1vetgysw0cljvppc
This commit is contained in:
sma@tinyerp.com 2010-10-21 16:45:46 +02:00 committed by Olivier Dony
parent f3f9478b6a
commit 3108df45f3
2 changed files with 9 additions and 6 deletions

View File

@ -55,7 +55,7 @@ class res_log(osv.osv):
unread_log_ids = self.search(cr, uid,
[('user_id','=',uid), ('read', '=', False)], context=context)
res = self.read(cr, uid, unread_log_ids,
['name','res_model','res_id'],
['name','res_model','res_id','context'],
context=context)
res.reverse()
result = []

View File

@ -386,11 +386,14 @@ class orm_template(object):
CONCURRENCY_CHECK_FIELD = '__last_update'
def log(self, cr, uid, id, message, secondary=False, context=None):
return self.pool.get('res.log').create(cr, uid, {
'name': message,
'res_model': self._name,
'secondary': secondary,
'res_id': id},
return self.pool.get('res.log').create(cr, uid,
{
'name': message,
'res_model': self._name,
'secondary': secondary,
'res_id': id,
'context': context,
},
context=context
)