[MERGE]
[odoo/odoo.git] / bin / addons / base / res / res_log.py
index 886221a..8ce4468 100644 (file)
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 ##############################################################################
-#    
+#
 #    OpenERP, Open Source Management Solution
 #    Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
 #
@@ -20,8 +20,8 @@
 ##############################################################################
 
 from osv import fields, osv
-import tools 
-
+import tools
+import time
 class res_log(osv.osv_memory):
     _name = 'res.log'
     _columns = {
@@ -29,12 +29,14 @@ class res_log(osv.osv_memory):
         'user_id': fields.many2one('res.users','User', required=True),
         'res_model': fields.char('Object', size=128),
         'res_id': fields.integer('Object ID'),
-        'secondary': fields.boolean('Secondary Log', help='Do not display this log if it belongs to the same object the user is working on')
+        'secondary': fields.boolean('Secondary Log', help='Do not display this log if it belongs to the same object the user is working on'),
+        'create_date': fields.datetime('Created Date', readonly=True),
     }
     _defaults = {
-        'user_id': lambda self,cr,uid,ctx: uid
+        'user_id': lambda self,cr,uid,ctx: uid,
+        'create_date': time.strftime('%Y-%m-%d %H:%M:%S')
     }
-    _order='date desc'
+    _order='create_date desc'
 
     # TODO: do not return secondary log if same object than in the model (but unlink it)
     def get(self, cr, uid, context={}):