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.

1

How to have data from product.template in product.product object

By
Kyle Connor
on 12/24/14, 6:50 PM 1,075 views

I am fairly new to OpenERP and don't have much experience as far as programming is concerned, so please bare with me.

I have a custom field in product.template which is a many2many field, tied to res.partner so it pulls up a list of customers in a form of checkboxes with the intention to indicate what customers buy what product.

Now, I am trying to have this data come up as a field in the Sales Order view when I click "search more" on the sales order line. I got the field to appear but there doesn't seem to be any data in it. The search window is using product.product.tree view in the sales order line which is obviously tied to the product.product object. So what seems to be happening is that my field is getting filled in on one spot (the product page), but the data doesn't go to the other. I have looked through the docs and I'm getting a bit confused. Seems like it should be a simple thing to ask for. So, to summarize, how do I make a field in the Product.Product Object which gets the same value as the Product.Template module?

1

deep

--deep--
1617
| 5 4 7
Bengaluru, India
--deep--

Techno-Functional Associate with 6+ years of experience in Odoo (formerly known as OpenERP).

deep
On 12/29/14, 5:13 AM

Product.product and Product.template are associate/compound object, One can access the field from template object just the way you access from the product object...

Example:

suppose you have product_id in your custom object,

then case.product_id.name_template [from product.product object]
like wise case.product_id.name [from product.template object]

So you can acces the columns just the way you acces from product object, most cases, the product and template will have same Database ID..

But if you feel you need a defined data to be fetch, then browse the template object by using foreign key present in the product object

 

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

2 follower(s)

Stats

Asked: 12/24/14, 6:50 PM
Seen: 1075 times
Last updated: 7/30/15, 5:17 AM