Skip to content

mohamadnagi/wordpress-odoo-Integration-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Odoo Vendor Registration - WordPress Plugin

Version WordPress PHP License

A powerful WordPress plugin that seamlessly integrates with Odoo ERP for vendor registration, customer management, and lead generation. Perfect for businesses looking to streamline their vendor onboarding and customer inquiry processes.

🌟 Key Features

πŸ“‹ Vendor Registration System

  • Public registration forms with customizable shortcodes
  • Admin approval workflow with manual sync controls
  • Email notifications to vendors upon registration
  • Vendor directory integration ready
  • Duplicate prevention with email validation

πŸ‘₯ Automatic User Synchronization

  • Auto-sync WordPress users to Odoo as customers
  • Profile update sync - changes reflect in Odoo
  • Bulk sync existing users with one click
  • Manual sync options for individual users
  • Sync status tracking in admin dashboard

πŸ’Ό Lead & Interest Management

  • Customer interest forms for product/service inquiries
  • Login-required lead submission for verified customers
  • Vendor selection from registered vendors
  • Priority levels (Low, Normal, High, Urgent)
  • Date tracking with expected delivery dates
  • Automatic CRM sync to Odoo leads/opportunities

🎨 Modern Bootstrap 5 UI

  • Beautiful gradient designs for both forms
  • Fully responsive - works on all devices
  • Bootstrap Icons for enhanced visual appeal
  • Smooth animations and transitions
  • Custom color schemes easily customizable
  • Dark mode support (optional)

βš™οΈ Admin Dashboard

  • Centralized settings for Odoo connection
  • Connection testing tool
  • Vendor submissions table with sync status
  • User sync management with status tracking
  • Lead submissions viewer with details
  • Manual sync buttons for failed submissions

πŸ”’ Security Features

  • Nonce verification on all AJAX requests
  • Data sanitization and validation
  • SQL injection prevention
  • XSS protection
  • User capability checks
  • Secure API communication

πŸ“¦ What Gets Created in Odoo

Vendors (from Registration Form)

Model: res.partner
- supplier_rank = 1 (marked as vendor/supplier)
- All contact details
- Company information (if provided)

Customers (from WordPress Users)

Model: res.partner
- customer_rank = 1 (marked as customer)
- Synced automatically on registration
- Profile updates reflected in Odoo

Leads (from Interest Form)

Model: crm.lead
- Linked to customer partner_id
- Contains vendor preferences
- Includes detailed requirements
- Set priority and deadline
- Ready for sales team follow-up

πŸ”§ Requirements

  • WordPress: 5.0 or higher
  • PHP: 7.4 or higher
  • MySQL: 5.6 or higher
  • Odoo: 13+ (recommended)
  • PHP Extensions: cURL, JSON
  • WordPress Features: AJAX, User Registration

πŸ“₯ Installation

Method 1: Manual Upload

  1. Download the plugin ZIP file
  2. Navigate to WordPress Admin β†’ Plugins β†’ Add New
  3. Click "Upload Plugin" button
  4. Choose the ZIP file and click "Install Now"
  5. Activate the plugin after installation
  6. Configure settings at Settings β†’ Odoo Vendor

Method 2: FTP Upload

  1. Extract the ZIP file
  2. Upload the odoo-vendor-registration folder to /wp-content/plugins/
  3. Activate the plugin through WordPress Admin β†’ Plugins
  4. Configure settings at Settings β†’ Odoo Vendor

Method 3: WordPress CLI

wp plugin install odoo-vendor-registration.zip --activate

βš™οΈ Configuration

Step 1: Odoo Connection Setup

  1. Go to Settings β†’ Odoo Vendor
  2. Enter your Odoo credentials:
    • Odoo Base URL: https://your-odoo-instance.com
    • Database Name: Your Odoo database name
    • Username: Your Odoo admin username
    • Password: Your Odoo password
    • Model Name: res.partner (default, recommended)
  3. Click "Test Connection" to verify
  4. Click "Save Changes"

Step 2: Enable User Auto-Sync (Optional)

  1. Check β˜‘ "Auto-Sync WordPress Users"
  2. Click "Save Changes"
  3. Click "Sync All Unsynced Users to Odoo" to sync existing users

Step 3: Add Forms to Your Pages

Vendor Registration Form

Create a new page and add:

[odoo_vendor_form]

With custom options:

[odoo_vendor_form 
    title="Become a Partner" 
    show_company="true" 
    button_text="Apply Now"
]

Lead/Interest Form

Create a new page and add:

[odoo_lead_form]

With custom options:

[odoo_lead_form 
    title="Find Your Vendor" 
    button_text="Submit Request"
]

🎯 Usage Examples

Basic Vendor Registration Page

