replace product_qty by product_uom_qty

This commit is contained in:
Yannick Vaucher
2014-09-01 20:31:53 +02:00
committed by Alexandre Fayolle
parent e648a372d9
commit 2cec2e50ff
3 changed files with 8 additions and 8 deletions

View File

@@ -30,7 +30,7 @@ class StockReservation(models.Model):
The fields mandatory for the creation of a reservation are:
* product_id
* product_qty
* product_uom_qty
* product_uom
* name
@@ -102,7 +102,7 @@ class StockReservation(models.Model):
'picking_type_id': _default_picking_type_id,
'location_id': _default_location_id,
'location_dest_id': _default_location_dest_id,
'product_qty': 1.0,
'product_uom_qty': 1.0,
}
@api.multi
@@ -166,8 +166,8 @@ class StockReservation(models.Model):
@api.onchange('product_uom_qty')
def _onchange_quantity(self):
""" On change of product quantity avoid negative quantities """
if not self.product_id or self.product_qty <= 0.0:
self.product_qty = 0.0
if not self.product_id or self.product_uom_qty <= 0.0:
self.product_uom_qty = 0.0
@api.multi
def open_move(self):

View File

@@ -36,7 +36,7 @@
-
!record {model: stock.reservation, id: reserv_sorbet1}:
product_id: product_sorbet
product_qty: 5.0
product_uom_qty: 5.0
product_uom: product.product_uom_kgm
name: reserve 5 kgm of sorbet for test
-

View File

@@ -24,9 +24,9 @@
<group>
<group name="main_grp" string="Details">
<field name="product_id" />
<label for="product_qty" />
<label for="product_uom_qty" />
<div>
<field name="product_qty" class="oe_inline"/>
<field name="product_uom_qty" class="oe_inline"/>
<field name="product_uom"
groups="product.group_uom" class="oe_inline"/>
</div>
@@ -60,7 +60,7 @@
<field name="name" />
<field name="product_id" />
<field name="move_id" />
<field name="product_qty" sum="Total" />
<field name="product_uom_qty" sum="Total" />
<field name="product_uom" />
<field name="date_validity" />
<field name="state"/>