Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions setup/website_blog_scheduled_publication/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
184 changes: 184 additions & 0 deletions website_blog_scheduled_publication/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
==========================
Blog Scheduled Publication
==========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:132329775a846e3e9b5c3c742d03461131d87458a9e8d56b104671807883642c
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fwebsite-lightgray.png?logo=github
:target: https://github.com/OCA/website/tree/16.0/website_blog_scheduled_publication
:alt: OCA/website
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/website-16-0/website-16-0-website_blog_scheduled_publication
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/website&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

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

**Table of contents**

.. contents::
:local:

Configuration
=============

To use this module, you need to:

#. Install the module from Apps menu
#. Go to **Website > Content > Blog Posts**
#. Create or edit a blog post
#. In the "Publishing Options" section, you will find the "Scheduled Publication Date" field
#. Set a future date and time when you want the post to be published
#. Save the post

The post will be automatically published when the scheduled date and time arrives.

Note: The cron job that publishes scheduled posts runs every hour. If you need more frequent checks, you can adjust the cron job interval in **Settings > Technical > Automation > Scheduled Actions**.

Usage
=====

Scheduling a Blog Post
======================

Using the Form View
-------------------

1. Go to **Website > Content > Blog Posts**
2. Open a blog post form
3. You will see two buttons in the button box:

* **Publish**: Click to publish the post immediately
* **Schedule**: Click to open the scheduling wizard

4. When clicking "Schedule", a dialog will appear asking for the publication date
5. Select the desired date and time, then click "Schedule"
6. The post will display an information banner showing the scheduled publication date

Using the Schedule Type Field
-----------------------------

In the blog post form, you can also set the "Scheduled Publication Date" field directly:

* Set the date field to a future date and time
* The post will automatically be scheduled for that time
* The post will remain unpublished until the scheduled time

Viewing Scheduled Posts
-----------------------

Use the search filters to find scheduled posts:

* **Published**: Filter to show only published posts
* **Not Published**: Filter to show unpublished posts (including scheduled ones)

You can also group posts by:

* **Publication Date**: Group by the actual publication date
* **Scheduled Publication Date**: Group by the scheduled publication date

Automatic Publication
---------------------

A cron job runs every hour to publish posts that have reached their scheduled time:

* Posts are automatically published when the scheduled date/time arrives
* Notifications are sent to blog followers when posts are published
* The scheduled date is cleared after publication

Immediate Publication
---------------------

If you need to publish a scheduled post immediately:

1. Open the blog post form
2. Click the "Publish" button
3. Confirm the action in the dialog
4. The post will be published immediately and the scheduled date will be cleared

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/website/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/website/issues/new?body=module:%20website_blog_scheduled_publication%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Escodoo

Contributors
~~~~~~~~~~~~

* `Escodoo <https://www.escodoo.com.br>`_:

* Marcel Savegnago <marcel.savegnago@escodoo.com.br>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-marcelsavegnago| image:: https://github.com/marcelsavegnago.png?size=40px
:target: https://github.com/marcelsavegnago
:alt: marcelsavegnago

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-marcelsavegnago|

This module is part of the `OCA/website <https://github.com/OCA/website/tree/16.0/website_blog_scheduled_publication>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions website_blog_scheduled_publication/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import wizard
24 changes: 24 additions & 0 deletions website_blog_scheduled_publication/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2026 - TODAY, Escodoo
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Blog Scheduled Publication",
"summary": "Schedule blog posts publication date",
"version": "16.0.1.0.0",
"author": "Escodoo, Odoo Community Association (OCA)",
"maintainers": ["marcelsavegnago"],
"license": "AGPL-3",
"category": "Website",
"website": "https://github.com/OCA/website",
"depends": [
"website_blog",
],
"data": [
"security/ir.model.access.csv",
"data/ir_cron.xml",
"views/blog_post_views.xml",
"wizard/blog_post_schedule_date_views.xml",
],
"installable": True,
"application": False,
}
15 changes: 15 additions & 0 deletions website_blog_scheduled_publication/data/ir_cron.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="ir_cron_publish_scheduled_blog_posts" model="ir.cron">
<field name="name">Publish Scheduled Blog Posts</field>
<field name="model_id" ref="website_blog.model_blog_post" />
<field name="state">code</field>
<field name="code">model._publish_scheduled_posts()</field>
<field name="user_id" ref="base.user_root" />
<field name="interval_number">1</field>
<field name="interval_type">hours</field>
<field name="numbercall">-1</field>
<field name="active" eval="True" />
<field name="doall" eval="False" />
</record>
</odoo>
1 change: 1 addition & 0 deletions website_blog_scheduled_publication/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import blog_post
Loading