How to avoid duplication data from export and import csv file in ERP

Hello to everyone,
Iโ€™m ever working on my app to record training courses of employee. I created a slice called โ€œExport_Odooโ€ only with some selected columns from the table โ€œCORSIโ€ because I have to keep a specific column structure in order to import the csv in the ERP of my company. Now, I tried whit my colleagues the import in the ERP and after some setting, it works correctly and itโ€™s amazing!! But I have a big problem that i hope to overcame with your help. The main problem is that when i import the csv once a month(more or less), the rows are duplicated in the ERP because I also import the data that I have already imported the previous month.

In order to avoid this problem, I think to set a virtual column called โ€œEXPORT_CHECKโ€ with type โ€œY/Nโ€ and every time i use action to export some data from the view based on table โ€œExport_Odooโ€, is set โ€œYโ€ on the exported rows. So when i created a new record in the app (a new training course) is applied automatically the value โ€œNโ€ and on the next export, Iโ€™ll export only data whit โ€œNโ€. How can i set this features?

I hope I was clear, but I would appreciate your advice to overcome the data duplication problem in every import on the ERP
Tks ALL!!

0 7 360
7 REPLIES 7

There are several ways of solving this problem. Let me suggest one.

Add a new DateTime field in table โ€œCORSIโ€ called โ€œDateAddedโ€ and give it the InitialValue NOW(). As you add new records to your table the DateAdded field will be assigned the current date/time. In slice โ€œExport_Odooโ€ filter only those records added since the last time you did an export.

When you first add the new โ€œDateAddedโ€ field you will need to initialize all existing records in table โ€œCORSIโ€ to some date/time in the past.

Hi @Phil , I added a new column called โ€œDATA_AGGIUNTAโ€ with initial value NOW() and i set all existing records in a past date. If i set in slice โ€œExport_Odooโ€ the filtered condition [DATA_AGGIUNTA]>NOW() of course i donโ€™t see the value to export.

How can i set the condition on order to see only the new record?
Is it possible to export by selecting a particular period?
Tks you!

Create a Slice with a Row filter condition that only includes the newly created records.
Then export that slice.

@Phil Export_Odoo is already a slice. what formula can i use to include only the new records?

You could use a Row filter condition like:

ok, another way is insert a column โ€œCHECK_EXPORTโ€ type Y/N with initial value โ€œNโ€ and set in the slice the formula [CHECK_EXPORT]=โ€œNโ€. then when i make the export, i set Y the exported data in database. It might works?

Yes, that should work also. You simply need a data column whoโ€™s value indicates the rows of interest.

Top Labels in this Space