diff --git a/social_media_calendar/README.rst b/social_media_calendar/README.rst new file mode 100644 index 0000000000..df06157ae4 --- /dev/null +++ b/social_media_calendar/README.rst @@ -0,0 +1,134 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +===================== +Social Media Calendar +===================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:9ef0613fac59ec66dcecfb14f4bff101e89925782f08418a3cf3b64bdf731cd0 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fsocial-lightgray.png?logo=github + :target: https://github.com/OCA/social/tree/19.0/social_media_calendar + :alt: OCA/social +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/social-19-0/social-19-0-social_media_calendar + :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/social&target_branch=19.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module provides the functionality to display posts in the calendar +view. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +Calendar view +------------- + +1. Go to Social Media > Posts +2. Click on the Calendar icon to open the calendar view +3. Click on a Post and a view with the post details will open. + +Colors by publication status +---------------------------- + +The calendar view will show the posts in different colors depending on +their publication status: + +- Draft + + |POST_DRAFT| + +- Planned + + |POST_PLANNED| + +- Publishing + + |POST_PUBLISHING| + +- Published + + |POST_PUBLISHED| + +- Cancelled + + |POST_CANCELLED| + +- Calendar view by color + + |POSTS_CALENDAR| + +.. |POST_DRAFT| image:: https://raw.githubusercontent.com/OCA/social/19.0/social_media_calendar/static/img/readme/POST_DRAFT.png +.. |POST_PLANNED| image:: https://raw.githubusercontent.com/OCA/social/19.0/social_media_calendar/static/img/readme/POST_PLANNED.png +.. |POST_PUBLISHING| image:: https://raw.githubusercontent.com/OCA/social/19.0/social_media_calendar/static/img/readme/POST_PUBLISHING.png +.. |POST_PUBLISHED| image:: https://raw.githubusercontent.com/OCA/social/19.0/social_media_calendar/static/img/readme/POST_PUBLISHED.png +.. |POST_CANCELLED| image:: https://raw.githubusercontent.com/OCA/social/19.0/social_media_calendar/static/img/readme/POST_CANCELLED.png +.. |POSTS_CALENDAR| image:: https://raw.githubusercontent.com/OCA/social/19.0/social_media_calendar/static/img/readme/POSTS_CALENDAR.png + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* BinhexTeam + +Contributors +------------ + +- [Binhex] (https://www.binhex.cloud): + + - Edilio Escalona Almira e.escalona@binhex.cloud + +- [Trobz] (https://trobz.com/): + + - Khanh (Dinh Van) dinhvankhanhfit@gmail.com + +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. + +This module is part of the `OCA/social `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/social_media_calendar/__init__.py b/social_media_calendar/__init__.py new file mode 100644 index 0000000000..0077c8866c --- /dev/null +++ b/social_media_calendar/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2025 Binhex +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import models diff --git a/social_media_calendar/__manifest__.py b/social_media_calendar/__manifest__.py new file mode 100644 index 0000000000..27457837d7 --- /dev/null +++ b/social_media_calendar/__manifest__.py @@ -0,0 +1,16 @@ +# Copyright 2025 Binhex +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Social Media Calendar", + "summary": """Module for social media calendar integration.""", + "version": "19.0.1.0.0", + "license": "AGPL-3", + "author": "BinhexTeam,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/social", + "depends": ["social_media_base", "calendar"], + "data": [ + "views/social_post_views.xml", + ], + "exclude": ["social"], + "auto_install": True, +} diff --git a/social_media_calendar/models/__init__.py b/social_media_calendar/models/__init__.py new file mode 100644 index 0000000000..bdd84592e3 --- /dev/null +++ b/social_media_calendar/models/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2025 Binhex +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import social_post diff --git a/social_media_calendar/models/social_post.py b/social_media_calendar/models/social_post.py new file mode 100644 index 0000000000..a877cc7916 --- /dev/null +++ b/social_media_calendar/models/social_post.py @@ -0,0 +1,32 @@ +# Copyright 2025 Binhex +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class SocialPost(models.Model): + _inherit = "social.post" + + date_calendar = fields.Date(compute="_compute_date_calendar", store=True) + color = fields.Integer(compute="_compute_color") + + @api.depends("state") + def _compute_color(self): + for post in self: + if post.state == "planned": + post.color = 2 + elif post.state == "publishing": + post.color = 6 + elif post.state == "published": + post.color = 10 + elif post.state == "cancelled": + post.color = 0 + else: + post.color = 4 + + @api.depends("create_date", "send_post_date", "published_date") + def _compute_date_calendar(self): + for post in self: + post.date_calendar = ( + post.published_date or post.send_post_date or post.create_date + ) diff --git a/social_media_calendar/pyproject.toml b/social_media_calendar/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/social_media_calendar/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/social_media_calendar/readme/CONTRIBUTORS.md b/social_media_calendar/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..91b55a1ef2 --- /dev/null +++ b/social_media_calendar/readme/CONTRIBUTORS.md @@ -0,0 +1,5 @@ +- [Binhex] (https://www.binhex.cloud): + - Edilio Escalona Almira + +- [Trobz] (https://trobz.com/): + - Khanh (Dinh Van) dinhvankhanhfit@gmail.com \ No newline at end of file diff --git a/social_media_calendar/readme/DESCRIPTION.md b/social_media_calendar/readme/DESCRIPTION.md new file mode 100644 index 0000000000..fcf6dcf970 --- /dev/null +++ b/social_media_calendar/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module provides the functionality to display posts in the calendar view. diff --git a/social_media_calendar/readme/USAGE.md b/social_media_calendar/readme/USAGE.md new file mode 100644 index 0000000000..7307070db8 --- /dev/null +++ b/social_media_calendar/readme/USAGE.md @@ -0,0 +1,31 @@ +Calendar view +------------------- + +1. Go to Social Media > Posts +2. Click on the Calendar icon to open the calendar view +3. Click on a Post and a view with the post details will open. + +Colors by publication status +--------------------------- + +The calendar view will show the posts in different colors depending on their publication status: + +- Draft + + ![POST_DRAFT](../static/img/readme/POST_DRAFT.png) +- Planned + + ![POST_PLANNED](../static/img/readme/POST_PLANNED.png) +- Publishing + + ![POST_PUBLISHING](../static/img/readme/POST_PUBLISHING.png) +- Published + + ![POST_PUBLISHED](../static/img/readme/POST_PUBLISHED.png) +- Cancelled + + ![POST_CANCELLED](../static/img/readme/POST_CANCELLED.png) + +- Calendar view by color + + ![POSTS_CALENDAR](../static/img/readme/POSTS_CALENDAR.png) diff --git a/social_media_calendar/static/description/index.html b/social_media_calendar/static/description/index.html new file mode 100644 index 0000000000..d3f9e93ad7 --- /dev/null +++ b/social_media_calendar/static/description/index.html @@ -0,0 +1,478 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Social Media Calendar

