[FIX] stock: `product cost` field in partial picking wizard must respect decimal...
authorOlivier Dony <odo@openerp.com>
Mon, 4 Nov 2013 17:01:18 +0000 (18:01 +0100)
committerOlivier Dony <odo@openerp.com>
Mon, 4 Nov 2013 17:01:18 +0000 (18:01 +0100)
Without the right precision the default rounding is
applied and causes a possible loss of precision when
the `Product Price` precision is increased.
This can in turn lead to incorrect average price
computations.

bzr revid: odo@openerp.com-20131104170118-ls5q0yridevw0jgt

addons/stock/wizard/stock_partial_picking.py

index 8c2c583..50ddc2b 100644 (file)
@@ -51,7 +51,7 @@ class stock_partial_picking_line(osv.TransientModel):
         'move_id' : fields.many2one('stock.move', "Move", ondelete='CASCADE'),
         'wizard_id' : fields.many2one('stock.partial.picking', string="Wizard", ondelete='CASCADE'),
         'update_cost': fields.boolean('Need cost update'),
-        'cost' : fields.float("Cost", help="Unit Cost for this product line"),
+        'cost' : fields.float("Cost", help="Unit Cost for this product line", digits_compute=dp.get_precision('Product Price')),
         'currency' : fields.many2one('res.currency', string="Currency", help="Currency in which Unit cost is expressed", ondelete='CASCADE'),
         'tracking': fields.function(_tracking, string='Tracking', type='boolean'),
     }