Merge remote-tracking branch 'odoo/7.0' into 7.0
[odoo/odoo.git] / addons / stock / migrations / 7.0.1.1.1 / pre-rename_sequence_code.py
1 __name__ = ("update internal picking sequence code and sequence")
2
3 def migrate(cr, version):
4     old_type = 'stock.picking'
5     new_type = 'stock.picking.internal'
6     cr.execute ("UPDATE ir_sequence_type SET code=%(newtype)s WHERE code=%(oldtype)s",
7                 {'newtype': new_type,
8                  'oldtype': old_type})
9     cr.execute ("UPDATE ir_sequence SET code=%(newtype)s WHERE code=%(oldtype)s",
10                 {'newtype': new_type,
11                  'oldtype': old_type})