Skip to content

Commit

Permalink
Merge pull request #104 from tarunbhardwaj/develop
Browse files Browse the repository at this point in the history
set `magento_last_order_import_time` after fetching order list #7787
  • Loading branch information
prakashpp committed May 15, 2015
2 parents f905ae2 + 290017c commit 8ee23a2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,14 +339,16 @@ def import_order_from_magento(self):
self.write([self], {
'magento_last_order_import_time': datetime.utcnow()
})
orders = order_api.list(filter)
for order in orders:
orders_summaries = order_api.list(filter)
for order_summary in orders_summaries:
if Sale.find_using_magento_data(order_summary):
continue
# No sale found, fetch full order_data and create
# sale from the same.
order_data = order_api.info(order_summary['increment_id'])
new_sales.append(
Sale.find_or_create_using_magento_data(
order_api.info(order['increment_id'])
)
Sale.create_using_magento_data(order_data)
)

return new_sales

@classmethod
Expand Down

0 comments on commit 8ee23a2

Please sign in to comment.