Comment 16 for bug 1151947

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote : Re: [Bug 1151947] Re: Link several addresses on individual partners (not companies)

On 03/08/2013 11:05 AM, Guewen Baconnier @ Camptocamp wrote:
> Just a point, how will you determine who is the 'accounting partner'? Use
> the direct parent_id if such exists and the current partner has no
> children? It could maybe be a problem if one want to create a hierarchy of
> 'simple' partners, they would be mislead with a 'complex' partner with
> addresses. That's maybe a use case to forbid though.

The current _find_accounting_partner() method uses the direct parent if the
current one is not a company, and it needs to be improved.

To keep things simple, it could probably go all the way up to the root ancestor
in all cases (ignoring the `is_company` flag). That would work for companies
and for individuals. It would not allow complex hierarchies where different
children can be customers/suppliers and have their own receivable/payable
entries, so making separate partners for these special cases would still be
required. However it seems it would still cover most B2C and B2B cases, while
keeping the logic very simple to understand and use.

Then perhaps in trunk we could refine this behavior by relying more on the
`customer`/`supplier` flags: depending on the kind of journal entries being
generated the system could take the first `customer` or `supplier` parent in
the hierarchy, which would allow making multi-customer/supplier hierarchies.
However to make this robust we should make sure that contacts/addresses are
never flagged as customer/supplier implicitly, and help avoid mistakes by
raising an error when the partner flags aren't properly set at the moment of
generating the journal entries.
It sounds a bit complicated to understand and use properly though, so we need
to make sure it's really useful first.

What do you think?