Skip to Content
Menu
This question has been flagged
1 Reply
7746 Views

I'm migrating data from openerp 6 to openerp 7, I've chosen to do it directly into database because it's very fast. But I'm having a problem with invoices, they are all imported with the correct data, but I can't cancel them or pay them (actually I can pay them but the state doesn't change).

I found this link http://forum.openerp.com/forum/topic20397.html, the author of the topic had the same a problem as me, but I don't quite understand the answer. And why the problem doesn't occure with sales orders, delivery orders...?

I've tried using xml-rpc, but the sate is not imported, all my invoices are in draft state.

Any help is welcomed.

Avatar
Discard
Best Answer

We have faced the same thing. Basically if you just import data into the database the ORM will not have attached any workflow to it. In other words, it will be a "dead" object.

The workflow is attached by the ORM when you create an object through the regular OpenERP way. The create does much more, but the most important thing is the workflow. 

If you use the XML-RPC connection to create new invoices, they will be just that; new invoices (so in draft state). A possibility would be to create all the invoices with XML-RPC and then using the newly created ids trigger the workflow. So basically you will be using the XML-RPC onnection to invoke the create method and then afterwards the method for the button to confirm the invoices.

 

The biggest downside to this import is the fact that some business logic might alter your invoices when buttons are pressed. You must always fill in the correct data (like in the case of the invoice; the invoice date) otherwise OpenERP uses the defaults for that, which is almost always incorrect in the case of historical import.

In short:

- Use XML-RPC to create invoices
- Use XML-RPC in a for loop over all the newly create invoices to trigger the method that confirms said invoices, just like you pressed the buttons by hand.

Avatar
Discard

@Ludo,

Thanks for the info. Do you have any suggestions on how to import [historical] invoices into Odoo 8.0 through the standard import/export functionality, or does this type of operation require bypassing the default import/export tools?

Related Posts Replies Views Activity
1
Apr 19
2025
2
Aug 18
9853
0
Feb 25
12
0
Sep 24
720
2
Oct 23
1709