Amit Parik (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-945208-amp into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #945208 in OpenERP Addons: "stock_move: onchange_product_id must reset 
prodlot_id"
  https://bugs.launchpad.net/openobject-addons/+bug/945208

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-945208-amp/+merge/101168

Hello,

on_change_product_id must reset prodlot_id on stock_move and inventory line.

For problem please do following steps.

1) create stock move with production lot, change the product the production lot 
will not removed it should be remove.

2) Create a inventory line production lot remove the product, production lot 
will not removed it should be remove.

2) Create a inventory line production lot change the product, production lot 
will not removed it should be remove.

This fix will solve this problem.

Thanks!

-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-945208-amp/+merge/101168
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-945208-amp.
=== modified file 'stock/stock.py'
--- stock/stock.py	2012-04-03 13:52:37 +0000
+++ stock/stock.py	2012-04-07 09:51:20 +0000
@@ -1862,7 +1862,8 @@
             'product_uom': product.uom_id.id,
             'product_uos': uos_id,
             'product_qty': 1.00,
-            'product_uos_qty' : self.pool.get('stock.move').onchange_quantity(cr, uid, ids, prod_id, 1.00, product.uom_id.id, uos_id)['value']['product_uos_qty']
+            'product_uos_qty' : self.pool.get('stock.move').onchange_quantity(cr, uid, ids, prod_id, 1.00, product.uom_id.id, uos_id)['value']['product_uos_qty'],
+            'prodlot_id' : False,
         }
         if not ids:
             result['name'] = product.partner_ref
@@ -2793,11 +2794,11 @@
         @return:  Dictionary of changed values
         """
         if not product:
-            return {'value': {'product_qty': 0.0, 'product_uom': False}}
+            return {'value': {'product_qty': 0.0, 'product_uom': False, 'prod_lot_id': False}}
         obj_product = self.pool.get('product.product').browse(cr, uid, product)
         uom = uom or obj_product.uom_id.id
         amount = self.pool.get('stock.location')._product_get(cr, uid, location_id, [product], {'uom': uom, 'to_date': to_date, 'compute_child': False})[product]
-        result = {'product_qty': amount, 'product_uom': uom}
+        result = {'product_qty': amount, 'product_uom': uom, 'prod_lot_id': False}
         return {'value': result}
 
 stock_inventory_line()

_______________________________________________
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

Reply via email to