← Back to team overview

credativ team mailing list archive

[Merge] lp:~zaber/openupgrade-addons/recreate-uom into lp:openupgrade-addons/6.0

 

Don Kirkby has proposed merging lp:~zaber/openupgrade-addons/recreate-uom into lp:openupgrade-addons/6.0.

Requested reviews:
  OpenUpgrade Committers (openupgrade-committers)
Related bugs:
  Bug #1025819 in OpenUpgrade Addons: "New units of measure reference old ones that have been deleted"
  https://bugs.launchpad.net/openupgrade-addons/+bug/1025819

For more details, see:
https://code.launchpad.net/~zaber/openupgrade-addons/recreate-uom/+merge/115411

Recreate any units of measure that were deleted.

**NOTE:** You need to merge the fix to bug 1025797 on the server project first.
-- 
https://code.launchpad.net/~zaber/openupgrade-addons/recreate-uom/+merge/115411
Your team OpenUpgrade Committers is requested to review the proposed merge of lp:~zaber/openupgrade-addons/recreate-uom into lp:openupgrade-addons/6.0.
=== modified file 'product/migrations/6.0.1.1/pre-migration.py'
--- product/migrations/6.0.1.1/pre-migration.py	2012-07-10 21:22:44 +0000
+++ product/migrations/6.0.1.1/pre-migration.py	2012-07-17 18:40:28 +0000
@@ -39,6 +39,15 @@
 
 @openupgrade.migrate()
 def migrate(cr, version):
+    category_id = openupgrade.find_valid_id(cr, 'product_uom_categ')
+    openupgrade.recreate_deleted_data(cr, 
+                                      'product.uom',
+                                      'product_uom',
+                                      {'category_id': category_id,
+                                       'name': 'recreated dummy',
+                                       'rounding': 1,
+                                       'factor': 1.0})
+
     openupgrade.rename_columns(cr, renamed_columns)
     update_packaging_type(cr)
     logger.warn(