[ADD] stock: Add the production_lot field in Stock partial move wizard
bzr revid: sbh@tinyerp.com-20100922063855-zuj4ww3uzr69z9rl
This commit is contained in:
@@ -2283,6 +2283,9 @@ class stock_move(osv.osv):
|
||||
product_uom = partial_data.get('product_uom',False)
|
||||
product_price = partial_data.get('product_price',0.0)
|
||||
product_currency = partial_data.get('product_currency',False)
|
||||
prodlot_id = partial_data.get('prodlot_id',False)
|
||||
if prodlot_id:
|
||||
self.write(cr, uid, [move.id],{'prodlot_id': prodlot_id,})
|
||||
if move.product_qty == product_qty:
|
||||
complete.append(move)
|
||||
elif move.product_qty > product_qty:
|
||||
|
||||
@@ -47,7 +47,9 @@ class stock_partial_move(osv.osv_memory):
|
||||
self._columns['move%s_product_qty'%(m.id)] = fields.float("Quantity")
|
||||
if 'move%s_product_uom'%(m.id) not in self._columns:
|
||||
self._columns['move%s_product_uom'%(m.id)] = fields.many2one('product.uom',string="Product UOM")
|
||||
|
||||
if 'move%s_prodlot_id'%(m.id) not in self._columns:
|
||||
self._columns['move%s_prodlot_id'%(m.id)] = fields.many2one('stock.production.lot', string="Lot")
|
||||
|
||||
if (m.picking_id.type == 'in') and (m.product_id.cost_method == 'average'):
|
||||
if 'move%s_product_price'%(m.id) not in self._columns:
|
||||
self._columns['move%s_product_price'%(m.id)] = fields.float("Price")
|
||||
@@ -89,7 +91,12 @@ class stock_partial_move(osv.osv_memory):
|
||||
'relation': 'product.uom',
|
||||
'required' : True,
|
||||
'readonly' : True,
|
||||
}
|
||||
},
|
||||
'move%s_prodlot_id'%(m.id): {
|
||||
'string': _('Production Lot'),
|
||||
'type': 'many2one',
|
||||
'relation': 'stock.production.lot',
|
||||
}
|
||||
})
|
||||
|
||||
_moves_arch_lst += """
|
||||
@@ -97,7 +104,8 @@ class stock_partial_move(osv.osv_memory):
|
||||
<field name="move%s_product_id" nolabel="1"/>
|
||||
<field name="move%s_product_qty" string="Qty" />
|
||||
<field name="move%s_product_uom" nolabel="1" />
|
||||
"""%(m.id, m.id, m.id)
|
||||
<field name="move%s_prodlot_id" />
|
||||
"""%(m.id, m.id, m.id,m.id)
|
||||
if (m.picking_id.type == 'in') and (m.product_id.cost_method == 'average'):
|
||||
_moves_fields.update({
|
||||
'move%s_product_price'%(m.id) : {
|
||||
@@ -162,6 +170,8 @@ class stock_partial_move(osv.osv_memory):
|
||||
res['move%s_product_qty'%(m.id)] = m.product_qty
|
||||
if 'move%s_product_uom'%(m.id) in fields:
|
||||
res['move%s_product_uom'%(m.id)] = m.product_uom.id
|
||||
if 'move%s_prodlot_id'%(m.id) in fields:
|
||||
res['move%s_prodlot_id'%(m.id)] = m.prodlot_id.id
|
||||
if m.product_id.cost_method == 'average' :
|
||||
price = m.product_id.standard_price
|
||||
currency = False
|
||||
@@ -193,7 +203,8 @@ class stock_partial_move(osv.osv_memory):
|
||||
partial_datas['move%s'%(m.id)] = {
|
||||
'product_id' : getattr(partial, 'move%s_product_id'%(m.id)).id,
|
||||
'product_qty' : getattr(partial, 'move%s_product_qty'%(m.id)),
|
||||
'product_uom' : getattr(partial, 'move%s_product_uom'%(m.id)).id
|
||||
'product_uom' : getattr(partial, 'move%s_product_uom'%(m.id)).id,
|
||||
'prodlot_id' : getattr(partial, 'move%s_prodlot_id'%(m.id)).id
|
||||
}
|
||||
|
||||
if (m.picking_id.type == 'in') and (m.product_id.cost_method == 'average'):
|
||||
|
||||
Reference in New Issue
Block a user