-
-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
l10n_fr_intrastat_product: Improve migration script
Update data for account.fiscal.position.template
- Loading branch information
1 parent
ca3ae67
commit 1c85879
Showing
6 changed files
with
33 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
|
@@ -2,12 +2,18 @@ | |
# @author: Alexis de Lattre <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from openupgradelib import openupgrade | ||
|
||
def migrate(cr, version): | ||
if not version: | ||
return | ||
|
||
cr.execute( | ||
'ALTER TABLE "l10n_fr_intrastat_product_declaration" RENAME "type" ' | ||
'TO "declaration_type"' | ||
) | ||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
if openupgrade.table_exists( | ||
env.cr, "l10n_fr_intrastat_product_declaration" | ||
) and openupgrade.column_exists( | ||
env.cr, "l10n_fr_intrastat_product_declaration", "type" | ||
): | ||
openupgrade.logged_query( | ||
env.cr, | ||
"ALTER TABLE l10n_fr_intrastat_product_declaration RENAME type " | ||
"TO declaration_type", | ||
) |
This file contains 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 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 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