콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
7 답글
6928 화면

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.

아바타
취소

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.

작성자

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?

베스트 답변

Odoo 10 Community or Enterprise?

아바타
취소
베스트 답변

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.

아바타
취소
작성자

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).

관련 게시물 답글 화면 활동
1
10월 23
1955
0
4월 20
2557
3
1월 19
3051
1
12월 17
2892
0
5월 17
2630