[FIX] res.config.installer: correct module installing
[FIX] res.config.installer: correct module installing
[FIX] Passed context in write(...)(Courtesy: Humberto Arocha(hbto)). (Maintenance Case: 586824)
Launchpad automatic translations update.
[FIX] workers limit cron memory usage
Launchpad automatic translations update.
Launchpad automatic translations update.
[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
Launchpad automatic translations update.
[FIX] report, trml2pdf: allow to use <pageNumber/> tag under a flowable area (<place>...<place/>).
[IMP] base, res_partner and contacts management: improve usability and user experience.
1) whennever a contact is created from a parent record: allow to set a dedicated address
2) move the use_parent_address field near the address
Launchpad automatic translations update.
[IMP] res.partner form view, autofocus Contact notebook/page on visibility change
Launchpad automatic translations update.
[FIX] res.partner.address_get: default to partner being looked up rather than company when no match is found at all (and no "default" exists)

Using the commercial entity is not a very good default choice
in many cases. If a new contact is created on-the-fly for a
new document (e.g. sales order), his/her company may be an
empty shell and/or a large corporation that should not be
directly used for e.g. billing/invoicing purposed.
Once a contact/company is set to "invoicing" or "delivery"
we use it, but in other cases we stick to the provided
partner/contact as a saner default.
This should not change anything for cases where advanced
contact management is used and proper address types are
set.
[FIX] res.partner address sync: `type` field should not be synced wih other address fields

It is valid to use the parent address but still set a different
type of address - the name, email, phone, etc. could be different.
[FIX] res.partner.name_search: make sure companies always come before contacts when both match
[FIX] res.partner form view: remove now useless oe_inline class so `company` field can take 100% width of parent div
[FIX] res.partner form: switch default `use_parent_address` to False in kanban contact too, replace by defaults for address fields

We should never turn the `use_parent_address` option on
unless the user explicitly wants to use it. It makes
further editing more convoluted (need to go to the
company address) and is really an advanced feature.

It was only set by via context defaults when adding
contacts to a company ; we can replace that with a
set of defaults that will copy the company address
fields to the contact. Users can still switch to
automatic synchronization if they really want it,
or simply further edit the address of the contact.

Also fixed the layout of the mini-form view, now
using a simpler vertical layout with address at
bottom, since the main info of a contact needs
to be entered first.
Launchpad automatic translations update.