Migrate Odoo module with script

202 Views Asked by At

My problem: I want to migrate lots of modules from OpenERP7 to Odoo 12.

I was thinking about reading the file and perform the migrations for fields, class names etc. all by searching on strings like "class" "def", "field".

There must be a better way to just "read" the python file so you've got the class defenitions etc. without actually "running" the code.

So actually the question is: Is there another way of migrating just the code than reading the plain text and process it?

for example my file in / output would be something like this

input

class res_partner(osv.osv):

    _columns = {
        'name': fields.char(
            string='Name'
        )
    }

    _defaults = {
        'name': 'MyDefaultName'
    }

output

class ResPartner(Models.Model):

    name = fields.Char(
        string='Name'
        default='MyDefaultName'
    )

I know this is only part of the migration but if I'd be able to write a script for the bulk it would save lots of time.

0

There are 0 best solutions below