[MRG] merge lp:~openerp-dev/openobject-addons/trunk-10click-warehouse-tpa-fix-aja
authorTurkesh Patel (Open ERP) <tpa@tinyerp.com>
Fri, 9 Nov 2012 12:49:43 +0000 (18:19 +0530)
committerTurkesh Patel (Open ERP) <tpa@tinyerp.com>
Fri, 9 Nov 2012 12:49:43 +0000 (18:19 +0530)
bzr revid: tpa@tinyerp.com-20121109124943-l3ojm3bcld78vt7h

1  2 
addons/stock/wizard/stock_fill_inventory.py

@@@ -132,13 -129,12 +129,15 @@@ class stock_fill_inventory(osv.osv_memo
              for stock_move_details in stock_move.values():
                  stock_move_details.update({'inventory_id': context['active_ids'][0]})
                  domain = []
+                 for field, value in stock_move_details.items():
+                     if field == 'product_qty' and fill_inventory.set_stock_zero:
+                          domain.append((field, 'in', [value,'0']))
+                          continue
+                     domain.append((field, '=', value))
  
 +                if fill_inventory.set_stock_zero:
 +                    stock_move_details.update({'product_qty': 0})
 +
-                 for field, value in stock_move_details.items():
-                     domain.append((field, '=', value))
                  line_ids = inventory_line_obj.search(cr, uid, domain, context=context)
  
                  if not line_ids: