[FIX] mass_mailing: fix mass mailing sent date computation
Currently when you click on send now button or schedule button it will enter current date as sent_date while the mailing list is still in queue. Actual sent date will be the date when the mail is sent. Related task ID : 46932
This commit is contained in:
committed by
Thibault Delavallée
parent
bbda48231c
commit
419b4659ca
@@ -646,7 +646,7 @@ class MassMailing(models.Model):
|
||||
|
||||
@api.multi
|
||||
def put_in_queue(self):
|
||||
self.write({'sent_date': fields.Datetime.now(), 'state': 'in_queue'})
|
||||
self.write({'state': 'in_queue'})
|
||||
|
||||
@api.multi
|
||||
def cancel_mass_mailing(self):
|
||||
@@ -791,7 +791,7 @@ class MassMailing(models.Model):
|
||||
# auto-commit except in testing mode
|
||||
auto_commit = not getattr(threading.currentThread(), 'testing', False)
|
||||
composer.send_mail(auto_commit=auto_commit)
|
||||
mailing.state = 'done'
|
||||
mailing.write({'state': 'done', 'sent_date': fields.Datetime.now()})
|
||||
return True
|
||||
|
||||
def convert_links(self):
|
||||
@@ -825,4 +825,4 @@ class MassMailing(models.Model):
|
||||
mass_mailing.state = 'sending'
|
||||
mass_mailing.send_mail()
|
||||
else:
|
||||
mass_mailing.state = 'done'
|
||||
mass_mailing.write({'state': 'done', 'sent_date': fields.Datetime.now()})
|
||||
|
||||
Reference in New Issue
Block a user