Sales orders missed from imports
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenERP Connector - Magento |
Fix Released
|
Critical
|
Unassigned |
Bug Description
Original report by Allison Miller:
> We have recently discovered an issue when running scheduled batch imports
> of sale orders, after seeing that a couple of orders never made it into
> OpenERP. The batch performs a search for Magento orders using the
> created_at time. This has the potential to skip orders by starting and
> finishing the search in between the time an order is placed and that
order
> is committed to the database. We see this specifically with credit card
> orders; the authorization call can take multiple seconds to respond and
is
> made in the same PHP transaction as the order creation, so though the
> created_at date reflects when PHP ran, the order is not searchable by
> OpenERP until the full transaction has processed.
Related branches
- OpenERP Connector Core Editors: Pending requested
-
Diff: 149 lines (+61/-10)2 files modifiedmagentoerpconnect/magento_model.py (+44/-9)
magentoerpconnect/sale.py (+17/-1)
Changed in openerp-connector-magento: | |
status: | Confirmed → Fix Released |
Allison Miller proposed:
"""
After some discussion, the most thorough solution we have come up with is
adding 'exported' flags to Magento objects. This eliminates the risk of
entirely missing records, as they can always be caught on the next import.
For objects that get updated (products, for example) this flag would have
to be reset when updates occur. This will make upgrading existing
instances of the connector a bit tricky, because flags would have to be
properly set initially in Magento after the column is created.
Some other solutions we discussed but did not like are: create_ at' and 'committed_ update_ at' columns to Magento
- Adding 'committed_
objects in the database that are set by MySQL so they reflect times more
accurately. We would still run into a possible millisecond misalignment
here.
- Adding a buffer to import times (for example, if the last job finished
searching at 09:15:00, the next would start at 09:14:30). This would not
fix the problem but it would eliminate virtually all skipped records. With
this approach, duplicate orders would have to be handled differently so
failed jobs would not need to be cleaned up regularly.
"""