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
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# generated from manifests external_dependencies
linkedin-api-client
requests_toolbelt
tweepy
109 changes: 109 additions & 0 deletions social_media_base/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
=================
Social Media Base
=================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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/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%2Fsocial-lightgray.png?logo=github
:target: https://github.com/OCA/social/tree/17.0/social_media_base
:alt: OCA/social
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/social-17-0/social-17-0-social_media_base
: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=17.0
:alt: Try me on Runboat

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

This module provides the fundamental foundation for social media
management. It facilitates the integration of user accounts, posts,
reactions (likes), comments, and graph-based analysis. Designed to be
flexible and scalable, it allows developers and businesses to integrate
and customize social features according to their needs.

Main features:

- Integration of multiple user accounts.
- Basic methods that can be extended and adapted to suit the social
network.
- Basic business structure.

**Table of contents**

.. contents::
:local:

Usage
=====

Generate group campaign.
------------------------

- Go to *Social Media* > Campaign group > New
- Fill in the required fields |CREATE_GROUP_CAMPAIGN|
- Save

Generate campaign.
------------------

- Go to *Social Media* > Campaign > New
- Fill in the required fields |CREATE_CAMPAIGN|
- Save

.. |CREATE_GROUP_CAMPAIGN| image:: https://raw.githubusercontent.com/OCA/social/17.0/social_media_base/static/img/readme/CREATE_GROUP_CAMPAIGN.png
.. |CREATE_CAMPAIGN| image:: https://raw.githubusercontent.com/OCA/social/17.0/social_media_base/static/img/readme/CREATE_CAMPAIGN.png

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/social/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/social/issues/new?body=module:%20social_media_base%0Aversion:%2017.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
-------

* BinhexTeam

Contributors
------------

- [Binhex Cloud] (https://www.binhex.cloud):

- Edilio Escalona Almira [email protected]

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 <https://github.com/OCA/social/tree/17.0/social_media_base>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
6 changes: 6 additions & 0 deletions social_media_base/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright 2025 Binhex <https://www.binhex.cloud>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import controllers
from . import models
from . import wizards
48 changes: 48 additions & 0 deletions social_media_base/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright 2025 Binhex <https://www.binhex.cloud>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Social Media Base",
"summary": """Basic module for social media management.""",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"author": "BinhexTeam,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/social",
"depends": ["base", "web", "mail", "utm"],
"data": [
"security/ir.model.access.csv",
"security/social_account_security.xml",
"security/social_post_security.xml",
"security/social_post_account_security.xml",
"data/ir_cron_data.xml",
"views/social_media_views.xml",
"views/social_account_views.xml",
"views/social_post_views.xml",
"views/social_post_account_views.xml",
"views/utm_group_campaign_views.xml",
"views/utm_campaign_views.xml",
"views/social_action_client_views.xml",
"wizards/wizard_social_account.xml",
"views/social_media_base_menus.xml",
],
"assets": {
"web.assets_backend": [
("include", "web.chartjs_lib"),
# GENERAL
"social_media_base/static/src/xml/**/*.xml",
"social_media_base/static/src/scss/**/*.scss",
# MIXINS
"social_media_base/static/src/js/app/**/*.js",
# SERVICES
"social_media_base/static/src/js/services/**/*.js",
# COMPONENTS
"social_media_base/static/src/components/**/*.xml",
"social_media_base/static/src/components/**/*.js",
"social_media_base/static/src/components/**/*.scss",
# VIEWS
"social_media_base/static/src/js/views/**/*.xml",
"social_media_base/static/src/js/views/**/*.scss",
"social_media_base/static/src/js/views/**/*.js",
],
},
"exclude": ["social"],
}
4 changes: 4 additions & 0 deletions social_media_base/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2025 Binhex <https://www.binhex.cloud>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import thread
41 changes: 41 additions & 0 deletions social_media_base/controllers/thread.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright 2025 Binhex <https://www.binhex.cloud>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo.http import request, route

from odoo.addons.mail.controllers.thread import ThreadController
from odoo.addons.mail.models.discuss.mail_guest import add_guest_to_context


class ThreadControllerSocial(ThreadController):
def _prepare_result(self):
return {
"author": {
"id": request.env.user.partner_id.id,
"name": request.env.user.partner_id.name,
"is_company": request.env.user.partner_id.is_company,
"user": {
"id": request.env.uid,
"isInternalUser": request.env.user._is_internal(),
},
"type": "partner",
}
}

@route("/mail/message/post", methods=["POST"], type="json", auth="public")
@add_guest_to_context
def mail_message_post(self, thread_model, thread_id, post_data, context=None):
if thread_model == "social.post.account" and thread_id:
post_id = request.env[thread_model].browse(thread_id)
if post_id:
comment = post_id.create_comment(post_data, context)
request.env["bus.bus"]._sendone(
request.env.user.partner_id, "comments", comment
)
return self._prepare_result()
else:
return None
else:
return super().mail_message_post(
thread_model, thread_id, post_data, context
)
24 changes: 24 additions & 0 deletions social_media_base/data/ir_cron_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="send_post_schedule_job" model="ir.cron">
<field name="name">Social Post: Send post schedule</field>
<field name="model_id" ref="model_social_post" />
<field name="state">code</field>
<field name="code">model._run_send_post()</field>
<field name='interval_number'>5</field>
<field name='interval_type'>minutes</field>
<field name="numbercall">-1</field>
<field name="priority">1</field>
</record>

<record id="webhook_schedule_job" model="ir.cron">
<field name="name">Social: Checking social media updates</field>
<field name="model_id" ref="model_social_account" />
<field name="state">code</field>
<field name="code">model._run_check_media_updates()</field>
<field name='interval_number'>30</field>
<field name='interval_type'>minutes</field>
<field name="numbercall">-1</field>
<field name="priority">1</field>
</record>
</odoo>
Loading