Merge lp:~sylvain-legal/openupgrade-server/fix-res_partner-multi_company into lp:openupgrade-server

Proposed by Sylvain LE GAL (GRAP)
Status: Merged
Merged at revision: 4635
Proposed branch: lp:~sylvain-legal/openupgrade-server/fix-res_partner-multi_company
Merge into: lp:openupgrade-server
Diff against target: 12 lines (+1/-1)
1 file modified
openerp/addons/base/migrations/7.0.1.3/post-migration.py (+1/-1)
To merge this branch: bzr merge lp:~sylvain-legal/openupgrade-server/fix-res_partner-multi_company
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) code review Approve
Stefan Rijnhart (Opener) Approve
Review via email: mp+191069@code.launchpad.net

Commit message

[FIX] include 'company_id' in the creation of new res_partner (from obsolete res_partner_address)

To post a comment you must log in.
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Thank you! I was a bit surprised to see that company_id is set in 6.1 on the address independently of the partner, with no apparent syncronisation process. It seems to me that this could allow for slight corruptions in the partner structure. Would it not be safer to always take the company_id from the address partner? In that case, you can put the field in the propagate fields.

review: Needs Information
Revision history for this message
Sylvain LE GAL (GRAP) (sylvain-legal) wrote :

Thanks.

I think that in some specific cases, it's possible to have differencies between res_partner_address.company_id and res_partner.company_id.
1/ If there is a mother company who has a partner and many child companies who have each a res_partner_address (with specific company_id) ;
2/ res_partner.company_id = NULL for a common partner for all companies ;

Anyway, I don't know if it's a feature or a bug, but it's a "bug" that's a "6.1" bug AND a "7.0" bug...

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

I see, thank you for clariying. I would expect 'company_id' to be synchronized between parent and child partners but this is not the case so your solution is the correct one.

review: Approve
Revision history for this message
Holger Brunn (Therp) (hbrunn) :
review: Approve (code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openerp/addons/base/migrations/7.0.1.3/post-migration.py'
2--- openerp/addons/base/migrations/7.0.1.3/post-migration.py 2013-09-13 20:11:15 +0000
3+++ openerp/addons/base/migrations/7.0.1.3/post-migration.py 2013-10-14 22:09:09 +0000
4@@ -74,7 +74,7 @@
5 fields = [
6 'id', 'birthdate', 'city', 'country_id', 'email', 'fax', 'function',
7 'mobile', 'phone', 'state_id', 'street', 'street2', 'type', 'zip',
8- 'partner_id', 'name',
9+ 'partner_id', 'name', 'company_id'
10 ]
11 propagate_fields = [
12 'lang', 'tz',

Subscribers

People subscribed via source and target branches