Add migration for analytic - #802
Conversation
| NEW ir.ui.view: analytic.account_analytic_tag_form_view | ||
| NEW ir.ui.view: analytic.account_analytic_tag_tree_view | ||
| DEL ir.ui.view: analytic.account_analytic_chart_view | ||
|
|
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
| from openupgradelib import openupgrade | ||
|
|
||
| @openupgrade.migrate(use_env=False) |
There was a problem hiding this comment.
Don't change the default use_env=True, and make your calls with env.cr instead of cr, because if the environment is later needed, then we need to change all calls, as it happened in https://github.com/OCA/OpenUpgrade/pull/803/files#diff-cd4cccdd111034d7430f83844f9d6372
| # copy columns good practice in pre-mig script format of colum_spec should | ||
| # be: { Table_name_in_db : [( old_column_name , new_column_name, type)] | ||
| # defaults of new columname are fetchable via method get_legacy_name | ||
| openupgrade.copy_columns( cr, { |
|
|
||
| @openupgrade.migrate(use_env=False) | ||
| def migrate(cr, version): | ||
| # copy columns good practice in pre-mig script format of colum_spec should |
There was a problem hiding this comment.
Better to just rename the column to None. You don't need to copy values.
| @@ -0,0 +1,19 @@ | |||
| - | |||
There was a problem hiding this comment.
I don't see the test that checks that these accounts are inactive.
There was a problem hiding this comment.
There was a problem hiding this comment.
test code added to repo
ba927fe to
c4d10d9
Compare
pedrobaeza
left a comment
There was a problem hiding this comment.
The error is due to crm module
| from openerp.tests.common import TransactionCase | ||
|
|
||
|
|
||
| class TestAnalytic(TransactionCase) |
There was a problem hiding this comment.
I have just discovered that this is not being executed, or this would be marked as error, as it misses the final :
There was a problem hiding this comment.
I'm fixing the issues directly for getting a green build: https://travis-ci.org/OCA/OpenUpgrade/builds/232892182#L357
There was a problem hiding this comment.
Partially fixed on 993e0ec. Switching to PR for trying to fix the other error: https://travis-ci.org/OCA/OpenUpgrade/builds/232906089#L428
Description of the issue/feature this PR addresses:
Current behavior before PR:
Desired behavior after PR is merged:
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr