[IMP] Creating new row in db also update write_date and write_uid

bzr revid: cto@openerp.com-20120323150850-26j5ht8eexue86sh
This commit is contained in:
Samus Aran 2012-03-23 16:08:50 +01:00
parent 1ba39859e2
commit 25e699d72d
1 changed files with 3 additions and 3 deletions

View File

@ -4172,9 +4172,9 @@ class BaseModel(object):
and vals[field]:
self._check_selection_field_value(cr, user, field, vals[field], context=context)
if self._log_access:
upd0 += ',create_uid,create_date'
upd1 += ",%s,(now() at time zone 'UTC')"
upd2.append(user)
upd0 += ',create_uid,create_date,write_uid,write_date'
upd1 += ",%s,(now() at time zone 'UTC'),%s,(now() at time zone 'UTC')"
upd2.extend((user, user))
cr.execute('insert into "'+self._table+'" (id'+upd0+") values ("+str(id_new)+upd1+')', tuple(upd2))
self.check_access_rule(cr, user, [id_new], 'create', context=context)
upd_todo.sort(lambda x, y: self._columns[x].priority-self._columns[y].priority)