lp:~openerp-dev/openobject-server/7.0-fix-contact-company-handling

Created by Olivier Dony (Odoo) on 2013-04-08 and last modified on 2013-04-20
Get this branch:
bzr branch lp:~openerp-dev/openobject-server/7.0-fix-contact-company-handling
Members of OpenERP R&D Team can upload to this branch. Log in for directions.

Branch merges

Related bugs

Related blueprints

Branch information

Owner:
OpenERP R&D Team
Project:
Odoo Server (MOVED TO GITHUB)
Status:
Merged

Recent revisions

4943. By Olivier Dony (Odoo) on 2013-04-20

[FIX] res.partner: fix invisible attrs on Contacts tab, empty o2m field results in `[]`, not `False`

4942. By Olivier Dony (Odoo) on 2013-04-19

[FIX] test_expression: assertion was too sensitive to exact parameters

Now that res.partner.child_ids has an extra domain
attribute the exact number of parameters of queries
using `child_ids` in the WHERE clause is different.

4941. By Olivier Dony (Odoo) on 2013-04-19

[FIX] res.partner.name_get: partners marked as "is_company" should appear as standalone

This is more consistent with the way we expect reporting
to work, and will also ensure that these companies
appear right above their contacts in search order
(which will match name_get)

4940. By Olivier Dony (Odoo) on 2013-04-19

[REVERT] res.partner: undo change of ordering in name_search result, to be addressed via a stored display_name field (temporarily added by account_report_company module in 7.0)

4939. By Olivier Dony (Odoo) on 2013-04-19

[FIX] res.partner: search using 'child_of' should include inactive children

This is necessary for 2 reasons:
- when searching on Business documents the search domain will be
  [('partner_id', 'child_of', 'ACME')] in order to match all
  descendants, and it must match inactive children as well
- in other cases like for resolving IDs to update via store
  triggers, it is necessary that 'child_of' returns inactive
  children too.

The implementation is tricky because the ORM automatically
transform 'child_of' domains into recursive searches with
[('parent_id', 'in', ids)], which is the same query that the
reverse one2many 'child_ids' will also use to find contacts.
The overridden search() therefore matches this domain pattern
only when there is one criterion (to avoid side-effects in
other cases) and a dummy extra 'domain' was added to the
definition of the 'child_ids' o2m so it won't match.
The net result is that child_ids will not return inactive
children while child_of will return all descendants when
it is the only criterion. This is the expected behavior
whenever child_of is used on res.partner, because
it's safer to always show business documents.
The only side-effects will be for custom/manual search
calls with a single criterion of the form ('parent_id','in', x)
and those can be fixed by adding an extra domain
component ('active','=',True), just like child_ids does.

4938. By Olivier Dony (Odoo) on 2013-04-18

[FIX] res.partner: add onchange warning when changing an existing contact's company

4937. By Olivier Dony (Odoo) on 2013-04-18

[IMP] res.partner: rename commercial_id to commercial_partner_id + make function field inheritable

The name `commercial_partner_id` better reflects its
purpose and the fact that it is a FK to a partner.

An extra indirection through a lambda function was
also added to the definition of the function field
to make it possible to override it in other modules
(otherwise the function is passed by copy directly
and cannot be inherited later)

4936. By Olivier Dony (Odoo) on 2013-04-16

[FIX] res.partner: avoid hiding `parent_id` and `child_ids` fields if they are set, irregardless of the rest of the `is_company` flag

This prevents hiding real data and also allows creating more
complex/flexible structures by setting the values of these
fields before or after setting is_company, to reach the
desired result.

4935. By Olivier Dony (Odoo) on 2013-04-16

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

4934. By Olivier Dony (Odoo) on 2013-04-16

[FIX] res.partner: propagate `is_supplier` property when creating parent or child partner for a supplier

This is not necessary for the `is_customer` flag, as it is
always True by default (customers are created more frequently).
Passing the field value via an invisible field in the mini
contact form is necessary because context `default_*` values are
automatically discarded by the ORM when creating o2m
or m2m records (as they are supposed to apply to a different model).

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
Stacked on:
lp:openobject-server
This branch contains Public information 
Everyone can see this information.

Subscribers