Skip to content

Conversation

@edescalona
Copy link

@edescalona edescalona commented Mar 21, 2025

@BinhexTeam

This PR allows you to manage your LinkedIn and X social networks, including posts, likes, comments, campaigns, and campaign groups.

Modules:

  • social_media_base: Common configurations and structures. Charts and reports.

  • social_media_linkedin: Management of posts, likes, comments, campaign groups, campaigns, and ads.

  • social_media_x: Management of posts, likes, and comments.

  • social_media_calendar: Add calendar view to posts

@edescalona edescalona force-pushed the 17.0-add-connector_social branch 3 times, most recently from 1b61209 to e77c65d Compare March 21, 2025 18:01
@edescalona edescalona force-pushed the 17.0-add-connector_social branch 2 times, most recently from 4120ccd to a219e0b Compare April 3, 2025 18:14
@edescalona edescalona marked this pull request as ready for review April 7, 2025 04:46
@edescalona
Copy link
Author

The tests are experiencing issues due to the mail_print module, so they are not displaying correctly.

The PR could be reviewed while the previous issue is resolved.

@christian-ramos-tecnativa

Modules will be renamed to social_oca_*

@edescalona
Copy link
Author

Modules will be renamed to social_oca_*

Hello @Christian-RB , ok I'll change it.

@pedrobaeza
Copy link
Member

I still prefer social_media_*

@christian-ramos-tecnativa

I thought that adding the _oca term was mandatory when there is a similar module in the enterprise version, like in sign_oca, voip_oca, etc...

@jelenapoblet
Copy link

Les change it to social_media_*

@pedrobaeza
Copy link
Member

Let me clarify why I prefer social_media:

@pedrobaeza
Copy link
Member

I thought that adding the _oca term was mandatory when there is a similar module in the enterprise version, like in sign_oca, voip_oca, etc...

Not really mandatory. This is when no better name is found, and we can't (or shouldn't) reuse the same name.

But we have plenty of examples where if there's better name, we use it, like contract against subscription, dms against documents, quality_control over quality, tier_validation against approvals, resource_booking against appointments...

@christian-ramos-tecnativa

Loved the dictionary entries, thanks for the explanation @pedrobaeza, if that's not mandatary I'm totally ok with using social_media_, sorry to bother you @edescalona.

@edescalona
Copy link
Author

It's no bother @Christian-RB, any clarification is welcome, thanks everyone.

Copy link
Member

@etobella etobella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some basic comments I saw on the first review

@edescalona
Copy link
Author

Some basic comments I saw on the first review

Hi @etobella , thanks for your comments. Ready for review.

Copy link

@kobros-tech kobros-tech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pedrobaeza

I guess we need to remove the pandoc file from the commit:

pandoc-3.6.4-1-amd64.deb

@edescalona edescalona force-pushed the 17.0-add-connector_social branch from 8bc311f to f2a00da Compare May 6, 2025 19:08
@kobros-tech
Copy link

nice, I could contribute to add facebook if you are not planning for?

@jelenapoblet
Copy link

That sounds great!

@kobros-tech
Copy link

Screenshot from 2025-05-06 22-49-30

I got this error when tried to ascoiate linkedin account

@edescalona
Copy link
Author

Hi @kobros-tech , do you have your host listed in your LinkedIn account's allowed URLs? Otherwise, it won't redirect you.

@edescalona
Copy link
Author

edescalona commented May 6, 2025

Example @kobros-tech

image

For example, you could simply change

http://localhost:17069 to your host.

@kobros-tech
Copy link

kobros-tech commented May 6, 2025

all right first we would update the readme as follows:
before all other configurations we do:

Go to Settings → Technical → System Parameters.

Search for web.base.url

Edit the value to: https://

This one because the default record is http:odoo which is not making sense!


then the the scopes are causing error, can be because I didn't set all features from linkedin and we have to handle this.

"GET /linkedin/callback?error=unauthorized_scope_error&error_description=Scope+%26quot;r_ads%26quot;+is+not+authorized+for+your+application&state=d12540d2350aafa1c7edb537d35296c3f953b974071821cce18614f58ea5a73e HTTP/1.0"

@kobros-tech
Copy link

here is my copy of the PR branch with fixes:

https://github.com/OCA/social/pull/1622/files

I will be using from now so far until the project gets merged.

@edescalona
Copy link
Author

Hi @kobros-tech , I made some changes to the readme to make the configuration more understandable. Please give me your feedback. Thanks.

@ayushin
Copy link

ayushin commented Sep 21, 2025

i'd love to try this but my project at 18.0 branch

@ayushin
Copy link

ayushin commented Sep 21, 2025

@BinhexTeam @Christian-RB

don't you guys think the models could / should be more DRY?

most social accounts are linked via OAuth2 so you don't need to add a bunch of fields for each social account onto the model.

why not go for social credential / social provider model similar to this?

