Closed rogierslag closed 9 years ago
Old or not, there can never be two models of the same type with the same id. Look at new App.Models.OrderProductQuantity(order_product.get('product'))
. Here you're initializing a new OrderProductQuantity and passing the same product to each. It will initialize the OrderProductQuantity with the product's id
, which will obviously not work. You're probably looking for this: new App.Models.OrderProductQuantity(product: order_product.get('product'))
Never code between 6pm and dinner...
At inventid, we have some of the following code which goes over an array and saves the data in a grouped item (modified code)
Model
Method
When the
order_products_quantities
is called multiple times, we get a error from tailsError: Duplicate OrderProductQuantity for id 2.
. However, this should not be thrown, it seems it checks whether is was previously added to the old object@joostverdoorn @steffansluis