forked from Yaltik/golem
[FIX]GOLEM Season indepandance from golem_member and golem_activity
This commit is contained in:
parent
747fdeaa2c
commit
4f3555f0ab
@ -27,6 +27,6 @@
|
|||||||
'license': 'AGPL-3',
|
'license': 'AGPL-3',
|
||||||
'application': False,
|
'application': False,
|
||||||
'installable': True,
|
'installable': True,
|
||||||
'depends': ['base'],
|
'depends': ['membership'],
|
||||||
'data': ['views/golem_season_view.xml']
|
'data': ['views/golem_season_view.xml']
|
||||||
}
|
}
|
||||||
|
@ -58,14 +58,18 @@ class GolemSeason(models.Model):
|
|||||||
|
|
||||||
@api.one
|
@api.one
|
||||||
def do_default_season(self):
|
def do_default_season(self):
|
||||||
""" is_default on and ensure that only one is_default is active """
|
""" is_default on and ensure that only one is_default is active. Also
|
||||||
|
recomputes is_current for members and activities. For simplicity use a
|
||||||
|
magic trick around registry rather than double inheritance """
|
||||||
old_default_season = self.search([('is_default', '=', True)])
|
old_default_season = self.search([('is_default', '=', True)])
|
||||||
if old_default_season:
|
if old_default_season:
|
||||||
old_default_season.is_default = False
|
old_default_season.is_default = False
|
||||||
self.is_default = True
|
self.is_default = True
|
||||||
|
if 'golem.member' in self.env.registry:
|
||||||
all_members = self.env['golem.member'].search([])
|
all_members = self.env['golem.member'].search([])
|
||||||
all_members._compute_is_current()
|
all_members._compute_is_current()
|
||||||
all_members._compute_number()
|
all_members._compute_number()
|
||||||
|
if 'golem.activity' in self.env.registry:
|
||||||
self.env['golem.activity'].search([])._compute_is_current()
|
self.env['golem.activity'].search([])._compute_is_current()
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user