[FIX] write product_qty and product_uos_qty through ORM, thereby respecting decimal...
authorhbrunn@therp.nl <hbrunn@therp.nl>
Sun, 6 Jul 2014 15:39:30 +0000 (17:39 +0200)
committerPedro M. Baeza <pedro.baeza@gmail.com>
Sun, 6 Jul 2014 15:39:30 +0000 (17:39 +0200)
addons/stock/stock.py

index 26647d8..39d5bb1 100644 (file)
@@ -2235,7 +2235,11 @@ class stock_move(osv.osv):
                     pickings[move.picking_id.id] = 1
                     r = res.pop(0)
                     product_uos_qty = self.pool.get('stock.move').onchange_quantity(cr, uid, [move.id], move.product_id.id, r[0], move.product_id.uom_id.id, move.product_id.uos_id.id)['value']['product_uos_qty']
-                    cr.execute('update stock_move set location_id=%s, product_qty=%s, product_uos_qty=%s where id=%s', (r[1], r[0],product_uos_qty, move.id))
+                    move.write({
+                        'location_id': r[1],
+                        'product_qty': r[0],
+                        'product_uos_qty': product_uos_qty,
+                        })
 
                     while res:
                         r = res.pop(0)