Amit Parmar (OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-usability-processing_an_incomming_shipments-aar
into lp:~openerp-dev/openobject-addons/trunk-usability.
Requested reviews:
Amit (Open ERP) (apa-tiny)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-usability-processing_an_incomming_shipments-aar/+merge/74207
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-usability-processing_an_incomming_shipments-aar/+merge/74207
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-usability.
=== modified file 'stock/wizard/stock_partial_picking.py'
--- stock/wizard/stock_partial_picking.py 2011-05-02 18:46:43 +0000
+++ stock/wizard/stock_partial_picking.py 2011-09-06 12:32:37 +0000
@@ -142,7 +142,8 @@
@return: A dictionary which of fields with values.
"""
pick_obj = self.pool.get('stock.picking')
-
+ product = self.pool.get('product.product')
+ stock_obj = self.pool.get('stock.move')
picking_ids = context.get('active_ids', False)
partial = self.browse(cr, uid, ids[0], context=context)
partial_datas = {
@@ -154,14 +155,45 @@
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 move.move_id:
+ location_id = move.move_id.location_id.id
+ location_dest_id = move.move_id.location_dest_id.id
+ picking_id = move.move_id.picking_id.id
+ partial_datas['move%s' % (move.move_id.id)] = {
'product_id': move.id,
'product_qty': move.quantity,
'product_uom': move.product_uom.id,
'prodlot_id': move.prodlot_id.id,
- }
- if (picking_type == 'in') and (move.product_id.cost_method == 'average'):
- partial_datas['move%s' % (move.move_id.id)].update({
+ }
+ if (picking_type == 'in') and (move.product_id.cost_method == 'average'):
+ partial_datas['move%s' % (move.move_id.id)].update({
+ 'product_price' : move.cost,
+ 'product_currency': move.currency.id,
+ })
+ else:
+
+ data = {'location_id': location_id,
+ 'location_dest_id': location_dest_id,
+ 'date_expected': partial.date,
+ 'picking_id': picking_id,
+ 'product_id': move.product_id.id,
+ 'product_qty': move.quantity,
+ 'product_uom': move.product_uom.id,
+ 'prodlot_id': move.prodlot_id.id,
+ 'name': product.name_get(cr, uid, [move.id])
+ }
+ stock_id = stock_obj.create(cr, uid, data, context=context)
+ pick_obj.write(cr, uid, pick.id, {'move_lines':[(4,stock_id)]})
+ cr.commit()
+ stock = stock_obj.browse(cr, uid, stock_id)
+ partial_datas['move%s' % (stock.id)] = {
+ 'product_id': stock.product_id.id,
+ 'product_qty': stock.product_qty,
+ 'product_uom': stock.product_uom.id,
+ 'prodlot_id': stock.prodlot_id.id,
+ }
+ if (picking_type == 'in') and (move.product_id.cost_method == 'average'):
+ partial_datas['move%s' % (stock.id)].update({
'product_price' : move.cost,
'product_currency': move.currency.id,
})
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp