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

In odoo12 I want to create a view that only changes something for website 1 and not website 2.

In odoo backend its very simple with the website_id field. But how do I write that in my own module?

Example:

<template id = "test" name="test" inherit_id="test.test_view" priority="16" website_id="1">
<xpath  expr=.....
.... </xpath>
</template>

Doesn't work. What is the right way to create a view that only applies to one specific website and not any other one?

아바타
취소
베스트 답변

Try something like:

<template id = "test" name="test" inherit_id="test.test_view" priority="16">
<t t-if="website.id == 1">
<!-- Content for the first website-->
</t>
<t t-if="website.id == 2">
<!-- Content for the second website-->
</t>
</template>
아바타
취소
작성자 베스트 답변

Tried it and it works.

Thank you!

아바타
취소

you are welcome. please accept the answer then

관련 게시물 답글 화면 활동
2
7월 25
6155
1
6월 24
3043
0
9월 22
803
1
1월 21
4179
1
1월 19
4717