diff --git a/.travis.yml b/.travis.yml index fa01cfd6..e1e3a291 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,15 +10,22 @@ python: # - "pypy" # Disable because travis changes are affecting us - "pypy3" +addons: + apt: + packages: + - realpath + # command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors install: - pip install -r requirements.txt - if [ "$TRAVIS_PYTHON_VERSION" == "2.7" ]; then pip install -r https://raw.githubusercontent.com/OCA/OCB/8.0/requirements.txt; fi - if [ "$TRAVIS_PYTHON_VERSION" == "2.7" ]; then pip install -r https://raw.githubusercontent.com/OCA/OCB/9.0/requirements.txt; fi + - if [ "$TRAVIS_PYTHON_VERSION" == "2.7" ]; then pip install sphinx; fi # command to run tests, e.g. python setup.py test script: - flake8 ~/OCA/openupgradelib + - if [ "$TRAVIS_PYTHON_VERSION" == "2.7" ]; then git clone --single-branch --depth=1 https://github.com/OCA/openupgrade ~/OCA/openupgrade; pip install -r ~/OCA/openupgrade/requirements.txt; sh ~/OCA/openupgrade/scripts/build_openupgrade_docs; fi - if [ "$TRAVIS_PYTHON_VERSION" == "2.7" ]; then export PYTHONPATH=~/OCA/openupgradelib:$PYTHONPATH; fi - coverage run setup.py test - python setup.py install diff --git a/openupgradelib/openupgrade.py b/openupgradelib/openupgrade.py index 2470f687..b6ec8a5a 100644 --- a/openupgradelib/openupgrade.py +++ b/openupgradelib/openupgrade.py @@ -254,14 +254,16 @@ def load_data(cr, module_name, filename, idref=None, mode='init'): :param filename: the path to the filename, relative to the module \ directory. :param idref: optional hash with ?id mapping cache? - :param mode: one of 'init', 'update', 'demo', 'init_no_create'. \ - Always use 'init' for adding new items from files that are marked with \ - 'noupdate'. Defaults to 'init'. - 'init_no_create' is a hack to load data for records which have \ - forcecreate=False set. As those records won't be recreated during the \ - update, standard Odoo would recreate the record if it was deleted, \ - but this will fail in cases where there are required fields to be \ - filled which are not contained in the data file. + :param mode: + one of 'init', 'update', 'demo', 'init_no_create'. + Always use 'init' for adding new items from files that are marked with + 'noupdate'. Defaults to 'init'. + + 'init_no_create' is a hack to load data for records which have + forcecreate=False set. As those records won't be recreated during the + update, standard Odoo would recreate the record if it was deleted, + but this will fail in cases where there are required fields to be + filled which are not contained in the data file. """ if idref is None: diff --git a/openupgradelib/openupgrade_90.py b/openupgradelib/openupgrade_90.py index 8f0b9c41..06cc9766 100644 --- a/openupgradelib/openupgrade_90.py +++ b/openupgradelib/openupgrade_90.py @@ -30,10 +30,11 @@ def convert_binary_field_to_attachment(env, field_spec): :param env: Odoo environment :param field_spec: A dictionary with the ORM model name as key, and as dictionary values a tuple with: - * field name to be converted as attachment as first element. - * SQL column name that contains actual data as second element. If - the second element is None, then the column name is taken - calling `get_legacy_name` method, which is the typical technique. + + * field name to be converted as attachment as first element. + * SQL column name that contains actual data as second element. If + the second element is None, then the column name is taken + calling `get_legacy_name` method, which is the typical technique. """ logger = logging.getLogger('OpenUpgrade') attachment_model = env['ir.attachment']