class SocialCredential(models.Model):
    _name = 'social.credential'
    _description = 'Social Media Credential'
    _inherit = ['mail.thread']
    _rec_name = 'display_name'
    
    display_name = fields.Char('Display Name', compute='_compute_display_name', store=True)
    provider_id = fields.Many2one('social.provider', required=True, ondelete='cascade')
    
    # OAuth tokens
    access_token = fields.Text('Access Token', groups='base.group_system')
    refresh_token = fields.Text('Refresh Token', groups='base.group_system')
    token_expiry = fields.Datetime('Token Expiry')
    token_type = fields.Char('Token Type', default='Bearer')
    
    # API Keys (for non-OAuth providers)
    api_key = fields.Char('API Key', groups='base.group_system')
    api_secret = fields.Char('API Secret', groups='base.group_system')
    
    # Additional credentials
    additional_data = fields.Json('Additional Data', groups='base.group_system')
    
    # Status
    active = fields.Boolean(default=True)
    is_valid = fields.Boolean('Is Valid', compute='_compute_is_valid', store=True)
    last_validated = fields.Datetime('Last Validated')
    validation_error = fields.Text('Validation Error')
    
    # Related accounts
    account_ids = fields.One2many('social.account', 'credential_id', string='Accounts')
    account_count = fields.Integer(compute='_compute_account_count', store=True)
    
    # Company
    company_id = fields.Many2one('res.company', default=lambda self: self.env.company, required=True)
    ```
    and 
    ```
    class SocialProvider(models.Model):
    _name = 'social.provider'
    _description = 'Social Media Provider'
    _order = 'sequence, name'
    
    name = fields.Char('Provider Name', required=True)
    provider_type = fields.Selection(
        selection='_get_provider_types',
        string='Type', 
        required=True
    )
    
    sequence = fields.Integer(default=10)
    active = fields.Boolean(default=True)
    
    # OAuth Configuration
    client_id = fields.Char('Client ID', help='OAuth Client ID')
    client_secret = fields.Char('Client Secret', help='OAuth Client Secret')
    api_key = fields.Char('API Key', help='API Key for public data access')
    
    # Endpoints
    auth_endpoint = fields.Char('Authorization Endpoint')
    token_endpoint = fields.Char('Token Endpoint')
    api_base_url = fields.Char('API Base URL')
    scopes = fields.Text('OAuth Scopes', help='Space-separated OAuth scopes')
    
    # Configuration
    redirect_uri = fields.Char('Redirect URI', compute='_compute_redirect_uri')
    config_data = fields.Json('Additional Configuration')
    
    # Related
    account_ids = fields.One2many('social.account', 'provider_id', string='Accounts')
    account_count = fields.Integer(compute='_compute_account_count', store=True)
    
    # Company
    company_id = fields.Many2one('res.company', string='Company', 
                                 default=lambda self: self.env.company)
    ```
    class SocialProvider(models.Model):
    _name = 'social.provider'
    _description = 'Social Media Provider'
    _order = 'sequence, name'
    
    name = fields.Char('Provider Name', required=True)
    provider_type = fields.Selection(
        selection='_get_provider_types',
        string='Type', 
        required=True
    )
    
    sequence = fields.Integer(default=10)
    active = fields.Boolean(default=True)
    
    # OAuth Configuration
    client_id = fields.Char('Client ID', help='OAuth Client ID')
    client_secret = fields.Char('Client Secret', help='OAuth Client Secret')
    api_key = fields.Char('API Key', help='API Key for public data access')
    
    # Endpoints
    auth_endpoint = fields.Char('Authorization Endpoint')
    token_endpoint = fields.Char('Token Endpoint')
    api_base_url = fields.Char('API Base URL')
    scopes = fields.Text('OAuth Scopes', help='Space-separated OAuth scopes')
    
    # Configuration
    redirect_uri = fields.Char('Redirect URI', compute='_compute_redirect_uri')
    config_data = fields.Json('Additional Configuration')
    
    # Related
    account_ids = fields.One2many('social.account', 'provider_id', string='Accounts')
    account_count = fields.Integer(compute='_compute_account_count', store=True)
    
    # Company
    company_id = fields.Many2one('res.company', string='Company', 
                                 default=lambda self: self.env.company)
    
    ```
    
    This way you can manage multiple accounts per provider (facebook App / Twitter App)

@ayushin
Copy link

ayushin commented Sep 21, 2025

maybe even an OCA module for oauth_account similar like Google Calendar does it

@edescalona edescalona force-pushed the 17.0-add-connector_social branch 3 times, most recently from 2dec543 to 1dc7260 Compare October 2, 2025 03:25
@pedrobaeza
Copy link
Member

You have introduce a merge commit inside the PR. Please remove it doing a proper rebase with the possible conflict solution.

@edescalona edescalona force-pushed the 17.0-add-connector_social branch from 65d6cc3 to 649bb37 Compare January 13, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.