~etsinko/openobject-server/bug1171495

Viewing all changes in revision 4946.

  • Committer: Olivier Dony
  • Date: 2013-04-20 03:25:29 UTC
  • mfrom: (4923.1.20 7.0)
  • Revision ID: odo@openerp.com-20130420032529-pvv6vuelp84bt26j
[MERGE] res.partner: many important fixes for contact/company management and address management, see bug 1160365

- Fix autosync of accounting/invoicing-related fields on contacts, just as if they were actually modeled as fields.related to the parent commercial entity. This starts with the addition of the new functional field `commercial_partner_id`, to locate the commercial entity for any partner. The commercial entity is defined as the first ancestor (starting at the partner itself) that is either marked `is_company` or has no parent.

- Corrected autosync of address fields (bug 1160425). Also included in the same patch, because those two mechanisms are closely related and share some parts of the implementation. "use_parent_address" now defaults to False, and auto-sync only happens downstream, except for a special case when creating a new company and a new contact at the same time

- `is_company` does not reset the parent_id field anymore, to allow for multi-level structures. The `parent_id` field now also stays visible if it has a non-empty value

- the `email`, `phone`, `fax`, `mobile`, `lang`, etc. that were sometimes synced when changing parent company are now properly left alone

- res.partner.address_get() now defaults to the partner being looked up rather than company when no match is found at all and no "default" exists. This avoids losing the contact info on invoices when a new contact+company pair is created.

- the embedded contact creation mini-form was updated to include the address fields and the `type` field

- res.partner.name_get now return "Company, Contact" rather than "Contact (Company)" to make it clearer that the company is selected as well.

- Added warning message when changing the Company of a Contact that already has a company, so it is clear that it should only be done if the Company was incorrect - in other cases a new contact must be created under the new company.

- Fixed search domains using "child_of" to also include deactived records, so that using this operator in the search view of business documents returns the expected results.

- fixed propagation of "is_supplier" flag when creation a parent company for a contact created on the fly on a Purchase Order, and when adding contacts to an existing Supplier Company

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: