Files
odoo_source/addons/mail/views/mail_message_schedule_views.xml
T
std-odooandThibault Delavallée 9b11a9d82b [IMP] mail: schedule emails and notifications
Purpose
=======

Currently, only email sending can be scheduled with the `scheduled_date` field
defined on on <mail.mail>. It's not possible to delay the sending of
notifications.

We want to be able to delay the sending of the emails, but also the inbox
and bus bus notifications.

Technical
=========

For that purpose, we created a new model which stores the message we need to
notify with the scheduled date. When a scheduled_datetime is given we skip the
notification process. Instead an entry in that new model is created. A cron
regularly polls the scheduled message and launch the notification process on
messages that are ready to be sent.

Task-2207626 (Rating: Delay rating notification to ease feedback)

Part-of: odoo/odoo#95623
Co-authored-by: Thibault Delavallée <tde@odoo.com>
2022-08-25 19:57:16 +02:00

53 lines
1.9 KiB
XML

<?xml version="1.0"?>
<odoo><data>
<record id="mail_message_schedule_view_form" model="ir.ui.view">
<field name="name">mail.message.schedule.view.form</field>
<field name="model">mail.message.schedule</field>
<field name="arch" type="xml">
<form string="Scheduled Message" duplicate="0">
<header>
<button name="force_send" string="Force Send" type="object"/>
</header>
<sheet>
<group>
<field name="mail_message_id"/>
<field name="scheduled_datetime"/>
</group>
<group>
<field name="notification_parameters"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="mail_message_schedule_view_tree" model="ir.ui.view">
<field name="name">mail.message.schedule.view.tree</field>
<field name="model">mail.message.schedule</field>
<field name="arch" type="xml">
<tree string="Emails">
<field name="mail_message_id"/>
<field name="scheduled_datetime"/>
</tree>
</field>
</record>
<record id="mail_message_schedule_view_search" model="ir.ui.view">
<field name="name">mail.message.schedule.view.search</field>
<field name="model">mail.message.schedule</field>
<field name="arch" type="xml">
<search string="Scheduled Messages">
<field name="mail_message_id"/>
</search>
</field>
</record>
<record id="mail_message_schedule_action" model="ir.actions.act_window">
<field name="name">Scheduled Messages</field>
<field name="res_model">mail.message.schedule</field>
<field name="view_mode">tree,form</field>
<field name="context">{}</field>
</record>
</data></odoo>