Browse Source

[UPDT] Bug fixed

pull/124/head
Ajmalcybrosys 6 years ago
parent
commit
c23f2c6610
  1. 6
      first_last_name/models/name.py
  2. 2
      gender_contact/models/gender.py

6
first_last_name/models/name.py

@ -28,13 +28,15 @@ class FirstNameLastName(models.Model):
@api.depends('name')
def _compute_first_name(self):
for i in self:
list = i.name.split(' ', 1) if i.name else None
if i.name :
list = i.name.split(' ', 1)
if list and i.company_type == 'person':
i.first_name = list[0]
@api.depends('name')
def _compute_last_name(self):
for i in self:
list = i.name.split(' ', 1) if i.name else None
if i.name:
list = i.name.split(' ', 1)
if len(list) == 2 and i.company_type == 'person':
i.last_name = list[1]

2
gender_contact/models/gender.py

@ -6,6 +6,6 @@ class FirstNameLastName(models.Model):
_inherit = 'res.partner'
gender = fields.Selection([ ('male', 'Male'),
('female', 'female'),
('female', 'Female'),
('other', 'Others')],
string='Gender')

Loading…
Cancel
Save