~therp-nl/openupgrade-server/6.0-use_orm

« back to all changes in this revision

Viewing changes to bin/addons/__init__.py

  • Committer: Stefan Rijnhart
  • Date: 2012-05-06 20:47:27 UTC
  • Revision ID: stefan@therp.nl-20120506204727-51ydup0d8bcwkbu1
[RFR] OpenUpgrade: move record table truncate to own module
[FIX] OpenUpgrade: Missing newlines in record report
[FIX] OpenUpgrade: Only log newly added orm instances

Show diffs side-by-side

added added

removed removed

Lines of Context:
834
834
        if hasattr(package, 'init') or hasattr(package, 'update') or package.state in ('to install', 'to upgrade'):
835
835
            # OpenUpgrade: add this module's models to the registry
836
836
            local_registry = {}
837
 
            for model in osv.orm.orm:
 
837
            for model in modules:
838
838
                log_model(model)
839
839
            compare_registries(cr, package.name)
840
840
 
939
939
    pool = pooler.get_pool(cr.dbname)
940
940
 
941
941
    registry = {}
942
 
    ### OpenUpgrade
943
 
    if (table_exists(cr, 'openupgrade_attribute') and
944
 
        table_exists(cr, 'openupgrade_record')):
945
 
        cr.execute(
946
 
            'TRUNCATE openupgrade_attribute, openupgrade_record;'
947
 
            )
948
 
    ### End OpenUpgrade
949
942
 
950
943
    try:
951
944
        processed_modules = []