Odoo Help

0

remove the product_id under product description

By
Jihen BEN ALI
on 9/3/15, 9:12 AM 661 views

Hi,

When creating a new purchase order I want to remove the product_name under the product_id so for that I had didi 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.


@jihen: didn't understand your question clearly what you trying to explain.. Do you want the product name should display only? in purchase order line right now its display name and product code to gather in description field. do you want name field there?

Anil R. Kesariya
on 9/3/15, 9:48 AM

Yes I want only the name in the description field.how can I do it??

Jihen BEN ALI
on 9/3/15, 9:58 AM

Hide product_id ? So it will not be there ? ?

Dr Obx
on 9/3/15, 10:44 AM

Hide it ine the description field because in this field it display the product_id and the name

Jihen BEN ALI
on 9/3/15, 10:59 AM

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 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/3/15, 9:12 AM
Seen: 661 times
Last updated: 9/4/15, 5:21 AM