Comment 110 for bug 1160365

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Thanks everyone for the tests and feedback. The 2 branches have been updated with several important changes (see also the updated descriptions on the MPs):

In addons:

1. revert the modified domain set on the partner field of Invoices - this was inconsistent with the rest of the system: it must be possible to invoice a contact everywhere. Concerning this, please note that Fabien's explanation in comment #50 was incorrect because we want to be able to create invoices for any contact. What happens is that you can configure the contact type on your partners so that the correct "invoice contact/department" is automatically selected regardless of the contact to which you sell. But you can still manually invoice any contact and the rest of the accounting flows will still be correct (and the reporting too).

2. fix issue detected by Joël Grand-Guillaume in comment #34 of bug 1160365: when invoicing after delivery, the invoicing contact/address must be used rather than the main customer. Tests updated accordingly.

3. add new module "account_report_company": this module adds an extra stored field "parent_commercial_id" on Invoices to make reporting/aggregating by partner easier in the Invoice list and in the Invoice Analysis report. This module is expected to be merged in the main account module in the next major release. The module can be installed without any risk on any existing 7.0 database.
Yes we know that many would have preferred to use an extra contact_id field and make the partner_id field refer to the "commercial entity", but this is actually inconsistent with the rest of the model: everywhere in OpenERP 7.0 we'll allow a "contact" level of granularity, we must not change that for a single case of reporting. It would also change the logic in a completely incompatible way depending on whether the module is installed or not, which is a lot worse.
Keep in mind that this module is added only to make reporting per Company easier on Invoices - not to alter the core level of granularity of partners in OpenERP 7.0.

In server:

3. 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.

4. fix incorrect autosync of `type` field along with other address fields - a different `type` makes sense even when address is inherited because they can have different name/email/phones/etc.

5. res.partner.name_search: make sure companies always come before contacts when both match, to make selection more predictable.

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

These branches are updated on runbot.openerp.com, please test them to see if you can still find specific issues, so we can proceed further.

Thanks a lot!