[FIX]: Mail Issue.

This commit is contained in:
Kunjal 2018-03-12 16:30:35 +05:30
parent 83b3dd675f
commit 2614448dd5

View File

@ -65,14 +65,16 @@ class MailMail(models.Model):
scheduled_date = fields.Char('Scheduled Send Date', scheduled_date = fields.Char('Scheduled Send Date',
help="If set, the queue manager will send the email after the date. If not set, the email will be send as soon as possible.") help="If set, the queue manager will send the email after the date. If not set, the email will be send as soon as possible.")
@api.multi
@api.depends('keep_days') @api.depends('keep_days')
def _compute_delete_on_date(self): def _compute_delete_on_date(self):
mail_date = fields.Datetime.from_string(self.date) for obj in self:
if self.keep_days > 0: mail_date = fields.Datetime.from_string(obj.date)
delete_on = mail_date + datetime.timedelta(days=self.keep_days) if obj.keep_days > 0:
self.delete_date = delete_on delete_on = mail_date + datetime.timedelta(days=obj.keep_days)
obj.delete_date = delete_on
else: else:
self.delete_date = mail_date.date() obj.delete_date = mail_date.date()
@api.model @api.model