summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGoffin Simon <sig@odoo.com>2015-03-19 11:10:51 +0100
committerJosse Colpaert <jco@odoo.com>2015-03-19 15:01:54 +0100
commitac67ce4ecc7e04467f3f4e0bdbdb32eef151ab31 (patch)
treec395b21fb5f428c572b2f6a318d70138998146c1
parent3da6c1a610af30a0c55a674cdcd4eaa9d8b98ee8 (diff)
[FIX] stock: quants not being reserved correctly
`product_qty` field is not recomputed at record creation. Force field recomputation at any change Removing the trigger on `product.product` should not be a problem as product uom can't be changed once there are move lines. opw:629650
-rw-r--r--addons/stock/stock.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index 6b4a5b39442..61391bb2315 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -1720,10 +1720,7 @@ class stock_move(osv.osv):
'date': fields.datetime('Date', required=True, select=True, help="Move date: scheduled date until move is done, then date of actual move processing", states={'done': [('readonly', True)]}),
'date_expected': fields.datetime('Expected Date', states={'done': [('readonly', True)]}, required=True, select=True, help="Scheduled date for the processing of this move"),
'product_id': fields.many2one('product.product', 'Product', required=True, select=True, domain=[('type', '<>', 'service')], states={'done': [('readonly', True)]}),
- 'product_qty': fields.function(_quantity_normalize, fnct_inv=_set_product_qty, type='float', digits=0, store={
- 'stock.move': (lambda self, cr, uid, ids, ctx: ids, ['product_id', 'product_uom_qty', 'product_uom'], 20),
- 'product.product': (_get_moves_from_prod, ['uom_id'], 20),
- }, string='Quantity',
+ 'product_qty': fields.function(_quantity_normalize, fnct_inv=_set_product_qty, type='float', digits=0, store=True, string='Quantity',
help='Quantity in the default UoM of the product'),
'product_uom_qty': fields.float('Quantity', digits_compute=dp.get_precision('Product Unit of Measure'),
required=True, states={'done': [('readonly', True)]},