Odoo Help


Show product default code in purchase order line

on 9/4/15, 6:15 AM 639 views


When creating a new purchase order I want to remove the product_name under the product_id so for that I did this function:

class snc_product(osv.osv):



def name_get(self, cr, uid, ids, context=None):

return_val = super(snc_product, self).name_get(cr, uid, ids, context=context)

res = []

def _name_get(d):

code = d.get('code','')

if d.get('variants'):

code = code + ' - %s' % (d['variants'],)

return (d['id'], code)

for product in self.browse(cr, uid, ids, context=context):

res.append((product.id, (product.code)))

return res or return_val

The problem now is even under description I'm getting the default_code instead of the name as shown in this image:


How could I fix this problem

Help me please I need it.

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 9/4/15, 6:15 AM
Seen: 639 times
Last updated: 9/4/15, 6:15 AM