1 Commits

Author SHA1 Message Date
Sébastien Pulver
24c2c1e902 Migrate and convert module from odoo 8.0 to flectra 1.0 2018-12-13 11:20:25 +01:00
3 changed files with 5 additions and 4 deletions

2
.gitignore vendored
View File

@@ -1,5 +1,3 @@
/data
.idea/
__pycache__/
flectra/
odoo/

View File

@@ -8,8 +8,8 @@ if __name__ == "__main__":
start_time = time.time()
parser = argparse.ArgumentParser(description='Migrate Odoo repositories to Flectra')
parser.add_argument('--name', help='Name of Repository')
parser.add_argument('--company', default='2BIT AG', help='Name of Company')
parser.add_argument('--contributor', default='2BIT AG <info@2bit.ch>', help='Name of Contributor')
parser.add_argument('--company', default='Jamotion GmbH', help='Name of Repository')
parser.add_argument('--contributor', default='Jamotion <info@jamotion.ch>', help='Name of Repository')
parser.add_argument('--src', default='./odoo', help='Path to odoo repository')
parser.add_argument('--dest', default='./flectra', help='Path to flectra repository')
parser.add_argument('--debug', default=False, action='store_true', help='Loglevel: DEBUG')
@@ -40,6 +40,7 @@ if __name__ == "__main__":
repo_dst_path = os.path.abspath(args.dest)
migrator = RepoMigrator(args.name, repo_src_path, repo_dst_path, args.company, args.contributor)
migrator.migrate()
migrator.generate_gitlab_ci()
_logger.info('Module migration finished')
_logger.info('Migration took {0} second'.format(time.time() - start_time))

View File

@@ -5,6 +5,7 @@ import logging
import os
import re
import shutil
import subprocess
from os.path import join as oj
from shutil import copytree
@@ -213,6 +214,7 @@ class ModuleMigrator(object):
def migrate(self):
_logger.info('Starting migration of module %s', self._module_name)
copytree(self._src, self._destination, symlinks=True, ignore_dangling_symlinks=True)
subprocess.call(['2to3', '-w', self._destination])
for base, odoo_dirs, odoo_files in os.walk(self._destination, topdown=True):
odoo_files = [f for f in odoo_files if not f[0] == '.']
odoo_dirs[:] = [d for d in odoo_dirs if not d[0] == '.']