Odoo Help

0

product_obj.virtual_available Puge ?

By
le_dilem
on 3/28/14, 5:35 AM 992 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.

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.

Register

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)

Stats

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