Skip to Content
Menu
This question has been flagged

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
Discard
Best Answer

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
Discard
Best Answer

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

I have the same problem and I am going crazy.

Thanks

Avatar
Discard

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.

Best Answer

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

Avatar
Discard
Best Answer

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

Avatar
Discard
Best Answer

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
Discard
Author

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!

Related Posts Replies Views Activity
0
Feb 20
3526
1
Nov 24
3565
0
Jul 24
2045
1
Mar 24
2277
4
Feb 24
5330