Priyesh (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.0-opw-17894-pso into 
lp:openobject-addons/6.0.

Requested reviews:
  Raphael Collet (OpenERP) (rco-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-17894-pso/+merge/77873

Hello,

I have improved onchange_product_id method of BOM to fetch the correct name. 

To reproduce, follow the steps:
1. Click on New in BOM form
2. Select any product
3. Name will be automatically filled in.
4. Select other product rather than the previous one
5. Name will remain same. It will not change.

Thanks,
Priyesh
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-17894-pso/+merge/77873
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.0-opw-17894-pso.
=== modified file 'mrp/mrp.py'
--- mrp/mrp.py	2011-04-04 11:25:26 +0000
+++ mrp/mrp.py	2011-10-03 08:48:56 +0000
@@ -254,14 +254,11 @@
         if context is None:
             context = {}
             context['lang'] = self.pool.get('res.users').browse(cr,uid,uid).context_lang
-            
-        if product_id:
-            prod = self.pool.get('product.product').browse(cr, uid, product_id, context=context)
-            v = {'product_uom': prod.uom_id.id}
-            if not name:
-                v['name'] = prod.name
-            return {'value': v}
-        return {}
+        if not product_id:
+            return {'value': {'product_uom': False, 'name': False}}
+        prod = self.pool.get('product.product').browse(cr, uid, product_id, context=context)
+        result = {'product_uom': prod.uom_id.id, 'name': prod.name}
+        return {'value': result}
 
     def _bom_find(self, cr, uid, product_id, product_uom, properties=[]):
         """ Finds BoM for particular product and product uom.

_______________________________________________
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