[TMP) add computed for is_fullseason
This commit is contained in:
parent
2310a56a1b
commit
d2f379aeef
@ -47,7 +47,17 @@ 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('Not full season?', default=False)
|
is_fullseason = fields.Boolean('Is full season?',
|
||||||
|
compute='_compute_is_full_season', default=True)
|
||||||
|
|
||||||
|
@api.multi
|
||||||
|
@api.depends('date_start', 'date_stop')
|
||||||
|
def _compute_is_full_season(self):
|
||||||
|
""" Display date for is full season """
|
||||||
|
for activity in self:
|
||||||
|
if activity.date_start == activity.season_id.date_start and \
|
||||||
|
activity.date_stop == activity.season_id.date_end:
|
||||||
|
activity.is_fullseason = False
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
@api.depends('name', 'default_code')
|
@api.depends('name', 'default_code')
|
||||||
|
@ -60,7 +60,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
<field name="hour_stop" widget="float_time"
|
<field name="hour_stop" widget="float_time"
|
||||||
attrs="{'invisible': [('is_recurrent', '=', False)]}" />
|
attrs="{'invisible': [('is_recurrent', '=', False)]}" />
|
||||||
|
|
||||||
<field name="is_fullseason"
|
<field name="is_fullseason" readeonly="False"
|
||||||
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),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user