Skip to Content
Menu
This question has been flagged
3 Replies
7104 Views

Hello, I want to put a pre-made Odoo form on another platform, such as Wordpress to maximize lead generation. But when I create an API link on Odoo, put it on another page, and when the user submit, Odoo can't seem to get the answer (due to CORS error). If anyone has tried this before, please help me with it. Thanks

Avatar
Discard
Best Answer

Hi. I've dealt with this before and came to the following conclusions regards the options you have.

  1. Embed the form into your Wordpress site using an Iframe. 
    - First create a dedicated contact form page which has hidden header and footer in Odoo.
    Just create a new contact form then add this custom code after the first line as shown:
    <xpath expr="//header" position="before">
    <t t-set="no_header" t-value="True"/>
    <t t-set="no_footer" t-value="True"/>
    </xpath>
    -Finally, create the iframe embed code for your Wordpress site pointing to the dedicated Odoo contact form URL. You can use something like this to help:  iFrame Generator - Free Online iFrame Code Maker Tool (iframe-generator.com)
    -
    Note: You will likely need to setup your web server (proxy) with correct security header for X-FRAME-OPTIONS to allow external embedding for specific URL.
    If NGINX, use this:  How to Configure X-Frame-Options for NGINX - Fedingo
  2. Alternatively, use a Wordpress forms plugin which you may be doing already such as Gravity Forms, WPForms or Ninja Forms. Use Zapier to connect them together easily without any code.
    Connect your Gravity Forms to Odoo ERP Self Hosted integration in 2 minutes | Zapier
    You can do something like:
    When a form is submitted in Wordpress > Create an Odoo lead and map the relevant data across.
    Zapier is free if used for up to 100 tasks per month.

Hope that helps. Best of luck!

Chris

Avatar
Discard
Author

Hi Chris,
Thank for the detail instruction. I'm currently working with another Front-end Developer to try your way. Really appreciate your help.

Best Answer

Hi Luong: If this is just for lead generation, there is a very simple solution. Set up an email alias in Odoo and send an email from Wordpress to Odoo to this email address to automatically create the lead in Odoo.

Avatar
Discard
Author

Hi Paresh, I did tried this way. But all the fields (name, email, phone) will not be automatically filled in. I have to type everything again in the lead form view. The content of the email will be stored in the chatter. Kind of inconvenient for my sales reps. Thanks for replying to me. Appreciate this.

Best Answer

Hi Paresh and Luong, 

To not type all the information again, you could consider Yenthe's plugin, search on google for yenthe, odoo and mail parse. (I cannot post links here)

Or just using a server/contact action and automation rule to use python to extract the data from the mail into the lead.
Hope that helps! Cheers, Joep

Avatar
Discard