forked from Yaltik/golem
[TMP) Computed for is_fullseason
This commit is contained in:
parent
797461ab9e
commit
52ef7282d6
@ -48,18 +48,16 @@ class GolemActivity(models.Model):
|
|||||||
full_name = fields.Char('Name', compute='_compute_full_name', store=True,
|
full_name = fields.Char('Name', compute='_compute_full_name', store=True,
|
||||||
index=True)
|
index=True)
|
||||||
is_fullseason = fields.Boolean('Is full season?',
|
is_fullseason = fields.Boolean('Is full season?',
|
||||||
compute='_compute_is_full_season', default=True)
|
compute='_compute_is_full_season')
|
||||||
|
|
||||||
@api.multi
|
|
||||||
@api.depends('date_start', 'date_stop')
|
@api.depends('date_start', 'date_stop')
|
||||||
def _compute_is_full_season(self):
|
def _compute_is_full_season(self):
|
||||||
""" Display date for is full season """
|
""" Display date for is full season """
|
||||||
for activity in self:
|
for activity in self:
|
||||||
if activity.date_start == activity.season_id.date_start and \
|
if activity.date_start == activity.season_id.date_start and \
|
||||||
activity.date_stop == activity.season_id.date_end:
|
activity.date_stop == activity.season_id.date_end:
|
||||||
activity.is_fullseason = False
|
activity.is_fullseason = True
|
||||||
|
|
||||||
@api.multi
|
|
||||||
@api.depends('name', 'default_code')
|
@api.depends('name', 'default_code')
|
||||||
def _compute_full_name(self):
|
def _compute_full_name(self):
|
||||||
""" Provide a better displayed name """
|
""" Provide a better displayed name """
|
||||||
|
@ -64,10 +64,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
attrs="{'invisible':[('is_recurrent', '=', False)]}" />
|
attrs="{'invisible':[('is_recurrent', '=', False)]}" />
|
||||||
<field name="date_start"
|
<field name="date_start"
|
||||||
attrs="{'invisible':[('is_recurrent', '=', True),
|
attrs="{'invisible':[('is_recurrent', '=', True),
|
||||||
('is_fullseason', '=', False)]}" />
|
('is_fullseason', '=', True)]}" />
|
||||||
<field name="date_stop"
|
<field name="date_stop"
|
||||||
attrs="{'invisible':[('is_recurrent', '=', True),
|
attrs="{'invisible':[('is_recurrent', '=', True),
|
||||||
('is_fullseason', '=', False)]}" />
|
('is_fullseason', '=', True)]}" />
|
||||||
</group>
|
</group>
|
||||||
<group name="places">
|
<group name="places">
|
||||||
</group>
|
</group>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user