forked from Yaltik/golem
[TMP] update inchange season date
This commit is contained in:
parent
0e6efdaf46
commit
ec24ee4a48
@ -41,12 +41,11 @@ class GolemSeason(models.Model):
|
|||||||
@api.onchange('membership_id')
|
@api.onchange('membership_id')
|
||||||
def _onchange_season_dates(self):
|
def _onchange_season_dates(self):
|
||||||
""" Sets defaults dates according to membership type """
|
""" Sets defaults dates according to membership type """
|
||||||
for activity in self:
|
for season in self:
|
||||||
if activity.membership_id:
|
if season.membership_id:
|
||||||
if not activity.date_start:
|
if not season.date_start:
|
||||||
activity.date_start = activity.membership_id.membership_date_from
|
season.date_start = season.membership_id.membership_date_from
|
||||||
if not activity.date_end:
|
season.date_end = season.membership_id.membership_date_to
|
||||||
activity.date_end = activity.membership_id.membership_date_to
|
|
||||||
|
|
||||||
@api.constrains('date_start', 'date_end')
|
@api.constrains('date_start', 'date_end')
|
||||||
def _check_period(self):
|
def _check_period(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user