Comment 1 for bug 520027

Revision history for this message
Nautica (nautica1959) wrote :

i changed in sale.py the line #32 from:

ORDER_STATUS_MAPPING = {'draft': 'processing', 'progress': 'processing', 'shipping_except': 'complete', 'invoice_except': 'complete', 'done': 'closed', 'cancel': 'canceled', 'waiting_date': 'holded'}

to:

ORDER_STATUS_MAPPING = {'draft': 'processing', 'progress': 'processing', 'shipping_except': 'complete', 'invoice_except': 'complete', 'done': 'complete', 'cancel': 'canceled', 'waiting_date': 'holded'}

This seems to do the trick for the right status for orders that are complete but now it also changes orders that have a creditnote and should have status "closed"
So the connector should include an API call to check if a creditnote exists in Magento for this order and then give the status "closed"

Also when there is NO invoice in Magento the connector generates an invoice for Magento but forgets to capture the payment.
The connector should check the payment status in OpenErp and when the status is "paid" it should also capture the payment after the invoice is created with the API CALL sales_order_invoice.capture where the status is set to STATE_PAID = 2
Please note that the connector checks the invoice to see if can be captured before attempting to capture an invoice, otherwise the API call with generate an error.