summaryrefslogtreecommitdiff
path: root/addons/web/doc/module/static/src/css/web_example.css.1.diff
diff options
context:
space:
mode:
authorOlivier Dony <odo@openerp.com>2013-04-08 03:37:42 +0200
committerOlivier Dony <odo@openerp.com>2013-04-08 03:37:42 +0200
commit2bf1034cd2fca0115bc38a6c75a6d213a833c6a3 (patch)
treed182e68cfd0f02820c4d8438bfc7b52318a6d7f5 /addons/web/doc/module/static/src/css/web_example.css.1.diff
parent161841af7e0e0928fffd94d8cf9b8feed5aecc09 (diff)
[FIX] res.partner: autosync of commercial fields and address fields + correct views accordingly + basic tests
* Commercial fields (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_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. [This is Part A of the solution on bug 1160365]. Then, whenever a partner is created or modified: - if it is a commercial entity, the commercial fields are synced downstream to all its descendants, stopping at company boundaries. - if is is not a commercial entity, the commercial fields are synced from its parent commercial entity. The list of fields to sync is determined by calling the new res.partner method `_commercial_fields()` which can be easily extended by any module that adds commercial fields on res.partner. A utility method `open_commercial_entity()` was added to res.partner to make it easy to include a button for editing the parent commercial entity, to be displayed instead of now-hidden commercial fields. [This is part B of the solution on bug 1160365] The res.partner.address_get() method (used to find child partners of certain types, e.g. "invoice") was udpated to take the new "commercial entity" notion into account: it will now look for matches in children but also parents and siblings that are part of the same "commercial entity". The default partner `type` is now "contact" to reflect the new model ; "default" is inappropriate because it is a wildcard and would stop the type lookup early. [This composes parts C and D of the solution on bug 1160365] Note: This fix comes with a matching addons fix to implement module-specific extensions of part B, as well as part E of the solution. * Address fields (bug 1160425) Corrected autosync of address fields is also included in the same branch, because those two mechanisms are closely related and share some parts of the implementation. The `use_parent_address` field now defaults to False (except in the mini-kanban view of contacts on a partner form), and the autosync of address fields has been modified to only work downstream and never update a parent company if a child contact is modified. Instead, the address fields are now displayed readonly on contacts that use the parent address, with a button to edit the parent address (new method open_parent(), similar to open_commercial_entity() but opening the direct parent). To make the initial creation of a contact + company pair, a special case was added: when a new contact is created for a company that has no other contact and no address, the address of the contact is assumed to be that of the company so it is moved to the company, then the `use_parent_address` flag is enabled on the contact, and the `is_company` flag on the company. This covers a use case where contact and company are created on-the-fly when creating a new document. Many logical flaws in the autosync of address fields have been corrected and are now covered by unit tests. * Misc related fixes - checking `is_company` does not reset the parent_id field anymore, to allow for multi-level structures. The field is still hidden automatically because having an empty "Company" field on the form view of a company is quite suprising), but this UI behavior is easily customized; - the `email`, `phone`, `fax`, `mobile`, `lang`, etc. that were sometimes synced when changing parent company are now properly left alone; - the `use_parent_address` field is now always visible next to the parent_id field when a parent is set lp bug: https://launchpad.net/bugs/1160425 fixed lp bug: https://launchpad.net/bugs/1160365 fixed bzr revid: odo@openerp.com-20130408013742-tm8w0w0nmunanokk
Diffstat (limited to 'addons/web/doc/module/static/src/css/web_example.css.1.diff')
0 files changed, 0 insertions, 0 deletions