Review: Needs Fixing

please improve the code,

29      + product = self.pool.get('product.product')
30      + uom_obj = self.pool.get('product.uom')
31      + product_uom1 = product.browse(cr, uid, ids)[0]
32      + category_1 = uom_obj.browse(cr, uid, 
product_uom1.uom_id.id).category_id

you are in product class, can't you simply do it by self instead of 
self.pool.get(..)?
you don't need to use uom_obj,
product_uom1.uom_id.category_id will give you the category, 
also make sure to use proper variable name, product_uom1 doesn't suits for 
browse record for product,
simplify the other code please,

thanks
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-707287-aag/+merge/80213
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-707287-aag.

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : openerp-dev-gtk@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to