diff --git a/all_in_one_schedule_activity_management/models/mail_activity.py b/all_in_one_schedule_activity_management/models/mail_activity.py index 06259afec..9ac63414a 100644 --- a/all_in_one_schedule_activity_management/models/mail_activity.py +++ b/all_in_one_schedule_activity_management/models/mail_activity.py @@ -46,16 +46,16 @@ class MailActivity(models.Model): help="state for the activity", ) active = fields.Boolean("Active", default=True, help="The record make Active") - type = fields.Selection( - [ - ("overdue", "Overdue"), - ("today", "Today"), - ("planned", "Planned"), - ("done", "Done"), - ("cancel", "Cancelled"), - ], - help="Type for the activity", - ) + # type = fields.Selection( + # [ + # ("overdue", "Overdue"), + # ("today", "Today"), + # ("planned", "Planned"), + # ("done", "Done"), + # ("cancel", "Cancelled"), + # ], + # help="Type for the activity", + # ) activity_type = fields.Many2many( "activity.tag", string="Activity Type", help="Activity type" ) @@ -219,29 +219,29 @@ class MailActivity(models.Model): return messages, next_activities - @api.model - def _compute_state_from_date(self, date_deadline, tz=False): - """Compute the state""" - date_deadline = fields.Date.from_string(date_deadline) - today_default = date.today() - today = today_default - if tz: - today_utc = pytz.utc.localize(datetime.utcnow()) - today_tz = today_utc.astimezone(pytz.timezone(tz)) - today = date(year=today_tz.year, month=today_tz.month, day=today_tz.day) - diff = date_deadline - today - for rec in self: - if rec.state == "done": - return "done" - elif rec.type == "cancel": - return "cancel" - else: - if diff.days == 0: - return "today" - elif diff.days < 0: - return "overdue" - else: - return "planned" + # @api.model + # def _compute_state_from_date(self, date_deadline, tz=False): + # """Compute the state""" + # date_deadline = fields.Date.from_string(date_deadline) + # today_default = date.today() + # today = today_default + # if tz: + # today_utc = pytz.utc.localize(datetime.utcnow()) + # today_tz = today_utc.astimezone(pytz.timezone(tz)) + # today = date(year=today_tz.year, month=today_tz.month, day=today_tz.day) + # diff = date_deadline - today + # for rec in self: + # if rec.state == "done": + # return "done" + # elif rec.type == "cancel": + # return "cancel" + # else: + # if diff.days == 0: + # return "today" + # elif diff.days < 0: + # return "overdue" + # else: + # return "planned" def action_cancel(self): """cancel activities"""