credativ team mailing list archive
-
credativ team
-
Mailing list archive
-
Message #05175
lp:~therp-nl/openupgrade-server/7.0-lp1111298-remove_currency_companies into lp:openupgrade-server
Stefan Rijnhart (Therp) has proposed merging lp:~therp-nl/openupgrade-server/7.0-lp1111298-remove_currency_companies into lp:openupgrade-server.
Requested reviews:
OpenUpgrade Committers (openupgrade-committers)
Related bugs:
Bug #1111298 in OpenUpgrade Server: "[Trunk/7.0] can not validate invoice in multi-company"
https://bugs.launchpad.net/openupgrade-server/+bug/1111298
For more details, see:
https://code.launchpad.net/~therp-nl/openupgrade-server/7.0-lp1111298-remove_currency_companies/+merge/166216
--
https://code.launchpad.net/~therp-nl/openupgrade-server/7.0-lp1111298-remove_currency_companies/+merge/166216
Your team OpenUpgrade Committers is requested to review the proposed merge of lp:~therp-nl/openupgrade-server/7.0-lp1111298-remove_currency_companies into lp:openupgrade-server.
=== modified file 'openerp/addons/base/migrations/7.0.1.3/post-migration.py'
--- openerp/addons/base/migrations/7.0.1.3/post-migration.py 2013-05-03 12:57:10 +0000
+++ openerp/addons/base/migrations/7.0.1.3/post-migration.py 2013-05-29 10:54:27 +0000
@@ -164,6 +164,18 @@
}
partner_obj.write(cr, SUPERUSER_ID, row[1], partner_vals)
+def reset_currency_companies(cr, pool):
+ """
+ Having a company on currencies affects multicompany databases
+ https://bugs.launchpad.net/openobject-server/+bug/1111298
+ """
+ currency_ids = pool.get('res.currency').search(
+ cr, SUPERUSER_ID, [('company_id', '!=', False)],
+ {'active_test': False})
+ pool.get('res.currency').write(
+ cr, SUPERUSER_ID, currency_ids,
+ {'company_id': False})
+
@openupgrade.migrate()
def migrate(cr, version):
pool = pooler.get_pool(cr.dbname)
@@ -176,3 +188,4 @@
migrate_company(cr)
migrate_partner_address(cr, pool)
update_users_partner(cr, pool)
+ reset_currency_companies(cr, pool)
Follow ups