Jack-Dane / odoo-wp-plugin

Odoo WordPress Plugin
GNU General Public License v3.0
8 stars 4 forks source link

Prospects are not sent to CRM #7

Closed JulesNdanga closed 1 year ago

JulesNdanga commented 1 year ago

The information filled in the contact form 7 form does not arrive in odoo. Unlike your example in the video, I use the crm.lead model to automatically create pipelines. And no error is returned when I do the tests.

JulesNdanga commented 1 year ago

Some fields have also been done with studio in odoo

Jack-Dane commented 1 year ago

@JulesNdanga, thanks again for the issue.

Could you let me know the Odoo version that you are using?

I couldn't replicate this in my local install, a few things to make sure you have done:

Could you also share the Odoo logs as well, you should see something like this:

odoo-web-1  | 2023-07-05 19:54:23,755 1 INFO Test odoo.addons.base.models.res_users: Login successful for db:<db name> login:<email> from n/a 
odoo-web-1  | 2023-07-05 19:54:23,755 1 INFO Test werkzeug: 172.18.0.1 - - [05/Jul/2023 19:54:23] "POST /xmlrpc/2/common HTTP/1.0" 200 - 8 0.004 0.285
odoo-web-1  | 2023-07-05 19:54:23,805 1 INFO Test werkzeug: 172.18.0.1 - - [05/Jul/2023 19:54:23] "POST /xmlrpc/2/object HTTP/1.0" 200 - 30 0.014 0.035
JulesNdanga commented 1 year ago

Hello Dan. I use Odoo saas~16.2+e (Enterprise Edition), I did not put the trailing slash at the url level and I will make sure that the type of fields correspond to those of the model in odoo and I come back to you on that.

JulesNdanga commented 1 year ago

In the example of the video for the link of your server it is in http, I put https, given the ssl security certificate is active, can this be a problem?

Jack-Dane commented 1 year ago

Thanks for supplying the Odoo version.

Sending data using SSL encryption shouldn't be an issue, I have used the same API for a secure connection before and it was ok but I will see if I can try again later.

Are you able to check the Odoo logs?

It might also help if you can send screen shots of the field mapping table and the CF7 form code you are trying to use.

JulesNdanga commented 1 year ago

image image

JulesNdanga commented 1 year ago

Here are the screenshots of CF7 form field mapping table and code. Here are the screenshots of the CF7 form field mapping table and code. Since odoo cloud, I don't have access to the log file.

JulesNdanga commented 1 year ago

But did you also have to test with the "crm.lead" to automatically create an opportunity?

Jack-Dane commented 1 year ago

I can see a few problems with the implementation.

For the model crm.lead you need to add the type and name fields as they are required fields on the record: odoo-crm-lead

I can see one of your fields is x_studio_many_2_one_field..., I think when using the API to enter this data you need to use the ID of the record. If this is the case using a string won't work with this plugin, I will open a feature request for this as it seems like it would be useful.

Here is the example I used to test:

odoo-wp

I would suggest adding the type constant [lead|opportunity] and removing the many2one field and try again.

JulesNdanga commented 1 year ago

image Hello, this still does not work. Can you just popup info that reports errors that occur? Because there it does not return any error, it does not make it easy to find the problem. I'll see if it's not because of the fields generated by studio.

JulesNdanga commented 1 year ago

It's good, it's the studio fields that prevent this. image I suggest you some features to implement. -Popup info that returns the error that occurred to make it easier to solve the problem. -Integration of other form plugins (ninja...etc) and also support for forms made with elementor or divi

Jack-Dane commented 1 year ago

Glad you have it working and thanks for your feedback @JulesNdanga.

I agree, the error reporting could be improved so I have created a story for that: https://github.com/Jack-Dane/odoo-wp-plugin/issues/8

Further integration is planned, but a solid foundation with CF7 is required first (eg: ironing out these issues you have noted).

I wasn't aware of the unsupported studio fields, unfortunately, I don't have access to an instance with studio to test why it didn't work. I will make an effort to note this in the README.md so others are aware. When implementing similar API requests, I don't recall having a problem entering data into studio fields. But this was with Odoo.sh, maybe there is a difference with Odoo online.

JulesNdanga commented 1 year ago

For odoo studio fields, the problem comes from the fact that they are selection fields, with text fields it works well. It's almost the same problem as with the contact form 7 when mapping the selection fields.