<h1>Join Our Vendor Network</h1>
<p>Register to become an approved vendor and reach thousands of customers.</p>

[odoo_vendor_form]

<h2>Benefits of Joining</h2>
<ul>
    <li>Access to our customer base</li>
    <li>Marketing exposure</li>
    <li>Streamlined order management</li>
</ul>

Customer Interest Page

<h1>Tell Us What You Need</h1>
<p>Submit your requirements and we'll match you with the perfect vendor.</p>

[odoo_lead_form]

<p><em>Note: You must be logged in to submit an interest form.</em></p>

Custom Styled Form

<div class="my-vendor-section">
    <div class="intro-text">
        <h2>Partner With Us</h2>
        <p>Complete the form below to start your journey.</p>
    </div>
    
    [odoo_vendor_form 
        title="Vendor Application" 
        button_text="Submit Application"
    ]
</div>

🎨 Shortcode Reference

Vendor Form Shortcode

[odoo_vendor_form]

Attributes:

  • title - Form heading (default: "Vendor Registration")
  • show_company - Show company field: "true" or "false" (default: "true")
  • button_text - Submit button text (default: "Submit Registration")

Examples:

[odoo_vendor_form title="Become a Vendor"]
[odoo_vendor_form show_company="false"]
[odoo_vendor_form button_text="Register Now"]
[odoo_vendor_form title="Apply Today" show_company="true" button_text="Send Application"]

Lead Form Shortcode

[odoo_lead_form]

Attributes:

  • title - Form heading (default: "Submit Your Interest")
  • button_text - Submit button text (default: "Submit Interest")

Examples:

[odoo_lead_form title="Request a Quote"]
[odoo_lead_form button_text="Send Inquiry"]
[odoo_lead_form title="Find Vendors" button_text="Submit Request"]

πŸ“Š Admin Panel Guide

Dashboard Sections

1. Connection Settings

  • Configure Odoo credentials
  • Test connection status
  • Set model preferences
  • Enable/disable auto-sync

2. Vendor Submissions

  • View all vendor registrations
  • Check sync status (Synced/Pending)
  • Manually sync failed submissions
  • View Odoo partner IDs

3. WordPress Users Sync

  • View all registered users
  • Check sync status
  • Sync individual users
  • Bulk sync all unsynced users
  • View Odoo partner IDs and sync dates

4. Lead/Interest Submissions

  • View all customer interests
  • Check lead details
  • View selected vendors
  • Check priority and deadlines
  • Manually sync to Odoo CRM
  • Track Odoo lead IDs

πŸ”„ Complete User Journeys

Journey 1: Vendor Registration

1. Vendor visits registration page
2. Fills out form (name, email, phone, company)
3. Submits form (AJAX)
4. Data saved to WordPress
5. Auto-synced to Odoo as supplier (res.partner)
6. Confirmation email sent
7. Admin can approve/view in dashboard

Journey 2: Customer Account

1. Customer registers on WordPress
2. Account created
3. Auto-synced to Odoo as customer (res.partner)
4. Can now submit interest/lead forms

Journey 3: Lead Submission

1. Customer logs in
2. Browses vendor directory
3. Visits lead form page
4. Fills out requirements
5. Selects preferred vendors
6. Submits form
7. Saved to WordPress
8. Auto-synced to Odoo CRM (crm.lead)
9. Sales team receives notification
10. Follow-up begins

🎨 Customization

Custom CSS

Add to your theme's stylesheet or Customizer:

/* Change vendor form background */
.odoo-vendor-form-container .card-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%) !important;
}

/* Change lead form gradient */
.odoo-lead-form-container .card-header {
    background: linear-gradient(135deg, #f46b45 0%, #eea849 100%) !important;
}

/* Customize button colors */
.odoo-vendor-submit-btn {
    background-color: #28a745 !important;
}

/* Adjust form width */
.odoo-vendor-form-container,
.odoo-lead-form-container {
    max-width: 800px;
    margin: 0 auto;
}

Hide Company Field

Use shortcode attribute:

[odoo_vendor_form show_company="false"]

Or via CSS:

#company_name {
    display: none;
}

πŸ› Troubleshooting

Connection Test Fails

Solution:

  1. Verify Odoo URL is correct
  2. Check database name matches exactly
  3. Ensure username/password are correct
  4. Confirm Odoo instance is accessible from your server
  5. Check firewall rules

Form Not Displaying

Solution:

  1. Ensure plugin is activated
  2. Verify shortcode syntax: [odoo_vendor_form] or [odoo_lead_form]
  3. Clear browser and WordPress cache
  4. Check for JavaScript errors in browser console
  5. Ensure Bootstrap is loading correctly

Sync Fails

