Skip to content

Commit

Permalink
Merge pull request #83 from hbrunn/master-fix_docstring
Browse files Browse the repository at this point in the history
[FIX] docstring
  • Loading branch information
pedrobaeza authored Oct 10, 2017
2 parents 6b3d130 + cf3e3d7 commit 78991b0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
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

0 comments on commit 78991b0

Please sign in to comment.