minor fix in import employess

This commit is contained in:
Camilo Sarmiento 2020-09-11 17:38:35 -05:00
parent 5083dfc811
commit cb263a4b0a

View file

@ -228,22 +228,23 @@ class Employee(metaclass=PoolMeta):
])
if wages:
wage_id = wages[0].id
if row[19]:
parties = Party.search([('id_number', '=', row[19])])
if not parties and row[18]:
cls.raise_user_error('party_not_exists', row[19])
# parties = _create_party(Party, row[18])
party_id = parties[0].id
else:
party_id = None
if wage_id not in current_wages_ids:
if row[19]:
parties = Party.search([('id_number', '=', row[19])])
if not parties and row[18]:
cls.raise_user_error('party_not_exists', row[19])
# parties = _create_party(Party, row[18])
party_id = parties[0].id
else:
party_id = None
values_mand_wage.append({
'employee': employee.id,
'fix_amount': 0,
'party': party_id,
'wage_type': wage_id,
'analytic_account': accounts[0].id,
})
values_mand_wage.append({
'employee': employee.id,
'fix_amount': 0,
'party': party_id,
'wage_type': wage_id,
'analytic_account': accounts[0].id,
})
for wage in employee.category.wages_default:
parties = []