Minor fix

This commit is contained in:
Oscar Alvarez 2021-02-02 17:04:04 -05:00
parent 206ac7bc3d
commit 27b659612e
1 changed files with 2 additions and 1 deletions

View File

@ -78,12 +78,13 @@ class SeverancePayClearing(Wizard):
])
mandatory_wages = MandatoryWage.search([
('employee', '!=', None),
('party', '!=', None),
('wage_type.type_concept', '=', 'retirement'),
])
parties_related = {}
for mw in mandatory_wages:
if not mw.party or not mw.employee.party:
if not mw or not mw.party or not mw.employee.party:
self.raise_user_error('missing_party', mw.wage_type.name, mw.employee.party.name)
parties_related[mw.employee.party.id] = mw.party.id