[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
This commit is contained in:
parent
3da6c1a610
commit
ac67ce4ecc
|
@ -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)]},
|
||||
|
|
Loading…
Reference in New Issue