-
-
Notifications
You must be signed in to change notification settings - Fork 820
[ADD] base #789
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
Merged
Merged
[ADD] base #789
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
89e34df
[ADD] base
hbrunn 33eb8bc
[FIX] flake8
hbrunn b58d6a1
[FIX] only run old server if there's something to run
hbrunn e4b785a
[ADD] Noupdate data changes for base
StefanRijnhart bb70cfc
Merge pull request #1 from StefanRijnhart/10.0-base_noupdate_data
hbrunn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| language: python | ||
| sudo: false | ||
|
|
||
| python: | ||
| - "2.7" | ||
|
|
||
| addons: | ||
| apt: | ||
| packages: | ||
| - expect-dev # provides unbuffer utility | ||
| - python-lxml # because pip installation is slow | ||
| - python-simplejson | ||
| - python-serial | ||
| - python-yaml | ||
| postgresql: "9.4" | ||
|
|
||
| env: | ||
| - DB=openupgrade ODOO=./odoo-bin | ||
|
|
||
| # Need flake8 for pep8 testing | ||
| install: | ||
| - pip install flake8 coveralls | ||
|
|
||
| # Test with flake for: | ||
| # * migration scripts | ||
| # * scripts/ directory | ||
| # * openerp/addons/openupgrade* directories | ||
| # * openerp/openupgrade/ directory | ||
| # use a max length of 120 | ||
| script: | ||
| - flake8 scripts --max-line-length=120 | ||
| - flake8 odoo/openupgrade --max-line-length=120 | ||
| - flake8 odoo/addons/openupgrade* --max-line-length=120 --filename=__init__.py --ignore=F401 | ||
| - flake8 odoo/addons/openupgrade* --max-line-length=120 --exclude=__init__.py | ||
| # only flake8 migration scripts from the openupgrade project, presumably | ||
| # identifyable by using the openupgrade helpers | ||
| - flake8 --max-line-length=120 $(find . \( -name 'pre-*.py' -or -name 'post-*.py' \) -exec grep -q openupgrade {} \; -print) | ||
| - flake8 odoo/addons/*/migrations/*/tests/ --max-line-length=120 | ||
| - flake8 addons/*/migrations/*/tests/ --max-line-length=120 | ||
| - npm install -g less less-plugin-clean-css | ||
| - createdb $DB | ||
| - wget -q -O- https://github.com/OCA/OpenUpgrade/releases/download/databases/9.0.psql | pg_restore -d $DB --no-owner | ||
| - cat odoo/addons/base/migrations/*/tests/*.yml addons/*/migrations/*/tests/*.yml > ../test_data90.yml || true | ||
| # Roundtrip to previous release to update the test database with additional test data | ||
| # Loading and committing test data without triggering post tests needs https://github.com/odoo/odoo/pull/13146. This is now included in OpenUpgrade. | ||
| - git fetch --depth 2 origin 9.0 | ||
| - git reset --hard `git ls-remote |grep refs/heads/9.0 |awk '{print $1}'` | ||
| - pip install -q -r requirements.txt | ||
| # this crashes if there is no test data | ||
| - if [ -s ../test_data90.yml ]; then ./openerp-server --database=$DB --test-file=`readlink -f ../test_data90.yml` --test-commit --stop-after-init; fi | ||
| - git reset -q --hard $TRAVIS_COMMIT | ||
| # Install Python requirements of target release | ||
| - pip install -q -r requirements.txt | ||
| # don't use pypi's openupgradelib, but the one from source to avoid choking | ||
| # on unreleased features in openupgradelib | ||
| - pip install --ignore-installed git+https://github.com/OCA/openupgradelib.git@master | ||
| # select modules and perform the upgrade | ||
| - MODULES=base,$(sed -n '/^+========/,$p' odoo/openupgrade/doc/source/modules90-100.rst | grep "Done\|Partial" | sed -n '/^|/ s/^|\([0-9a-z_]*\) *|.*$/\1/g p' | paste -d, -s) | ||
| - psql $DB -c "update ir_module_module set state='uninstalled' where name not in ('$(echo $MODULES | sed -e "s/,/','/g")')" | ||
| - echo Testing modules $MODULES | ||
| - OPENUPGRADE_TESTS=1 coverage run $ODOO --database=$DB --update=$MODULES --stop-after-init | ||
|
|
||
| after_success: | ||
| coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| <?xml version='1.0' encoding='utf-8'?> | ||
| <odoo> | ||
| <record id="gw" model="res.country"> | ||
| <field name="currency_id" ref="XOF"/> | ||
| </record> | ||
| <record id="tp" model="res.country"> | ||
| <field name="currency_id" ref="USD"/> | ||
| </record> | ||
| <record id="tj" model="res.country"> | ||
| <field name="currency_id" ref="TJS"/> | ||
| </record> | ||
| <record id="TRY" model="res.currency"> | ||
| <field name="symbol">₺</field> | ||
| </record> | ||
| </odoo> |
10 changes: 5 additions & 5 deletions
10
odoo/addons/base/migrations/10.0.1.3/openupgrade_analysis_work.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # coding: utf-8 | ||
| # © 2017 Opener BV <http://therp.nl> | ||
| # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
| from openupgradelib import openupgrade | ||
|
|
||
|
|
||
| @openupgrade.migrate(use_env=True) | ||
| def migrate(env, version): | ||
| openupgrade.load_data( | ||
| env.cr, 'base', 'migrations/10.0.1.3/noupdate_changes.xml' | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # -*- coding: utf-8 -*- | ||
| # © 2017 Therp BV <http://therp.nl> | ||
| # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
| from openupgradelib import openupgrade | ||
|
|
||
|
|
||
| @openupgrade.migrate() | ||
| def migrate(cr, version): | ||
| cr.execute( | ||
| # we rely on the ORM to write this value | ||
| 'alter table ir_model_fields add column store boolean' | ||
| ) | ||
| openupgrade.copy_columns(cr, { | ||
| 'ir_act_window': [ | ||
| ('target', None, None), | ||
| ], | ||
| }) | ||
| openupgrade.map_values( | ||
| cr, openupgrade.get_legacy_name('target'), 'target', | ||
| [ | ||
| ('inlineview', 'inline'), | ||
| ], | ||
| table='ir_act_window') | ||
| cr.execute( | ||
| "update ir_ui_view set type='kanban' where type='sales_team_dashboard'" | ||
| ) | ||
| cr.execute('update res_currency set symbol=name where symbol is null') | ||
| # create xmlids for installed languages | ||
| cr.execute( | ||
| '''insert into ir_model_data | ||
| (module, name, model, res_id) | ||
| select | ||
| 'base', | ||
| 'lang_' || | ||
| case | ||
| when char_length(code) > 2 then | ||
| case | ||
| when upper(substring(code from 1 for 2)) = | ||
| upper(substring(code from 4 for 2)) then | ||
| substring(code from 1 for 2) | ||
| else | ||
| code | ||
| end | ||
| else | ||
| code | ||
| end, | ||
| 'res.lang', id | ||
| from res_lang''') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a good practice to rename these fields to
Nonein case they are needed by other module. database_cleanup can later purge the column if you want.