Maybe it's because of the way some methods are override in our framework. I was 
trying to get over the problem by creating the order first (POST 
/ra/commandes), and after to create the order item (POST /ra/commandeArticles). 
But the sales taxes on the order item were not calculed when they should be 
calculed automatically. The taxes calculation is done when we set the quantity 
of the order item (setEcoaQuantite) and this setter is override so that we 
check if a product is linked to the order item and if it's linked, we calculate 
the taxes amount. 

Problem is that when setEcoaQuantite is called, the relationship (produit()) is 
not set, so the condition (if produit() != null) fails and the calculation is 
not done. But I did specify the product ID in the JSON data, so I guess 
setEcoaQuantite() is called before setProduitRelationship(). If I call the 
calculation after the CommandeArticle object is created, everything's working. 
We have a lot of funked things like that in that framework, so it might explain 
the other problem (creating the order and items in a single call) I'm having.

> seems like a bug
> 
> On Nov 20, 2010, at 3:20 AM, Farrukh Ijaz wrote:
> 
>> 
>> On 19, نومبر 2010, at 11:30 PM, Pascal Robert <[email protected]> wrote:
>> 
>>> Hi (especially Mike S.),
>>> 
>>> Mike, in the comments you made on my ERRest slides for WOWODC, you said 
>>> that sub-entities should be created for To Many relationships, but I just 
>>> tried back and it's doesn't work for me. I have a Order with a relation 
>>> (1:N) to OrderItem, and each OrderItem is linked to a product (1:1). Now, 
>>> if I try to create a Order with two OrderItem, the Order is created with 
>>> the values, but for the OrderItem, two items are created, but all values 
>>> are set to null.
>>> 
>>> So I am doing something wrong or do I have to create the order first and 
>>> make another calls to create each order item?
>> 
>> I think this is the case AFAIR in one of the podcasts it was explicitly 
>> mentioned that you need to make two separate calls.
>> 
>> Farrukh
>> 
>>> 
>>> 
>>> --
>>> Pascal Robert
>>> [email protected]
>>> 
>>> AIM/iChat : MacTICanada
>>> LinkedIn : http://www.linkedin.com/in/macti
>>> Twitter : pascal_robert
>>> 
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> Webobjects-dev mailing list      ([email protected])
>>> Help/Unsubscribe/Update your Subscription:
>>> http://lists.apple.com/mailman/options/webobjects-dev/farrukh.ijaz%40fuegodigitalmedia.com
>>> 
>>> This email sent to [email protected]
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list      ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/webobjects-dev/mschrag%40pobox.com
>> 
>> This email sent to [email protected]
> 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to