Hi how can I calculate on loop (shop) product_obj.virtual_available.
1 - i add field "sale_shop_id" in sale.order.line for Delivery.
in sale.order.line function == > product_id_change
if context.get('shop') :
# Select all Shop
cr.execute("SELECT id FROM sale_shop WHERE id <> %s ", (context.get('shop'),))
lis = [i[0] for i in cr.fetchall()]
# Write in Shop line
res['value']['shop_line_id'] = context.get('shop')
# Test qty
if product_obj.virtual_available < 1 :
i = 0
while i < len(lis) :
#Update Shop
context.update({'shop': lis[i]})
#Test qty with new Shop
# My Problem is here always QTY = 0.0
if product_obj.virtual_available > 1 :
res['value']['shop_line_id'] = context.get('shop')
i = len(lis)
i += 1
My problem : how to puge product_obj.virtual_available to recalculate. Thanks.