Files
odoo_source/addons/mass_mailing/wizard/mailing_mailing_schedule_date.py
T
laa 2b6ebb3df7 [IMP] mass_mailing : improve interface, UI and usability
In order to improve and clarify the mass-mailing (Email Marketing) module
several changes have been made

1 - Clarify the name of the application:
2 - Prevent the “Quick Add/Create” feature in the mailing kanban view
3 - Label and wording clarification in mailing_mailing form view :
4 - Clarify button names "Send now" ("put_in_queue")
5 - Mailing Form view layout
6 - Clarify the required field
7 - Clarify the readonly field
8 - Wording clarification if scheduling mail in the future
9 - Add a Placeholders tools page in the form view:
10 - Clarify the Campaigns view
11 - Clarify the Action Helpers

TASK-ID : 2046078

closes odoo/odoo#36124

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-09-06 07:47:13 +00:00

23 lines
888 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError
class MailingMailingScheduleDate(models.TransientModel):
_name = 'mailing.mailing.schedule.date'
_description = 'Mass Mailing Scheduling'
schedule_date = fields.Datetime(string='Scheduled for')
mass_mailing_id = fields.Many2one('mailing.mailing', required=True, ondelete='cascade')
@api.constrains('schedule_date')
def _check_schedule_date(self):
for scheduler in self:
if scheduler.schedule_date < fields.Datetime.now():
raise ValidationError(_('Please select a date equal/or greater than the current date.'))
def set_schedule_date(self):
self.mass_mailing_id.write({'schedule_date': self.schedule_date, 'state': 'in_queue'})