Blog Scheduled Publication

website_blog_scheduled_publication
REPOSITORY
REPOSITORYOCA/website
GIT
GIThttps://github.com/OCA/website.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/website/tree/18.0/website_blog_scheduled_publication
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYWebsite
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Escodoo
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Escodoo
COMMITTERS
COMMITTERSWeblate, OCA-git-bot, oca-ci, CristianoMafraJunior
WEBSITE
WEBSITEhttps://github.com/OCA/website
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:30:18
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - website_blog
    - website_mail
    - website
    - digest
    - mail
    - base
    - base_setup
    - web
    - bus
    - web_tour
    - html_editor
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - resource
    - social_media
    - google_recaptcha
    - utm
    - website_partner
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES geoip2
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
This module allows you to schedule blog posts for automatic publication
at a specific date and time.

## Features

- **Scheduled Publication Date**: Add a datetime field to schedule when
  posts should be published
- **Quick Publish Button**: One-click immediate publication from the
  form view
- **Schedule Wizard**: User-friendly wizard to set the publication date
- **Visual Feedback**: Information banner displays scheduled date on the
  form
- **Smart Publication Logic**: Automatically prevents immediate
  publication if a future date is set
- **Automatic Cron Job**: Runs every hour to publish scheduled posts
- **Notification System**: Sends notifications to blog followers when
  posts are published
- **Search Filters**: Filter and group posts by publication or scheduled
  dates

## Technical Details

- Extends `blog.post` model with scheduling fields and methods
- Includes a transient model `blog.post.schedule.date` for the
  scheduling wizard
- Inherits and enhances form and search views from `website_blog`
- The cron job uses `_publish_scheduled_posts()` method to process
  scheduled posts
- Handles edge cases like setting past dates, clearing scheduled dates,
  and multiple record writes

Code Analysis

Views touched (4)
XML IDNameModelTypeStatus
blog_post_schedule_date_view_form blog.post.schedule.date.view.form blog.post.schedule.date form New
view_blog_post_calendar_scheduled blog.post.calendar.scheduled blog.post calendar New
view_blog_post_form_scheduled blog.post.form.scheduled blog.post form Inherits website_blog.view_blog_post_form
view_blog_post_search_scheduled blog.post.search.scheduled blog.post filter Inherits website_blog.view_blog_post_search
Models touched (2)

New fields (2)
  • is_scheduled Boolean
    default=False help='If checked, the blog post will be scheduled for publication.' string='Schedule'
  • scheduled_publication_date Datetime
    help='If set, the blog post will be automatically published on this date and time. Leave empty to publish immediately.'
Public methods (4)
  • action_publish_now(self)
    Publish the blog post immediately.
  • action_schedule(self)
    Open schedule dialog to set publication date.
  • create(self, vals_list)
    @api.model_create_multi
    Override create to handle scheduled publication during creation.
  • write(self, vals)
    Override write to handle scheduled publication logic.

New fields (2)
  • blog_post_id Many2one → blog.post
    required=True args: 'blog.post'
  • schedule_date Datetime
    required=True string='Publish on'
Public methods (1)
  • action_schedule_date(self)
    Schedule the blog post for publication.