Le Tue, 26 Oct 2010 22:11:38 +0200,
Udo Spallek <[email protected]> a écrit :

> Hi,
> 
> having massive problems to create a purchase with proteus. 
> Please take a look to my console session pasted here:
> 
> http://paste.pocoo.org/show/281813/

If I understand correctly:

The first

  >>> purchase_line1.product = Product.find([]).pop()

on line 6 raise an exception because purchase_line1 is not linked to
any purchase so no currency is unknown when on_change_product is
triggered, hence the exception. Maybe we should fix this on_change to
handle this case, but I'm not sure this make sense to create line
without purchase. So one think I would try is to first do :

  >>> purchase_line1.purchase = purchase

and then set the product.

The line 32 is ok, because on_change_product is not triggered (the
product is the same again).

Line 41 raise an exception because this time an on_change is triggered.

Same logic for other exceptions.

> 
> You can try out the failure by yourself.
> For this you need to install proteus, trytond and all modules.
> Proteus needed to be patched with:
> 
> http://codereview.appspot.com/2620042
> 
> To have a console for testing, please install
> 
> $ pip install interlude
> 
> If you do not like to install interlude, please comment out all lines
> containing the string interlude in my test script.
> 
> Here you can find my malfunctioning test script:
> 
> http://paste.pocoo.org/show/281926/
> 
> The console session from above starts at line 760 in this script.
> 
> TIA, Cheers

-- 
[email protected] mailing list

Reply via email to