Browse Source
[FIX] don't override defaults from context
pull/550/head
Holger Brunn
7 years ago
No known key found for this signature in database
GPG Key ID: 1C9760FECA3AE18
2 changed files with
8 additions and
5 deletions
-
partner_firstname/__manifest__.py
-
partner_firstname/models/res_partner.py
|
@ -7,7 +7,7 @@ |
|
|
{ |
|
|
{ |
|
|
'name': 'Partner first name and last name', |
|
|
'name': 'Partner first name and last name', |
|
|
'summary': "Split first name and last name for non company partners", |
|
|
'summary': "Split first name and last name for non company partners", |
|
|
'version': '10.0.2.1.0', |
|
|
|
|
|
|
|
|
'version': '10.0.2.1.1', |
|
|
'author': "Camptocamp, " |
|
|
'author': "Camptocamp, " |
|
|
"Grupo ESOC Ingeniería de Servicios, " |
|
|
"Grupo ESOC Ingeniería de Servicios, " |
|
|
"Tecnativa, " |
|
|
"Tecnativa, " |
|
|
|
@ -68,13 +68,16 @@ class ResPartner(models.Model): |
|
|
"""Invert name when getting default values.""" |
|
|
"""Invert name when getting default values.""" |
|
|
result = super(ResPartner, self).default_get(fields_list) |
|
|
result = super(ResPartner, self).default_get(fields_list) |
|
|
|
|
|
|
|
|
|
|
|
if not result.get('name'): |
|
|
|
|
|
return result |
|
|
|
|
|
|
|
|
inverted = self._get_inverse_name( |
|
|
inverted = self._get_inverse_name( |
|
|
self._get_whitespace_cleaned_name(result.get("name", "")), |
|
|
|
|
|
|
|
|
self._get_whitespace_cleaned_name(result["name"]), |
|
|
result.get("is_company", False)) |
|
|
result.get("is_company", False)) |
|
|
|
|
|
|
|
|
for field in inverted.keys(): |
|
|
|
|
|
if field in fields_list: |
|
|
|
|
|
result[field] = inverted.get(field) |
|
|
|
|
|
|
|
|
for field in inverted: |
|
|
|
|
|
if field in fields_list and field not in result: |
|
|
|
|
|
result[field] = inverted[field] |
|
|
|
|
|
|
|
|
return result |
|
|
return result |
|
|
|
|
|
|
|
|