Skip to content

webisoftSoftware/odoo-slack-app

Repository files navigation

Slack Integration App

Odoo app for integrating Slack with CRM opportunities and Projects. Automatically create private Slack channels from opportunities and projects, and invite team members.

Features

CRM Opportunities

  • Create Slack Channels: Automatically create private Slack channels from CRM opportunities
  • Channel Management: View and edit Slack channel IDs directly in the opportunity form
  • Send Opportunity Details: Send opportunity information to Slack channels with rich formatting
  • Automatic Log Notes: Automatically send log notes to Slack channels when enabled

Projects

  • Create Slack Channels: Automatically create private Slack channels from projects
  • Channel Management: View and edit Slack channel IDs directly in the project form
  • Send Project Details: Send project information to Slack channels with rich formatting
  • Automatic Log Notes: Automatically send log notes to Slack channels when enabled

Common Features

  • User Management: Add Slack Member IDs to users for automatic channel invitations
  • Automatic Invitations: Automatically invite all users with Slack Member IDs to new channels
  • Rate Limiting: Built-in handling of Slack API rate limits with automatic retries
  • Error Handling: Comprehensive error handling with user-friendly messages
  • Bot Validation: Real-time validation ensures channel IDs are only saved when bot is a member

Installation

Installing as an App (Recommended)

  1. Copy this app to your Odoo addons directory
  2. Restart your Odoo server
  3. Go to Apps menu in Odoo
  4. Remove the "Apps" filter to show all apps
  5. Search for "Slack Integration"
  6. Click Install

Installing as a Module (Alternative)

  1. Copy this module to your Odoo addons directory
  2. Update the apps list: AppsUpdate Apps List
  3. Install via command line: odoo-bin -i slack_integration -d your_database
  4. Or install via Odoo interface: Apps → Search "Slack Integration" → Install

Note: This app appears in the Apps menu and can be installed/uninstalled like any other Odoo app.

Configuration

1. Create a Slack App

  1. Go to Slack API Apps
  2. Click "Create New App" → "From scratch"
  3. Name your app and select your workspace

2. Configure OAuth Scopes

  1. In your app, go to OAuth & Permissions
  2. Under Bot Token Scopes, add:
    • channels:write - Create channels and invite users
    • channels:manage - Manage channels
    • users:read - Read user information
  3. Save Changes
  4. Install App to Workspace (or reinstall if already installed)

See SLACK_API_PERMISSIONS.md for detailed information.

3. Get Bot Token

  1. After installing the app, copy the Bot User OAuth Token (starts with xoxb-)
  2. In Odoo, go to SettingsSlack Integration
  3. Paste the token in the Slack API Key field
  4. Save

4. Add Slack Member IDs to Users

  1. Go to SettingsUsers & CompaniesUsers
  2. Open a user
  3. Go to the Slack tab
  4. Enter the user's Slack Member ID (starts with U, e.g., U1234567890)
  5. Save

To find a user's Slack Member ID:

  • In Slack, right-click on a user → View profile → The ID is in the URL or profile details
  • Or use the Slack API users.list method

Usage

CRM Opportunities

Creating a Slack Channel from an Opportunity

  1. Open an Opportunity (not a Lead)
  2. Go to the Slack tab
  3. Click Create Slack Channel
  4. The channel will be created with the name: <opportunity_name>-sales-internal
  5. All users with Slack Member IDs will be automatically invited

Sending Opportunity Details to Slack

  1. Open an opportunity with a Slack channel configured
  2. Go to the Slack tab
  3. Click Send Opportunity to Slack
  4. The opportunity details (name, stage, revenue, probability, company, salesperson, dates) will be sent to the Slack channel

Inviting Users to an Existing Channel

  1. Open an opportunity with an existing Slack channel
  2. Go to the Slack tab
  3. Click Invite Users to Slack Channel
  4. All users with Slack Member IDs will be invited

Automatic Log Notes

  1. Open an opportunity
  2. Go to the Slack tab
  3. Enable Send Log Notes to Slack
  4. All log notes posted to the opportunity will automatically be sent to the associated Slack channel

Projects

Creating a Slack Channel from a Project

  1. Open a Project
  2. Go to the Slack tab
  3. Click Create Slack Channel
  4. The channel will be created with the name: <project_name>-project-internal
  5. All users with Slack Member IDs will be automatically invited

Sending Project Details to Slack

  1. Open a project with a Slack channel configured
  2. Go to the Slack tab
  3. Click Send Project to Slack
  4. The project details (name, customer, project manager, collaborators, dates, tags) will be sent to the Slack channel

Inviting Users to an Existing Channel

  1. Open a project with an existing Slack channel
  2. Go to the Slack tab
  3. Click Invite Users to Slack Channel
  4. All users with Slack Member IDs will be invited

Automatic Log Notes

  1. Open a project
  2. Go to the Slack tab
  3. Enable Send Log Notes to Slack
  4. All log notes posted to the project will automatically be sent to the associated Slack channel

Manually Setting a Channel ID

  1. Open an opportunity or project
  2. Go to the Slack tab
  3. Enter the Slack Channel ID in the Slack Channel ID field
  4. The bot membership will be validated automatically

Note:

  • Channel IDs should start with C (for channels) or G (for private groups)
  • The bot must be a member of the channel before you can save the channel ID
  • Success messages from sending to Slack are not sent back to Slack to avoid loops

Requirements

  • Odoo 19.0 or later
  • Odoo CRM module (for opportunity integration)
  • Odoo Project module (for project integration)
  • Python requests library (usually included with Odoo)
  • Slack workspace with admin permissions to install apps

Troubleshooting

Channel Name Not Showing

  • Verify the Slack API key is configured correctly
  • Check that the channel ID is valid and starts with C or G
  • Ensure the app has groups:read scope
  • Check Odoo logs for API errors

Rate Limit Errors

  • The module automatically handles rate limits with retries
  • If you see persistent rate limit errors, reduce the frequency of operations
  • Check Slack API rate limits: https://api.slack.com/docs/rate-limits

Missing Scope Errors

  • Verify the app has channels:write, channels:manage, and users:read scopes
  • Reinstall the app to your workspace after adding scopes
  • See SLACK_API_PERMISSIONS.md for details

Users Not Being Invited

  • Verify users have Slack Member IDs configured
  • Check that Member IDs start with U
  • Ensure the app has groups:write scope
  • Check Odoo logs for invitation errors

Technical Details

Channel Creation

  • Creates private channels (is_private: True)
  • Opportunity channels: <opportunity_name>-sales-internal
  • Project channels: <project_name>-project-internal
  • Automatically sanitizes names to valid Slack channel names (lowercase, hyphens, underscores only)

API Integration

  • All API calls include retry logic and rate limit handling
  • Bot membership validation before saving channel IDs
  • Real-time validation with immediate user feedback
  • Comprehensive error handling with specific messages for common issues

Performance

  • Optimized to only search private channels (not public)
  • Efficient channel lookup and user invitation batching
  • Prevents duplicate notifications (success messages not sent back to Slack)

Data Sent to Slack

  • Opportunities: Name, stage, expected revenue, probability, company, salesperson, close dates, description
  • Projects: Name, customer, project manager, collaborators, start/end dates, tags, description
  • Rich formatting using Slack Block Kit for better readability

Support

For issues or questions:

License

LGPL-3

Author

Webisoft - https://www.webisoft.com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published