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')
|
||||
def _onchange_season_dates(self):
|
||||
""" Sets defaults dates according to membership type """
|
||||
for activity in self:
|
||||
if activity.membership_id:
|
||||
if not activity.date_start:
|
||||
activity.date_start = activity.membership_id.membership_date_from
|
||||
if not activity.date_end:
|
||||
activity.date_end = activity.membership_id.membership_date_to
|
||||
for season in self:
|
||||
if season.membership_id:
|
||||
if not season.date_start:
|
||||
season.date_start = season.membership_id.membership_date_from
|
||||
season.date_end = season.membership_id.membership_date_to
|
||||
|
||||
@api.constrains('date_start', 'date_end')
|
||||
def _check_period(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user