Code review comment for lp:~openerp-dev/openobject-server/7.0-fix-contact-company-handling

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

It looks great on adressing on invoicing issue and adresses synchronizing. Letting the parent_id will make things easier to have company affiliates

However there is still in my opinion one issue.

What about multi-level company + use_company_address ?

If you create a company and give it a parent company, the field use_company_address will be visible and used but only for one level.

So if you create the following hierarchy
Company A :
 is_company True
Company B :
 is_company True
 parent_id Company A;
 use_company_address True
Customer 1 :
  parent_id Company B;
  use_company_address True

If you do that, you will be able to edit only address on Company A, this is a good thing, however, it will only change Company A and Company B addresses. You cannot edit Customer 1 address

I see 2 options

A) forbidding partners with is_company='True' to have a use_company_address='True' plus hidding use_company_address field
I'm ok with this option as I do not see the case of contact having a contact as parent_id

B) the sync of address fields must be propagated downward recursively
This is already addressed for commercial field(s), so it could also be done for address fields

Otherwise, about the commercial fields, it seems it doesn't work properly

If you create a company with a vat number, and then you create a customer you link to this company, you will get a Constraint error "The vat of the partner must be unique !"

review: Needs Fixing (code, test)

« Back to merge proposal