コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
4077 ビュー

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
6073
1
6月 24
3019
0
9月 22
803
1
1月 21
4141
1
1月 19
4655