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

How to remove internal reference from product description

By
Chirag
on 7/7/15, 3:34 PM 838 views

Is there a way of removing the internal reference shown in product descriptions? So just to display product name and not the internal reference?

1

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
4341
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 7/8/15, 7:42 AM

Chirag,

Technically, its name_get() method you have to override().

Thanks.

0
Geoff Kimpton
On 9/11/15, 10:59 AM

Did you want to remove the internal reference shown in individual product descriptions?  If so it is the "Internal Reference" box shown below.  Highlight text > Delete > Save.

If you want to remove the actual field then sorry, I dont know.


0

Ankit H Gandhi(AHG)

--Ankit H Gandhi(AHG)--
996
| 5 3 6
Rajkot, India
--Ankit H Gandhi(AHG)--

Learning Python..

Ankit H Gandhi(AHG)
On 7/26/15, 7:25 AM

Dear Chirag,

Yes, @Serpent Consulting Services is right you need to override the name_get method like this 

class product_product(osv.Model):

        _inherit = 'product.product'

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

            res = []

            if context is None:

                context = {}

            if isinstance(ids, (int, long)):

                ids = [ids]

            if not len(ids):

                return []

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

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

            return res

Hope this code may be help full

Regards,

Ankit H Gandhi

0
Chirag
On 7/8/15, 5:08 PM

How do I go about doing that?

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: 7/7/15, 3:34 PM
Seen: 838 times
Last updated: 9/11/15, 10:59 AM