Monday, September 23, 2024
1 change · master
New functionality added to Odoo
Users can now choose to send or log chatter messages at a future date instead of posting them immediately. Scheduled messages appear in a new chatter section where they can be reviewed, edited by the author, or cancelled by users with record write access, improving planning and follow-up communication.
Original PR description
Purpose: -------- When the full composer is opened from a chatter, there is now the ability to schedule the message (or the note) instead of sending it directly. The Send/Log button now has a…
Purpose: -------- When the full composer is opened from a chatter, there is now the ability to schedule the message (or the note) instead of sending it directly. The Send/Log button now has a dropdown with a button "send later", which will open a dialog that allows to choose the date and time the message will be posted on. The chatter has a new section "Scheduled Messages" that lists the messages that are scheduled. These scheduled messages can be edited by their author and canceled by any user having write permission on the related record. This section is not shown if no message is scheduled on the record. When composing a message using a template that has a schedule date, the message will now be shown in this new section of the chatter, instead of posting the message and sending the notifications at the schedule date (this is only supported in mono-comment mode, as the schedule date might be dynamic in mass mail mode). When using a template with a schedule date and clicking "send later", the user-selected date will override the template's schedule date. Now when the full composer is closed (discarded, message sent/scheduled), the inline composer is hidden (to mimic the current behavior with the sending from the inline composer). Technical: ---------- A new model "mail.schedule.message" has been added (to distinguish from the "mail.message.schedule" model that delays the notification of posted messages). This model will hold the data needed to post the message at the schedule date. Some posting parameters that are not editable are stored inside a text field for the sake of simplicity (such as the mail_server_id which can be set on a template but can't be changed when editing a scheduled message). The messages are posted at their schedule date using a cron. They are sent using "with_user(create_uid)" as to make sure that the user that scheduled the message still has access to the record the message will be posted on. The model has a method "_check" that allows to make sure that the user has post access on the record the message is scheduled on. Task-3877073