Skip to content

Commit e03ecbc

Browse files
[ADD] website_blog_scheduled_publication: add new module
1 parent 6ece7e1 commit e03ecbc

20 files changed

Lines changed: 2114 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../website_blog_scheduled_publication
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import setuptools
2+
3+
setuptools.setup(
4+
setup_requires=['setuptools-odoo'],
5+
odoo_addon=True,
6+
)
Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
==========================
2+
Blog Scheduled Publication
3+
==========================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:132329775a846e3e9b5c3c742d03461131d87458a9e8d56b104671807883642c
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fwebsite-lightgray.png?logo=github
20+
:target: https://github.com/OCA/website/tree/16.0/website_blog_scheduled_publication
21+
:alt: OCA/website
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/website-16-0/website-16-0-website_blog_scheduled_publication
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/website&target_branch=16.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
This module allows you to schedule blog posts for automatic publication at a specific date and time.
32+
33+
Features
34+
--------
35+
36+
* **Scheduled Publication Date**: Add a datetime field to schedule when posts should be published
37+
* **Quick Publish Button**: One-click immediate publication from the form view
38+
* **Schedule Wizard**: User-friendly wizard to set the publication date
39+
* **Visual Feedback**: Information banner displays scheduled date on the form
40+
* **Smart Publication Logic**: Automatically prevents immediate publication if a future date is set
41+
* **Automatic Cron Job**: Runs every hour to publish scheduled posts
42+
* **Notification System**: Sends notifications to blog followers when posts are published
43+
* **Search Filters**: Filter and group posts by publication or scheduled dates
44+
45+
Technical Details
46+
-----------------
47+
48+
* Extends ``blog.post`` model with scheduling fields and methods
49+
* Includes a transient model ``blog.post.schedule.date`` for the scheduling wizard
50+
* Inherits and enhances form and search views from ``website_blog``
51+
* The cron job uses ``_publish_scheduled_posts()`` method to process scheduled posts
52+
* Handles edge cases like setting past dates, clearing scheduled dates, and multiple record writes
53+
54+
**Table of contents**
55+
56+
.. contents::
57+
:local:
58+
59+
Configuration
60+
=============
61+
62+
To use this module, you need to:
63+
64+
#. Install the module from Apps menu
65+
#. Go to **Website > Content > Blog Posts**
66+
#. Create or edit a blog post
67+
#. In the "Publishing Options" section, you will find the "Scheduled Publication Date" field
68+
#. Set a future date and time when you want the post to be published
69+
#. Save the post
70+
71+
The post will be automatically published when the scheduled date and time arrives.
72+
73+
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**.
74+
75+
Usage
76+
=====
77+
78+
Scheduling a Blog Post
79+
======================
80+
81+
Using the Form View
82+
-------------------
83+
84+
1. Go to **Website > Content > Blog Posts**
85+
2. Open a blog post form
86+
3. You will see two buttons in the button box:
87+
88+
* **Publish**: Click to publish the post immediately
89+
* **Schedule**: Click to open the scheduling wizard
90+
91+
4. When clicking "Schedule", a dialog will appear asking for the publication date
92+
5. Select the desired date and time, then click "Schedule"
93+
6. The post will display an information banner showing the scheduled publication date
94+
95+
Using the Schedule Type Field
96+
-----------------------------
97+
98+
In the blog post form, you can also set the "Scheduled Publication Date" field directly:
99+
100+
* Set the date field to a future date and time
101+
* The post will automatically be scheduled for that time
102+
* The post will remain unpublished until the scheduled time
103+
104+
Viewing Scheduled Posts
105+
-----------------------
106+
107+
Use the search filters to find scheduled posts:
108+
109+
* **Published**: Filter to show only published posts
110+
* **Not Published**: Filter to show unpublished posts (including scheduled ones)
111+
112+
You can also group posts by:
113+
114+
* **Publication Date**: Group by the actual publication date
115+
* **Scheduled Publication Date**: Group by the scheduled publication date
116+
117+
Automatic Publication
118+
---------------------
119+
120+
A cron job runs every hour to publish posts that have reached their scheduled time:
121+
122+
* Posts are automatically published when the scheduled date/time arrives
123+
* Notifications are sent to blog followers when posts are published
124+
* The scheduled date is cleared after publication
125+
126+
Immediate Publication
127+
---------------------
128+
129+
If you need to publish a scheduled post immediately:
130+
131+
1. Open the blog post form
132+
2. Click the "Publish" button
133+
3. Confirm the action in the dialog
134+
4. The post will be published immediately and the scheduled date will be cleared
135+
136+
Bug Tracker
137+
===========
138+
139+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/website/issues>`_.
140+
In case of trouble, please check there if your issue has already been reported.
141+
If you spotted it first, help us to smash it by providing a detailed and welcomed
142+
`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**>`_.
143+
144+
Do not contact contributors directly about support or help with technical issues.
145+
146+
Credits
147+
=======
148+
149+
Authors
150+
~~~~~~~
151+
152+
* Escodoo
153+
154+
Contributors
155+
~~~~~~~~~~~~
156+
157+
* `Escodoo <https://www.escodoo.com.br>`_:
158+
159+
* Marcel Savegnago <marcel.savegnago@escodoo.com.br>
160+
161+
Maintainers
162+
~~~~~~~~~~~
163+
164+
This module is maintained by the OCA.
165+
166+
.. image:: https://odoo-community.org/logo.png
167+
:alt: Odoo Community Association
168+
:target: https://odoo-community.org
169+
170+
OCA, or the Odoo Community Association, is a nonprofit organization whose
171+
mission is to support the collaborative development of Odoo features and
172+
promote its widespread use.
173+
174+
.. |maintainer-marcelsavegnago| image:: https://github.com/marcelsavegnago.png?size=40px
175+
:target: https://github.com/marcelsavegnago
176+
:alt: marcelsavegnago
177+
178+
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
179+
180+
|maintainer-marcelsavegnago|
181+
182+
This module is part of the `OCA/website <https://github.com/OCA/website/tree/16.0/website_blog_scheduled_publication>`_ project on GitHub.
183+
184+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from . import models
2+
from . import wizard
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright 2026 - TODAY, Escodoo
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
{
5+
"name": "Blog Scheduled Publication",
6+
"summary": "Schedule blog posts publication date",
7+
"version": "16.0.1.0.0",
8+
"author": "Escodoo, Odoo Community Association (OCA)",
9+
"maintainers": ["marcelsavegnago"],
10+
"license": "AGPL-3",
11+
"category": "Website",
12+
"website": "https://github.com/OCA/website",
13+
"depends": [
14+
"website_blog",
15+
],
16+
"data": [
17+
"security/ir.model.access.csv",
18+
"data/ir_cron.xml",
19+
"views/blog_post_views.xml",
20+
"wizard/blog_post_schedule_date_views.xml",
21+
],
22+
"installable": True,
23+
"application": False,
24+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<odoo noupdate="1">
3+
<record id="ir_cron_publish_scheduled_blog_posts" model="ir.cron">
4+
<field name="name">Publish Scheduled Blog Posts</field>
5+
<field name="model_id" ref="website_blog.model_blog_post" />
6+
<field name="state">code</field>
7+
<field name="code">model._publish_scheduled_posts()</field>
8+
<field name="user_id" ref="base.user_root" />
9+
<field name="interval_number">1</field>
10+
<field name="interval_type">hours</field>
11+
<field name="numbercall">-1</field>
12+
<field name="active" eval="True" />
13+
<field name="doall" eval="False" />
14+
</record>
15+
</odoo>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import blog_post

0 commit comments

Comments
 (0)