credativ team mailing list archive
-
credativ team
-
Mailing list archive
-
Message #05587
lp:~savoirfairelinux-openerp/openupgrade-addons/hr_employee_image into lp:openupgrade-addons
Sandy Carter (http://www.savoirfairelinux.com) has proposed merging lp:~savoirfairelinux-openerp/openupgrade-addons/hr_employee_image into lp:openupgrade-addons.
Requested reviews:
OpenUpgrade Committers (openupgrade-committers)
For more details, see:
https://code.launchpad.net/~savoirfairelinux-openerp/openupgrade-addons/hr_employee_image/+merge/192728
Will set to NULL odd image data that is of the form /openerp/image* which shows up in our production tests and blocks the upgrade
--
https://code.launchpad.net/~savoirfairelinux-openerp/openupgrade-addons/hr_employee_image/+merge/192728
Your team OpenUpgrade Committers is requested to review the proposed merge of lp:~savoirfairelinux-openerp/openupgrade-addons/hr_employee_image into lp:openupgrade-addons.
=== modified file 'hr/migrations/7.0.1.1/pre-migration.py'
--- hr/migrations/7.0.1.1/pre-migration.py 2013-09-18 15:56:04 +0000
+++ hr/migrations/7.0.1.1/pre-migration.py 2013-10-25 16:43:11 +0000
@@ -29,6 +29,18 @@
]
}
+
+def clean_hr_employee_image(cr):
+ """
+ Remove odd non-binary image data
+ """
+ openupgrade.logged_query(cr, """
+ UPDATE hr_employee
+ SET image = ''
+ WHERE image like '/openerp/image%%';""")
+
+
@openupgrade.migrate()
def migrate(cr, version):
openupgrade.rename_columns(cr, column_renames)
+ clean_hr_employee_image(cr)
Follow ups