Previously, when receiving a new email to create a job applicant for an
existing partner, the process would inadvertently erase the phone and
mobile numbers on the partner by using the inverse method.
With this commit, the behavior is adjusted so that phone numbers are only
written in the inverse method on the partner if there is a number present on
the applicant. This prevents the inadvertent removal of phone numbers on the
partner when creating new applicants for existing partners.
Additionally, this commit ensures that phone numbers from the partner are
computed on the applicant as if they were related non-stored fields. This
avoids the need for manual re-encoding of numbers later and prevents the
inverse method from being forced again.
Furthermore, to optimize the process, email changes are now only processed
using the inverse method if the normalized version of the email is different.
This prevents unnecessary method calls on the highly used res.partner model
when the email is updated, particularly for cases where the normalized version
remains the same.
Previously, changing the partner's email from `jke@odoo.com` to
`"JKE" jke@odoo.com` would resend all waiting sign requests because the
normalized versions of the email were distinct. While ideally, this check could
be performed within the sign request code itself, this optimization now helps
prevent unnecessary overrides across all modules simultaneously.
closesodoo/odoo#163495
Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>