[IMP] Show quantity available
This commit is contained in:
parent
2c171f5f44
commit
04e86a70d9
|
@ -168,9 +168,16 @@ class product_product(osv.osv):
|
|||
res.append(('id', 'in', ids))
|
||||
return res
|
||||
|
||||
def _product_available_text(self, cr, uid, ids, field_names=None, arg=False, context=None):
|
||||
res = {}
|
||||
for product in self.browse(cr, uid, ids, context=context):
|
||||
res[product.id] = str(product.qty_available) + _(" In Stock")
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'reception_count': fields.function(_stock_move_count, string="Reception", type='integer', multi='pickings'),
|
||||
'delivery_count': fields.function(_stock_move_count, string="Delivery", type='integer', multi='pickings'),
|
||||
'qty_in_stock': fields.function(_product_available_text, type='char'),
|
||||
'qty_available': fields.function(_product_available, multi='qty_available',
|
||||
type='float', digits_compute=dp.get_precision('Product Unit of Measure'),
|
||||
string='Quantity On Hand',
|
||||
|
|
|
@ -1824,7 +1824,7 @@
|
|||
name="%(product_open_quants)d"
|
||||
icon="fa-building-o"
|
||||
type="action" attrs="{'invisible':[('type', '=', 'service')]}" groups="stock.group_locations">
|
||||
<div>Stock</div>
|
||||
<div><field name="qty_in_stock"/></div>
|
||||
</button>
|
||||
<button string="Moves" class="oe_stat_button" name= "%(act_product_stock_move_open)d" type="action"
|
||||
attrs="{'invisible':[('type', '=', 'service')]}"
|
||||
|
|
Loading…
Reference in New Issue