+ +

Beta License: AGPL-3 OCA/social Translate me on Weblate Try me on Runboat

+

This module provides the functionality to display posts in the calendar +view.

+

Table of contents

+ +
+

Usage

+
+

Calendar view

+
    +
  1. Go to Social Media > Posts
  2. +
  3. Click on the Calendar icon to open the calendar view
  4. +
  5. Click on a Post and a view with the post details will open.
  6. +
+
+
+

Colors by publication status

+

The calendar view will show the posts in different colors depending on +their publication status:

+
    +
  • Draft

    +

    POST_DRAFT

    +
  • +
  • Planned

    +

    POST_PLANNED

    +
  • +
  • Publishing

    +

    POST_PUBLISHING

    +
  • +
  • Published

    +

    POST_PUBLISHED

    +
  • +
  • Cancelled

    +

    POST_CANCELLED

    +
  • +
  • Calendar view by color

    +

    POSTS_CALENDAR

    +
  • +
+
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • BinhexTeam
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

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.

+

This module is part of the OCA/social project on GitHub.

+

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

+
+
+
+
+ + diff --git a/social_media_calendar/static/img/readme/POSTS_CALENDAR.png b/social_media_calendar/static/img/readme/POSTS_CALENDAR.png new file mode 100644 index 0000000000..8825a8a862 Binary files /dev/null and b/social_media_calendar/static/img/readme/POSTS_CALENDAR.png differ diff --git a/social_media_calendar/static/img/readme/POST_CANCELLED.png b/social_media_calendar/static/img/readme/POST_CANCELLED.png new file mode 100644 index 0000000000..dc2b53fcf2 Binary files /dev/null and b/social_media_calendar/static/img/readme/POST_CANCELLED.png differ diff --git a/social_media_calendar/static/img/readme/POST_DRAFT.png b/social_media_calendar/static/img/readme/POST_DRAFT.png new file mode 100644 index 0000000000..cb6894e73c Binary files /dev/null and b/social_media_calendar/static/img/readme/POST_DRAFT.png differ diff --git a/social_media_calendar/static/img/readme/POST_PLANNED.png b/social_media_calendar/static/img/readme/POST_PLANNED.png new file mode 100644 index 0000000000..574631b06d Binary files /dev/null and b/social_media_calendar/static/img/readme/POST_PLANNED.png differ diff --git a/social_media_calendar/static/img/readme/POST_PUBLISHED.png b/social_media_calendar/static/img/readme/POST_PUBLISHED.png new file mode 100644 index 0000000000..5fbaa66e7e Binary files /dev/null and b/social_media_calendar/static/img/readme/POST_PUBLISHED.png differ diff --git a/social_media_calendar/static/img/readme/POST_PUBLISHING.png b/social_media_calendar/static/img/readme/POST_PUBLISHING.png new file mode 100644 index 0000000000..f47fb619d0 Binary files /dev/null and b/social_media_calendar/static/img/readme/POST_PUBLISHING.png differ diff --git a/social_media_calendar/views/social_post_views.xml b/social_media_calendar/views/social_post_views.xml new file mode 100644 index 0000000000..c79e47a5c7 --- /dev/null +++ b/social_media_calendar/views/social_post_views.xml @@ -0,0 +1,45 @@ + + + + + kanban,calendar,list,form + + + + social.post.calendar.view + social.post + + + + + + + + + + + + diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000000..bbe57d65b0 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1 @@ +odoo-addon-social_media_base @ git+https://github.com/OCA/social.git@refs/pull/1788/head#subdirectory=social_media_base