Ir al contenido
Menú
Se marcó esta pregunta
5 Respuestas
6220 Vistas

Hello

I tried a lot to import historical data for sales and purchase orders with correct effect in inventory valuation? 

Odoo's behaviors is like the following:

When importing orders, Odoo takes the validation date for POs,So Delivery and Receipt Orders not the real date for the orders!, which effect the many things like reports and inventory valuation

is there a way to fix this issue?


Avatar
Descartar
Mejor respuesta

Hi  Mohammad,

You can override Odoo functions, for example, passing a variable into context in the action_confirm function of the sale.order model and using that variable in the action_done function of stock.move.

Avatar
Descartar
Mejor respuesta

Hi, did anyone find an actual solution to this???

I have the same problem and I am going crazy.

Thanks

Avatar
Descartar

I don't know this works or not but,
try to update the fields is pgadmin,
maybe this will write the old dates.

Thank You

Hi Jenish M, thanks for your answer.
I am using odoo online, is it possible to update the fields in pgadmin in my case?
If so, how should I do it?

Thank you.

Hi,

For anyone looking for an answer, this worked for me:

Create an excel with the old data you want to import, and make sure it works (you can try first exporting some data you already have)

You'll be able to import all the data you want, except for the state of the order (which will be Quotation by defect.)

If you just validate that quoatation, the order date will be the current date, and we don't want that.
Instead of this, you need to create a new action.

Go to Server actions (in Settings / Technical / server Actions), and create a new action.

Name: (whichever name you want, in my case "Test Old Sales")
Model: Sales Order
Action: Update the record
Field: State
Evaluation type: value
Value: sale

Now, go to the Sales dashboard, select the sales you just imported (and that are Quotations) and in the Actions you should see the action you just created.

That's it :)

Hope it helps someone!

@Maria Senyer
I have used your solution it did change the status but it did not show its effect in move history any idea how it can be done?

@krakalien no idea. I know my solution does not affect in move history. I would also like to know how to do it.

Mejor respuesta

I just wanted to express my gratitude for the time I spent reading your post.

Avatar
Descartar
Mejor respuesta

Hello, Have you please found a solution for that problem? Thank you for your help !

Avatar
Descartar
Mejor respuesta

Hello

Yes, you may export the posted entries, then you change the dates in the excel and import them again. With that you have the correct date. 

Avatar
Descartar
Autor

Thanks for you answer, I tried this way before, but I didn't effect in stock valuation layer, because Odoo calculate it once the user validate the (Delivery/ Receipt )orders. actually this is the main problem!

Publicaciones relacionadas Respuestas Vistas Actividad
0
feb 20
3522
1
nov 24
3560
0
jul 24
2040
1
mar 24
2271
4
feb 24
5323