Skip to content

Commit

Permalink
Merge pull request OCA#345 from Eficent/10.0-fix-stock_disable_force_…
Browse files Browse the repository at this point in the history
…availability_button

[10.0][FIX] stock_disable_force_availability_button: Migration scripts
  • Loading branch information
pedrobaeza committed Aug 29, 2017
2 parents 1d29d13 + a6fadee commit 02a2c3c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
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
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
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('.')))

0 comments on commit 02a2c3c

Please sign in to comment.