mirror of
https://bitbucket.org/presik/trytonpsk-staff_payroll_co.git
synced 2023-12-14 06:42:56 +01:00
Add raise error
This commit is contained in:
parent
61597aacc7
commit
c3a6293081
|
@ -113,6 +113,7 @@ class Liquidation(Workflow, ModelSQL, ModelView):
|
|||
'wrong_start_end': ('The date end can not smaller than date start'),
|
||||
'sequence_missing': ('Sequence liquidation is missing!'),
|
||||
'payroll_not_posted': ('The employee has payrolls does not posted!'),
|
||||
'error_dates': ('The dates for employee is wrong "%s"!'),
|
||||
})
|
||||
cls._transitions |= set((
|
||||
('draft', 'cancel'),
|
||||
|
@ -489,7 +490,10 @@ class Liquidation(Workflow, ModelSQL, ModelView):
|
|||
def on_change_with_time_contracting(self):
|
||||
delta = None
|
||||
if self.start_period and self.end_period and self.contract:
|
||||
date_start, date_end = self._get_dates()
|
||||
try:
|
||||
date_start, date_end = self._get_dates()
|
||||
except:
|
||||
self.raise_user_error('error_dates', self.employee.party.name)
|
||||
delta = self.get_time_contracting(date_start, date_end)
|
||||
return delta
|
||||
|
||||
|
|
Loading…
Reference in a new issue