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?
Yes I want only the name in the description field.how can I do it??
Hide product_id ? So it will not be there ? ?
Hide it ine the description field because in this field it display the product_id and the name