Odoo Help

Welcome!

This community 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.

0

Show product default code in purchase order line

By
Jihen BEN ALI
on 9/4/15, 6:15 AM 260 views

Hi,

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):

_name='product.product'

_inherit='product.product'

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:

http://imgur.com/afLNQMS

How could I fix this problem

Help me please I need it.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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