Add check kind normal for duplicated payroll

This commit is contained in:
Oscar Alvarez 2020-11-23 11:39:58 -05:00
parent 5994a58db8
commit 180684eea5

View file

@ -220,6 +220,7 @@ class Payroll(Workflow, ModelSQL, ModelView):
payrolls = Payroll.search([
('period', '=', payroll.period.id),
('contract', '=', payroll.contract.id),
('kind', '=', 'normal'),
])
if len(payrolls) > 1:
cls.raise_user_error('payroll_exist_period',)