← Back to Pull requests

[17.0][ADD] social_media_base #1889

Closed
unknown closed this pull request without merging on Sep 11, 2026 17:29 UTC
View on GitHub
unknown unknown commented on Jul 28, 2026 18:52 UTC
Author

@BinhexTeam

T25184

This PR adds Social Media Base, the media-agnostic foundation for managing social media accounts and posts from Odoo.

It brings the models, the security, the scheduled actions and the common interface, but it does not connect to any network by itself: a connector module (Social Media Linkedin, Social Media X, ...) registers the media, implements the OAuth authorization and publishes for real.

What it adds

  • Accounts (social.account) with their OAuth credentials, visible only to administrators, and a responsible user that scopes what each user sees.

  • Posts (social.post) with the state flow draft → planned → publishing → published / cancelled / failed, fanning out into one publication (social.post.account) per selected account.

  • Daily statistics (social.account.statistics), one row per account and day, drawn with the native graph and pivot views. A cron rewrites the last days every two hours, because networks revise figures already past.

  • Per-network validation while the post is written: each connector declares its limits once (message length, number of images and videos, formats, sizes) and the form shows what a network will publish differently and what it will not publish at all. Saving is never blocked; the publication is where an objection stops something, reading the very same rules.

  • Campaign integration: a Campaigns menu inside the application, a UTM medium per network and a UTM source per publication, and the links of a published message routed through the Odoo link tracker, so a click from the network is counted in Odoo and attributed to the campaign and to the publication.

  • Security: group_social_media_user (own accounts) and group_social_media_manager (all accounts).
  • Design notes

  • The cost line is deliberate: this module only ever spends a fixed number of calls per account, however much that account has published. Anything whose cost grows with the history of the account — importing the publications, their comments and reactions — belongs to Social Media Sync.

  • Publishing is an irreversible external effect, so each publication runs inside its own savepoint: a failure on one account never rolls back the remote reference another one already obtained.

  • excludes: ["social"]: these modules cannot coexist with Odoo's Social Marketing.
  • Tests

    Full test suite included, with no network calls — every HTTP call is patched.

    Diff: 310 lines (+232 / -78) across 3 files Reviewer: ivs-cetmix Review duration: 64717m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 310 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.343
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #1889"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 40.3% (MEDIUM) · Higher = larger blast radius
    40.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.9% · Safe to merge
    15.9%
    Repository