[FIX] don't expect columns to be in the right order

and give default value for newly added required column
This commit is contained in:
Holger Brunn
2015-06-26 20:28:51 +02:00
parent 767457939f
commit 412bee8010

View File

@@ -36,10 +36,16 @@ def migrate(cr, installed_version):
return
query = "INSERT INTO account_banking_mandate " \
"(id, create_uid, create_date, write_date, write_uid, "\
"partner_bank_id, last_debit_date, scan, company_id, state, "\
"unique_mandate_reference, signature_date, sepa_migrated, "\
"original_mandate_identification, recurrent_sequence_type, type, "\
"scheme) "\
"SELECT id, create_uid, create_date, write_date, write_uid, " \
"partner_bank_id, last_debit_date, scan, company_id, state, " \
"unique_mandate_reference, signature_date, sepa_migrated, " \
"original_mandate_identification, recurrent_sequence_type, type " \
"original_mandate_identification, recurrent_sequence_type, type, "\
"'CORE' "\
"FROM sdd_mandate"
cr.execute(query)
query2 = "UPDATE account_invoice SET mandate_id=sdd_mandate_id"