forked from OCA/stock-logistics-warehouse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request OCA#345 from Eficent/10.0-fix-stock_disable_force_…
…availability_button [10.0][FIX] stock_disable_force_availability_button: Migration scripts
- Loading branch information
Showing
3 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
stock_disable_force_availability_button/migrations/10.0.1.0.0/openupgrade_analysis.txt
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
---Fields in module 'stock_disable_force_availability_button'--- | ||
---XML records in module 'stock_disable_force_availability_button'--- | ||
NEW res.groups: stock_disable_force_availability_button.group_stock_force_availability | ||
DEL res.groups: stock.group_stock_force_availability |
6 changes: 6 additions & 0 deletions
6
stock_disable_force_availability_button/migrations/10.0.1.0.0/openupgrade_analysis_work.txt
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
---Fields in module 'stock_disable_force_availability_button'--- | ||
---XML records in module 'stock_disable_force_availability_button'--- | ||
NEW res.groups: stock_disable_force_availability_button.group_stock_force_availability | ||
# Done: Rename XML-IDs | ||
DEL res.groups: stock.group_stock_force_availability | ||
# Nothing to do: noupdate=0 records |
15 changes: 15 additions & 0 deletions
15
stock_disable_force_availability_button/migrations/10.0.1.0.0/pre-migration.py
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2017 Eficent <http://www.eficent.com> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
_xmlid_renames = [ | ||
('stock.group_stock_force_availability', | ||
'stock_disable_force_availability_button.group_stock_force_availability'), | ||
] | ||
|
||
|
||
def migrate(cr, version): | ||
for (old, new) in _xmlid_renames: | ||
query = ("UPDATE ir_model_data SET module = %s, name = %s " | ||
"WHERE module = %s and name = %s") | ||
cr.execute(query, tuple(new.split('.') + old.split('.'))) |