← Back to team overview

openerp-connector-community team mailing list archive

Re: Limited sale order import filtered by update date

 

Hello Guewen,

you guessed right: I actually was talking about imported sale orders.

Thank you for the hint about SaleImportRule. We will look at this. :)

The limit is actually because of a performance issue. For our current project we want to import historical customer data, too. So initial we need to import all sale orders from the past. There're pretty much old sale orders.

Greetings,
Katja

Am 13.05.2014 08:53, schrieb Guewen Baconnier:
Hello Katja,

On 05/12/2014 04:31 PM, Katja Matthes wrote:
Hello Guewen, hello community,

(Sorry for writing to the wrong mailing list previously.)

we noticed that Magento's OpenERP-API provide a function to flag
imported products, but the Magento-Connector don't use this function.
Guewen, is there a reason for this? Please, can you explain it for us.

You mean "imported sales orders" I guess.
It was used in the old connector (version 6.1 at least) and we decided
not to continue to use it.  Initially, in the old connector, the sales
orders were imported in batch (where create_date is greater than last
import date), so if the import of one sales orders failed, we had to
stop the batch until the resolution of the problem, blocking import of
many other orders.  We implemented the flag so the criteria was now
based on it rather than the 'last import date'.

Since each import of sales order is independent now, we do no longer
need to use the flag.


In our current scenario we have an issue with filtering the sale orders,
that should be imported from magento:
It's simple to configure the import so that only sale orders with a
specific status (e.g. processing) will be imported, and to limit the
import (e.g. 1000 orders per call).

Why do you need to limit to 1000 orders? Is it a performance issue? Do
you really have more than 1000 orders between 2 imports?

Our problem is, that we have orders which should not be imported
immediatly, but maybe later. E.g., this orders are in an "on hold"
status and maybe they will switch to "processing" status. Obviously it's
no good idea to filter the import by creation date, because the order
state could change later. The update date is more relevant.
Unfourtunatly we can not simply filter by update date: Since we set an
limit to our import, we have to ensure that Magento's OpenERP-API will
send the records ordered by update date. Currently the API orders by
entity_id and there's no option to change the sort order.

Do anyone encounter a similar problem? How do you solve it? Can you
provide a soulution?

That's special cases of the existing "Import Rules" (configured on
payment methods).
Look at magentoerpconnect.sale.SaleImportRule, this is how it is solved
for the current rules (e.g. do not import before paid).
The job is created at the beginning, but is delayed until a condition is
fulfilled.  While the condition is not met, the job raises a
OrderImportRuleRetry to delay again the import.


We're thinking about two different solutions:

Solution 1) Use API function to set sale order's import status on
magento side after import.
Here we have to adjust connector code.

Solution 2) Extend Magento's export API-function with a parameter for
sorting order and order by update date.
Here we have to adjust Magento's OpenERP-API.

3) extend the SaleImportRule to add you own conditions.


Which solution would you prefer? Maybe it's hard to send further
developmento to Magento's API upstream, so it's better to makge changes
on OpenERP side? Is there an objection to solution 1, e.g. to many
API-calls?

We're looking forward to your response.
If there's no solution yet, we hope to work out a solution that helps
the whole community.

Thanks for reading and Regards,
Katja


Have a nice day,


--
Dipl.-Inform. Katja Matthes
Softwareentwicklerin

initOS GmbH & Co. KG
An der Eisenbahn 1
21224 Rosengarten

Phone:   +49 4105 56156-14
Fax:     +49 4105 56156-10

Email:   katja.matthes@xxxxxxxxxx
Web:     http://www.initos.com

Geschäftsführung:
Dipl. Wirt.-Inf. Frederik Kramer & Dipl.-Ing. (FH) Torsten Francke
Haftende Gesellschafterin: initOS Verwaltungs GmbH

Sitz der Gesellschaft: Rosengarten – Klecken
Amtsgericht Tostedt, HRA 201840
USt-IdNr: DE 275698169
Steuer-Nr: 15/205/21402


References