Order update to Magento is wrong

Bug #520027 reported by Nautica
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Magento OpenERP Connector
Fix Released
Undecided
Unassigned

Bug Description

When I run the order updates from the connector, the status of orders that are "done" will generate the status "closed" in Magento and this is wrong.
In Magento the order only will get the status closed when there has been generated a Creditnote for an allready generated invoice within Magento.
Orders that are invoiced, paid and shipped get the status "completed"

I changed the script and changed the status 'done': 'closed' to 'done': 'complete'.

I don't know if its because of this change but when i run the updater which last update had the datetime 06-02-2010 12:19:36 it started to update order before this date starting from 5 jan 2010 10:47:59. But is keeps changing the status form the first order that is in OpenErp and everytime it sends an email to the customer ( can we switch email sending off?).

Also when there is NO invoice created in Magento the connector generates the creation of an invoice but the invoice status in Magento is not set to "paid" but "pending" even when the status in OpenErp is "paid"

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.

Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

@Nautica,

thanks for the report, seems you are right indeed, we will apply the patch soon.

Changed in magentoerpconnect:
status: New → Confirmed
Revision history for this message
Kyle Waid (midwest) wrote :

Hi, I noticed that this bug still exists. I also get an error when updating the order status but im not sure it it is an error on my part.
Its like its trying to create an invoice when one already exists. Also when it posts the status closed, when I scroll down to the bottom on the order details page "credit notes" it says status processing but at the top and note it says closed. Weird.

[2010-11-30 16:09:57,419][midwest] ERROR:Magento Call:[17]: Arguments:[u'190497', [], 'Invoice Created', True, True]
[2010-11-30 16:09:57,419][midwest] ERROR:Magento Call:[18]: Error:<Fault 102: 'Can not do invoice for order.'>
[2010-11-30 16:09:57,426][midwest] WARNING:Magento Call:Webservice Failure, sleeping 1 second before next attempt
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse><fault><value><struct><member><name>faultCode</name><value><int>102</int></value></member><member><name>faultString</name><value><string>Can not do invoice for order.</string></value></member></struct></value></fault></methodResponse>

Revision history for this message
Kyle Waid (midwest) wrote :

I have checked recently and I believe this issue is fixed

Changed in magentoerpconnect:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.