[MERGE] trunk-base-action-rule-api (add hook on model after the pool is built)
bzr revid: rco@openerp.com-20121221150105-jllc61ixh758q6ev
This commit is contained in:
@@ -425,6 +425,11 @@ def load_modules(db, force_demo=False, status=None, update_module=False):
|
||||
_logger.error('At least one test failed when loading the modules.')
|
||||
else:
|
||||
_logger.info('Modules loaded.')
|
||||
|
||||
# STEP 7: call _register_hook on every model
|
||||
for model in pool.models.values():
|
||||
model._register_hook(cr)
|
||||
|
||||
finally:
|
||||
cr.close()
|
||||
|
||||
|
||||
@@ -5236,6 +5236,10 @@ class BaseModel(object):
|
||||
# for backward compatibility
|
||||
resolve_o2m_commands_to_record_dicts = resolve_2many_commands
|
||||
|
||||
def _register_hook(self, cr):
|
||||
""" stuff to do right after the registry is built """
|
||||
pass
|
||||
|
||||
# keep this import here, at top it will cause dependency cycle errors
|
||||
import expression
|
||||
|
||||
|
||||
Reference in New Issue
Block a user