[IMP] allow object to call themself in init() method
authorChristophe Simonis <christophe@tinyerp.com>
Wed, 11 Feb 2009 15:01:24 +0000 (16:01 +0100)
committerChristophe Simonis <christophe@tinyerp.com>
Wed, 11 Feb 2009 15:01:24 +0000 (16:01 +0100)
bzr revid: christophe@tinyerp.com-20090211150124-zn457946r1lg9ttc

bin/addons/__init__.py

index 57d5742..e43b91a 100644 (file)
@@ -336,11 +336,11 @@ def init_module_objects(cr, module_name, obj_list):
     logger.notifyChannel('init', netsvc.LOG_INFO, 'module %s: creating or updating database tables' % module_name)
     todo = []
     for obj in obj_list:
-        if hasattr(obj, 'init'):
-            obj.init(cr)
         result = obj._auto_init(cr, {'module': module_name})
         if result:
             todo += result
+        if hasattr(obj, 'init'):
+            obj.init(cr)
         cr.commit()
     todo.sort()
     for t in todo: