If you need to import pending orders only, DO THIS

Asked by youngi

Well, myself, I cannot test the module and order import when it is importing orders of all status and starting from the very beginning of the business.
So, all I needed was importing newly placed orders of status PENDING only. Here's what you have to edit:

open sale.py with IDLE editor and find the line that says :

if ctx.get('last_external_id', False):
                ids_or_filter[0]['increment_id'] = {'gt': ctx['last_external_id']}

and then comment it out writing a # at the beginning of the line

then, edit the line that says: ids_or_filter = [{'store_id': {'eq': magento_storeview_id}}]
to be: ids_or_filter = [{'store_id': {'eq': magento_storeview_id}, 'increment_id': {'gt': ctx.get('last_external_id', 0)},'status':'pending'}]

save, restart server and log back in.

in fact, all you did with this edit is add a filter to the orders list called from magento, plenty of filters you can use too depending on your needs.

Question information

English Edit question
Magento OpenERP Connector Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Sharoon Thomas http://openlabs.co.in (sharoonthomas) said :


Please propose a bug and put it in the wish list.
This feature of importing selected orders/from an order number/specified order type etc are frequently asked for.

Can you help with this problem?

Provide an answer of your own, or ask youngi for more information if necessary.

To post a message you must log in.