← Back to team overview

openerp-india team mailing list archive

[Bug 998631] Re: stock wrong computation of internal moves in get_product_available

 

Hello Dr Ferdinand,

This issue has been fixed on lp:~openerp-dev/openobject-addons/trunk-
bug-998631-amp  branch with following renno and revID.

rev no : 6802
rev ID : amp@xxxxxxxxxxx-20120518085818-8cuybt5d2qsgd3fg


It will be merge with trunk soon.

Thanks for the contribution!

** Changed in: openobject-addons
       Status: Confirmed => Fix Committed

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/998631

Title:
  stock wrong computation of internal moves in  get_product_available

Status in OpenERP Addons (modules):
  Fix Committed

Bug description:
  this is a rare hidden bug and will ony happen if
  * what is only 'in' OR 'out'
  * multiple internal location are selected
  * stock moves between the selected internal location exist

          if 'in' in what:
              # all moves from a location out of the set to a location in the set
              cr.execute(
                  'select sum(product_qty), product_id, product_uom '\
                  'from stock_move '\
  >>>                'where location_id NOT IN %s '\
                  'and location_dest_id IN %s '\
                  'and product_id IN %s '\
                  '' + (prodlot_id and ('and prodlot_id = ' + str(prodlot_id)) or '') + ' '\
                  'and state IN %s ' + (date_str and 'and '+date_str+' ' or '') +' '\
                  'group by product_id,product_uom',tuple(where))
              results = cr.fetchall()
          if 'out' in what:
              # all moves from a location in the set to a location out of the set
              cr.execute(
                  'select sum(product_qty), product_id, product_uom '\
                  'from stock_move '\
                  'where location_id IN %s '\
    >>>              'and location_dest_id NOT IN %s '\
                  'and product_id  IN %s '\
                  '' + (prodlot_id and ('and prodlot_id = ' + str(prodlot_id)) or '') + ' '\
                  'and state in %s ' + (date_str and 'and '+date_str+' ' or '') + ' '\
                  'group by product_id,product_uom',tuple(where))
              results2 = cr.fetchall()

  
  this can be fixed by elimination of the  marked  conditions
  see patch

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/998631/+subscriptions


References