Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] docstring #83

Merged
merged 2 commits into from
Oct 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 10 additions & 8 deletions openupgradelib/openupgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 5 additions & 4 deletions openupgradelib/openupgrade_90.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down