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

In the form of the "product" module, I need to add the fields for translations of this name into other languages, in my case into German, English, and Ukrainian, below the name field.

I tried to do this using

t-esc="product.with_context({'lang': 'de_DE'}).name"

but it didn't help me at all


this is the code in which the name field is located

label class="oe_edit_only" for="name" string="Product Name"
h1>name="name" placeholder="Product Name"/>



아바타
취소
베스트 답변

Yeah, you could do it by creating several computed fields to be able to handle the name translations per lang. One field per lang and implement the compute​ and inverse​ methods of the field to retrieve and save the translation values directly into the ir_translation​ table

아바타
취소
베스트 답변

It's easier than that. 

Just install all the languages you want to use in Odoo. 

Close to the product name will appear the code of the current language. By clicking on it, you will see all translations and you can change them.


아바타
취소
작성자

I know it, but the customer wants to see these fields under the name, not in a separate widget(

베스트 답변

Hi,

You can add a new field(s) and show translated values in it. Make the new field as a computed field, which computes the translated value from the saved translation.

While doing the compute you can pass the lang in context.

Thanks

아바타
취소
작성자

Hi, can you show me an example of how to do this?
Thank you

관련 게시물 답글 화면 활동
0
8월 21
2272
1
7월 19
3510
0
7월 24
2026
0
11월 21
1640
0
7월 21
2228