Mysql insert and update

Hi
i have successfully connected my Odoo Erp to mysql and i export data from a table in Odoo to mysql.

I use Truncate then fetch from odoo and insert to mysql table. All good so far. After this i changed to Insert and update and for some weird reason it doest update the existing records but inserts them again. i do have set a unique field to look at in order to achive this but still.

My goal is to insert a new record when i have a new record in odoo or update existing record in mysql when something changes in odoo.

What am i missing here?

Hey @petech,

It sounds like the match is not being found so it is making a new record, Are you using the Map Each column or Automatically Map as that can change what you need to do.

Hi Jon

i map each column. See below:

i can see the id of the record in mysql table

and here is the record that came for second time in mysql table:

Well that doesn’t look right, Do you get the same problem if the id field is marked as the primary key and unique in the database?

1 Like

Interesting, changing it to Unique works

Thanks Jon.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.