Solution:

  1. Test connection in Settings β†’ Odoo Vendor
  2. Check WordPress debug log (/wp-content/debug.log)
  3. Verify Odoo user has proper permissions
  4. Confirm model res.partner exists in Odoo
  5. Try manual sync from admin dashboard
  6. Check Odoo logs for API errors

Lead Form Requires Login

This is by design. Lead forms require authentication.

Solution:

  1. Enable WordPress user registration: Settings β†’ General β†’ Anyone can register
  2. User must create account first
  3. Then they can submit lead forms
  4. Or create custom registration flow

Email Not Sending

Solution:

  1. Check WordPress email settings
  2. Test with WP Mail SMTP plugin
  3. Verify SMTP configuration
  4. Check spam folder
  5. Review wp_mail() logs

πŸ“ Debug Mode

Enable detailed logging:

Edit wp-config.php:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors', 0);

Check logs at: /wp-content/debug.log

Look for:

  • Odoo API Error:
  • Odoo API Request:
  • Odoo API Response:
  • Failed to sync:

πŸ” Security Best Practices

  1. SSL/TLS: Use HTTPS for your WordPress site
  2. Odoo SSL: Enable SSL verification in production (edit class-odoo-api.php line 222)
  3. Strong Passwords: Use strong Odoo credentials
  4. User Roles: Limit admin access
  5. Regular Updates: Keep WordPress, plugins, and Odoo updated
  6. Backups: Regular database backups
  7. API Limits: Monitor API usage

πŸ“Š Database Tables

The plugin creates these tables:

wp_odoo_vendor_submissions

Stores vendor registration submissions

wp_odoo_lead_submissions

Stores customer interest/lead submissions

wp_usermeta

Adds fields:

  • odoo_partner_id - Odoo partner ID
  • odoo_synced - Sync status
  • odoo_sync_date - Last sync timestamp
  • odoo_sync_error - Error message (if any)

🌍 Language Support

Currently available in English. Translation-ready with:

  • .pot file for translators
  • Compatible with WPML
  • Compatible with Polylang

🀝 Support

For support, please:

  1. Check Documentation: Review all included .md files
  2. Enable Debug Mode: Check error logs
  3. Test Connection: Use admin panel test tool
  4. Check Odoo: Verify Odoo is accessible
  5. Contact Developer: LinkedIn

πŸ“š Additional Documentation

  • QUICK-START.md - 5-minute setup guide
  • INSTALLATION-SUMMARY.md - Detailed installation
  • VISUAL-GUIDE.md - UI reference with examples
  • TESTING-CHECKLIST.md - QA checklist
  • DEBUG-GUIDE.md - Troubleshooting guide
  • TROUBLESHOOTING.md - Common issues
  • USER-SYNC-GUIDE.md - User synchronization
  • LEAD-FORM-GUIDE.md - Lead form documentation
  • BOOTSTRAP-UI-GUIDE.md - UI customization
  • CHANGELOG.md - Version history

πŸ“‹ Changelog

Version 1.0.1 (2025-10-22)

  • ✨ Improved error handling with detailed messages
  • πŸ› Fixed manual sync error messages
  • πŸ“ Enhanced debug logging
  • πŸ”„ Better API response handling
  • πŸ“š Added comprehensive documentation

Version 1.0.0 (2025-10-22)

  • πŸŽ‰ Initial release
  • βœ… Vendor registration form
  • βœ… User auto-sync to Odoo
  • βœ… Lead/interest form
  • βœ… Bootstrap 5 UI
  • βœ… Admin dashboard
  • βœ… Email notifications

🎯 Roadmap

Planned Features

  • Bulk vendor sync
  • Custom field mapping
  • Webhook support
  • Import vendors from Odoo
  • Advanced filtering
  • CSV export
  • WooCommerce integration
  • Multi-language support
  • Custom email templates
  • Vendor portal

πŸ‘ Credits

Developed by: Mohamad Nagi

Built with:

  • WordPress REST API
  • Odoo JSON-RPC API
  • Bootstrap 5
  • Bootstrap Icons
  • jQuery

πŸ“„ License

This plugin is licensed under GPL v2 or later.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

🌟 Show Your Support

If you find this plugin helpful:

  • ⭐ Star this project
  • πŸ› Report bugs and suggest features
  • πŸ“’ Share with others who might benefit
  • β˜• Buy me a coffee (link in profile)
  • πŸ“ Leave a review on WordPress.org

πŸ’Ό Professional Services

Need custom development or Odoo integration?

  • WordPress plugin development
  • Odoo customization
  • ERP integration solutions
  • API development
  • Custom workflows

Contact: LinkedIn


Made with ❀️ for the WordPress and Odoo communities

πŸ”— Links:


Β© 2025 Mohamad Nagi. All rights reserved.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published