Odoo Help


product_obj.virtual_available Puge ?

on 3/28/14, 5:35 AM 810 views

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.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 3/28/14, 5:35 AM
Seen: 810 times
Last updated: 3/16/15, 8:10 AM