Metadata-Version: 2.1
Name: odoo-addon-website_blog_scheduled_publication
Version: 18.0.1.0.0.2
Requires-Python: >=3.10
Requires-Dist: odoo==18.0.*
Summary: Schedule blog posts publication date
Home-page: https://github.com/OCA/website
License: AGPL-3
Author: Escodoo, Odoo Community Association (OCA)
Author-email: support@odoo-community.org
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 18.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Description-Content-Type: text/x-rst

.. image:: https://odoo-community.org/readme-banner-image
   :target: https://odoo-community.org/get-involved?utm_source=readme
   :alt: Odoo Community Association

==========================
Blog Scheduled Publication
==========================

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

.. |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/license-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/18.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-18-0/website-18-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=18.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:

1. Install the module from Apps menu
2. Go to **Website > Content > Blog Posts**
3. Create or edit a blog post
4. In the "Publishing Options" section, you will find the "Scheduled
   Publication Date" field
5. Set a future date and time when you want the post to be published
6. 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
=====

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:%2018.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>
  - Cristiano Mafra Junior <cristiano.mafra@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
.. |maintainer-CristianoMafraJunior| image:: https://github.com/CristianoMafraJunior.png?size=40px
    :target: https://github.com/CristianoMafraJunior
    :alt: CristianoMafraJunior

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

|maintainer-marcelsavegnago| |maintainer-CristianoMafraJunior| 

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
