[Erp5-dev] Sale Supplies - problem with performance, some other questions

Łukasz K. Nowak lukasz.nowak at ventis.com.pl
Wed Jun 6 10:32:15 CEST 2007


Hello,

Dnia 05-06-2007, wto o godzinie 14:33 +0200, Łukasz K. Nowak napisał(a):
> On fresh revision (14673) I've create site with erp5_[base,trade,pdm].
> 
> There I've created 2 resources: 'car' and 'wheel'.
> 
> I've created 2 organisations: 'we' and 'them'.
> 
> I've created Sale Supply, which has destination 'them'.
> 
> In those Sale Supply I've created one Sale Supply Line for 'car' and 550
> for 'wheel'.
> 
> I've patched 'SupplyLine_asPredicate' with:
> script.log('%s'%(context.getRelativeUrl()))
> 
> I've created Sale Order from 'we' to 'them'. I added Sale Order Line,
> set resource to 'car' and...system is invoking 551 times
> 'SupplyLine_asPredicate' on every line in Sale Supplies - for every line
> from this Sale Supply.. Huh - its quite performance disaster, I've seen,
> that there might be many invocations of such predicate search.
> 
> I was just curious, and added default_supply_line to both resources -
> only that 'correct' one was searched.
> 
> Is it bug or feature?

Well. After playing some with Purchase and Sale Supplies in one system,
I've seen, that for given context (eg. Sale Order Line) all *Supply
Lines are searched. I've found, that patching Resource with given patch
make this search narrowed to only proper context (it is still much, but
in our system it is making things almost 2 times faster).

Any comments welcome.

Thanks,
Luke

-- 
Łukasz Nowak R&D Ventis http://www.ventis.com.pl/
tel: +48 32 768 16 85 fax: +48 32 392 10 61
``Use the Source, Luke...''

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ERP5-Document-Resource.py-only-sale-only-purchase.patch
Type: text/x-patch
Size: 1096 bytes
Desc: not available
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20070606/9b6ea4c9/attachment.bin>


More information about the Erp5-dev mailing list