Odoo Help

0

Show product default code in purchase order line

By
Jihen BEN ALI
on 9/4/15, 6:15 AM 533 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.

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.

Register

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)

Stats

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