[MERGE] lp:~openerp-dev/openobject-addons/trunk-usability-processing_incomming_shipment-aar
bzr revid: stw@openerp.com-20110914151223-ke1sf4313wh7n2oi
This commit is contained in:
@@ -32,6 +32,8 @@ class stock_partial_move_memory_out(osv.osv_memory):
|
||||
'quantity' : fields.float("Quantity", required=True),
|
||||
'product_uom': fields.many2one('product.uom', 'Unit of Measure', required=True),
|
||||
'prodlot_id' : fields.many2one('stock.production.lot', 'Production Lot'),
|
||||
'location_id': fields.many2one('stock.location', 'Location', required=True),
|
||||
'location_dest_id': fields.many2one('stock.location', 'Dest. Location', required=True),
|
||||
'move_id' : fields.many2one('stock.move', "Move"),
|
||||
'wizard_id' : fields.many2one('stock.partial.move', string="Wizard"),
|
||||
'cost' : fields.float("Cost", help="Unit Cost for this product line"),
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
<field name="product_id" />
|
||||
<field name="quantity" />
|
||||
<field name="product_uom" />
|
||||
<field name="location_id" />
|
||||
<field name="location_dest_id" />
|
||||
<field name="prodlot_id" domain="[('product_id', '=', product_id)]" groups="base.group_extended" />
|
||||
<field name="cost" />
|
||||
<field name="currency" />
|
||||
@@ -46,6 +48,8 @@
|
||||
<field name="product_id" />
|
||||
<field name="quantity" />
|
||||
<field name="product_uom" />
|
||||
<field name="location_id" />
|
||||
<field name="location_dest_id" />
|
||||
<field name="prodlot_id" domain="[('product_id', '=', product_id)]" groups="base.group_extended" />
|
||||
<field name="cost" />
|
||||
<field name="currency" />
|
||||
@@ -62,6 +66,8 @@
|
||||
<field name="product_id" />
|
||||
<field name="quantity" />
|
||||
<field name="product_uom" />
|
||||
<field name="location_id" />
|
||||
<field name="location_dest_id" />
|
||||
<field name="prodlot_id" domain="[('product_id', '=', product_id)]" groups="base.group_extended" />
|
||||
</tree>
|
||||
</field>
|
||||
@@ -76,6 +82,8 @@
|
||||
<field name="product_id" />
|
||||
<field name="quantity" />
|
||||
<field name="product_uom" />
|
||||
<field name="location_id" />
|
||||
<field name="location_dest_id" />
|
||||
<field name="prodlot_id" domain="[('product_id', '=', product_id)]" groups="base.group_extended" />
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -122,7 +122,9 @@ class stock_partial_picking(osv.osv_memory):
|
||||
'quantity' : picking.product_qty,
|
||||
'product_uom' : picking.product_uom.id,
|
||||
'prodlot_id' : picking.prodlot_id.id,
|
||||
'move_id' : picking.id,
|
||||
'move_id' : picking.id,
|
||||
'location_id' : picking.location_id.id,
|
||||
'location_dest_id' : picking.location_dest_id.id,
|
||||
}
|
||||
|
||||
if pick_type == 'in':
|
||||
@@ -142,19 +144,32 @@ class stock_partial_picking(osv.osv_memory):
|
||||
@return: A dictionary which of fields with values.
|
||||
"""
|
||||
pick_obj = self.pool.get('stock.picking')
|
||||
|
||||
stock_move_obj = self.pool.get('stock.move')
|
||||
picking_ids = context.get('active_ids', False)
|
||||
partial = self.browse(cr, uid, ids[0], context=context)
|
||||
partial_datas = {
|
||||
'delivery_date' : partial.date
|
||||
}
|
||||
|
||||
for pick in pick_obj.browse(cr, uid, picking_ids, context=context):
|
||||
picking_type = self.get_picking_type(cr, uid, pick, context=context)
|
||||
moves_list = picking_type == 'in' and partial.product_moves_in or partial.product_moves_out
|
||||
|
||||
for move in moves_list:
|
||||
partial_datas['move%s' % (move.move_id.id)] = {
|
||||
if not move.move_id.id:
|
||||
seq_obj_name = 'stock.picking.' + picking_type
|
||||
move_id = stock_move_obj.create(cr,uid,{'name' : self.pool.get('ir.sequence').get(cr, uid, seq_obj_name),
|
||||
'product_id': move.product_id.id,
|
||||
'product_qty': move.quantity,
|
||||
'product_uom': move.product_uom.id,
|
||||
'prodlot_id': move.prodlot_id.id,
|
||||
'location_id' : move.location_id.id,
|
||||
'location_dest_id' : move.location_dest_id.id,
|
||||
'picking_id': pick.id
|
||||
},context=context)
|
||||
stock_move_obj.action_done(cr, uid, [move_id], context)
|
||||
else:
|
||||
move_id = move.move_id.id
|
||||
|
||||
partial_datas['move%s' % (move_id)] = {
|
||||
'product_id': move.id,
|
||||
'product_qty': move.quantity,
|
||||
'product_uom': move.product_uom.id,
|
||||
|
||||
Reference in New Issue
Block a user