=== modified file 'account/migrations/6.0.1.1/pre-migration.py'
--- account/migrations/6.0.1.1/pre-migration.py	2012-06-07 14:51:52 +0000
+++ account/migrations/6.0.1.1/pre-migration.py	2012-07-29 18:01:24 +0000
@@ -45,4 +45,8 @@
     # changes data type of one of the columns
     sql.drop_view_if_exists(cr, 'report_invoice_created')
     mgr_refund_journal_type(cr)
-
+    # company of account_period needs to be updated before defaults
+    # are applied
+    cr.execute('alter table account_period add column company_id integer')
+    cr.execute('update account_period set company_id=(select '+
+    'company_id from res_users where id=account_period.create_uid)')

