Skip to Content
Menu
This question has been flagged
7 Replies
5953 Views

Hello Community,

I have created one product(test) with two variants(color:white,black) and added internal reference to test in product.template.

I added internal reference for all two variants. But the problem is it hides internal reference field and also remove its value from product.template(test).

I want to manage internal reference for all(test,test:white,test:black). How can I achieve this? I tried to inherit _compute_default_code and search_read() but it doesn't work out.

Any idea how to achieve this?

Thanks in advance.

Avatar
Discard

What is the purpose of the INTERNAL REFERENCE for the Template? Once you have Variants, the idea is that the product.template is no longer a product - it is just the place where all the common information for each variant is stored. You can't buy, sell or store a TEST, you can just buy, sell and store a TEST:WHITE and a TEST:BLACK.

Author

In my case i need "Internal Reference" for both Template product(Test) and Variant product (Test : black).

How have you added the internal reference? If you extend product.template, that field should also exist in product.product (as product.product inherits from product.template). And in theory the field should not disappear.

Otherwise, I would suggest to work around the issue by accessing the product.template via product.product_tmpl_id. Or do you need to change the internal reference?

Best Answer

Odoo 10 Community or Enterprise?

Avatar
Discard
Best Answer

The variants are saved in product.product not product.template, which is essentially a template (thus the name) from which variants are created. These are then saved as product.product. So, if you want to find your internal reference, search in product.product.

Avatar
Discard
Author

But i want internal reference for both product(product.template) and also for variants(product.product) too.

Do you have idea how to achieve this?

The only thing I can think of is to use the field product_tmpl_id of product.product to get the product.template it was created from. That way, you can obtain the product.template belonging to your product.product with the internal reference.

Nevertheless, could you clarify what the internal reference is for? To me it sounds like you might be trying to use product.template for something it is not intended for (which might hurt you in the long run).

Related Posts Replies Views Activity
1
Oct 23
770
0
Apr 20
1519
3
Jan 19
2338
1
Dec 17
1954
0
May 17
1993