← Back to team overview

openupgrade-drivers team mailing list archive

[Question #227533]: what does the version checker inside openupgrade server do?

 

New question #227533 on OpenUpgrade Server:
https://answers.launchpad.net/openupgrade-server/+question/227533

I have written a testmodule called 'ou_testmodule', under version 6.0.
I have rewritten the same module under version 6.1

I have made I database under version 6.0 and made some records for classes inside 'ou_testmodule'.
When I migrate the database, I notice that ou_testmodule' is skipped.

I found I that this has to do with version information with respect to this module and the server.

It all starts here:

  [/openerp/modules/migration.py]
class MigrationManager(object):
    def migrate_module(self, pkg, stage):

       [checks]
        mod.migrate(self.cr, pkg.installed_version)

in mod.migrate, the pre en post migration files are executed, of the particular module.

but this is only done if the checks are passed.
This expression is quite crucial:
if parsed_installed_version < parse_version(convert_version(version)) <= current_version:
which can be rewritten (using substitutions) to:

parse_version(pkg.installed_version or '')  < parse_version(convert_version(version))   <=  
                      parse_version(convert_version(pkg.data['version']))

without parse_version, this is equal to
pkg.installed_version < convert_version(version) <= convert_version(pkg.data['version'])


during migration, using print commands, I get following information:
0.functie: migrate_module
0.pkg.name:  ou_testmodule

0.pkg.installed_version 6.1.1.0
0.pkg.data['version'] 1.0
0.versions:  [u'6.1.1.1']

pkg.installed_version                                       :  6.1.1.0
convert_version(version) , version                          :  6.1.1.1 , 6.1.1.1
convert_version(pkg.data['version']) , pkg.data['version']  :  6.1.1.0 , 1.0

1.parsed_installed_version                :  (u'00000006', u'00000001', u'00000001', '*final')
1.parse_version(convert_version(version)) :  (u'00000006', u'00000001', u'00000001', u'00000001', '*final')
1.current_version                         :  ('00000006', '00000001', '00000001', '*final')

1.parsed_installed_version < parse_version(convert_version(version))  :  True
1.parse_version(convert_version(version)) <= current_version          :  False

pkg.installed_version refers to a field inside the class base/module/module.py, called module
this field appears to be a fields.function, which is calculated using version information inside __openerp__.py inside the the particular module (ou_testmodule in this case), and inside release.py (openerp server version information).

How must I set the version information correctly, to get pass the version check???

regards,
Jeroen
OneStein, Netherlands



-- 
You received this question notification because you are a member of
OpenUpgrade Drivers, which is an answer contact for OpenUpgrade Server.