[TMP] Check the date start ans date end related to season date
This commit is contained in:
parent
05c11c52cd
commit
ddfedce0cf
@ -102,6 +102,14 @@ class GolemActivity(models.Model):
|
|||||||
activity.date_start > activity.date_stop:
|
activity.date_start > activity.date_stop:
|
||||||
raise models.ValidationError(_('Start of the period cannot be '
|
raise models.ValidationError(_('Start of the period cannot be '
|
||||||
'after end of the period.'))
|
'after end of the period.'))
|
||||||
|
if activity.season_id.date_start > activity.date_start < activity.season_id.date_end:
|
||||||
|
msg = _(u'Start of the period is in range of an '
|
||||||
|
'existing period.')
|
||||||
|
raise models.ValidationError(msg)
|
||||||
|
if activity.season_id.date_end < activity.date_stop > activity.season_id.date_start:
|
||||||
|
msg = _(u'End of the period is in range of an '
|
||||||
|
'existing period.')
|
||||||
|
raise models.ValidationError(msg)
|
||||||
|
|
||||||
@api.onchange('season_id')
|
@api.onchange('season_id')
|
||||||
def _onchange_season_dates(self):
|
def _onchange_season_dates(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user