Merge lp:~therp-nl/openobject-server/7.0-lp1111298-remove_additional_company_assignments into lp:openobject-server/7.0

Proposed by Stefan Rijnhart (Opener)
Status: Merged
Merged at revision: 4998
Proposed branch: lp:~therp-nl/openobject-server/7.0-lp1111298-remove_additional_company_assignments
Merge into: lp:openobject-server/7.0
Diff against target: 35 lines (+0/-7)
2 files modified
openerp/addons/base/base_data.xml (+0/-6)
openerp/addons/base/currency_data.xml (+0/-1)
To merge this branch: bzr merge lp:~therp-nl/openobject-server/7.0-lp1111298-remove_additional_company_assignments
Reviewer Review Type Date Requested Status
Olivier Dony (Odoo) Needs Fixing
Review via email: mp+166211@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Hi Stefan,

Thanks for catching this missing part of the original fix! It's my fault for not reviewing it more carefully.

Your fix looks good, however it breaks the ORM test suite related to one2many fields. This happens because those tests are using "res.company.currency_ids" as an example o2m field, and are strongly coupled with res.currency default data :-(

You can see the result of the test failure on the runbot log (search for "list index out of range"):
   http://runbot.openerp.com/openerp-dev-7-0-bug-1111298-therp-11987/logs/test-all.txt

If you have some more time to spend on this, you should be able to fix it by setting a company on the res.currency records just before the relevant tests. That change will be rolled back at the end of the tests. Alternatively you can create extra test data or change the tests to use a different o2m field from any of the `base` models.
(Otherwise I'll try to fix it while merging)

Many thanks!

PS: you can have your merge proposals automatically tested by runbot if you subscribe the ~therp-nl team in runbot (the link to do so is in the partners portal).

review: Needs Fixing
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

I ended up fixing the tests while merging, thanks!

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Thanks, sorry I did not get round to fixing the tests myself.

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Don't be sorry, it's great that you provided the patch in first place :-)
I tried not to make the ownership of the patch lines confusing, by explicitly making an extra commit in a temporary branch before merging the whole thing at once.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openerp/addons/base/base_data.xml'
2--- openerp/addons/base/base_data.xml 2012-12-21 19:56:14 +0000
3+++ openerp/addons/base/base_data.xml 2013-05-29 10:36:31 +0000
4@@ -49,8 +49,6 @@
5 <field name="symbol">€</field>
6 <field name="rounding">0.01</field>
7 <field name="accuracy">4</field>
8- <!-- Company ID will be set later -->
9- <field name="company_id" eval="None"/>
10 </record>
11 <record id="rateEUR" model="res.currency.rate">
12 <field name="rate">1.0</field>
13@@ -86,10 +84,6 @@
14 <field name="company_id" ref="main_company"/>
15 </record>
16
17- <record id="EUR" model="res.currency">
18- <field name="company_id" ref="main_company"/>
19- </record>
20-
21 <record id="ir_mail_server_localhost0" model="ir.mail_server">
22 <field name="name">localhost</field>
23 <field name="smtp_host">localhost</field>
24
25=== modified file 'openerp/addons/base/currency_data.xml'
26--- openerp/addons/base/currency_data.xml 2013-05-17 08:03:19 +0000
27+++ openerp/addons/base/currency_data.xml 2013-05-29 10:36:31 +0000
28@@ -466,7 +466,6 @@
29 <field name="rounding">0.01</field>
30 <field name="accuracy">4</field>
31 <field name="symbol">¢</field>
32- <field name="company_id" ref="main_company"/>
33 </record>
34 <record id="rateCRC" model="res.currency.rate">
35 <field name="rate">691.3153</field>