Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
229 Lượt xem

Hello,

I am currently building a theme for a website that will be hosted on an Odoo instance that contains multiple websites. I want the ability for a page record to only be visible when a specific theme applied to it (Or limit it to website id). According to documentation online

I added

<field name="website_id" eval="1"/>

But the page disappears, even though I updated theme and even went as far as to drop and reinstall database. The issue still remains. I made sure to check the website_id is what is intended by checking the website metadata.

I tried another option I found online 

<field name="website_id" ref="website.default_website"/>

But that too doesn't work. I even created the custom ref for the other websites but still, the page remains hidden and cannot be seen on the page with the set field data. It can only be visible when I remove the website_id field.

Here is the full content

<record id="page_solutions" model="website.page">
<field name="name">Solutions</field>
<field name="type">qweb</field>
<field name="url">/solutions</field>

<field name="website_id" ref="website.default_website"/>

<field name="website_indexed" eval="True"/>
<field name="is_published">True</field>
<field name="key">theme_one.page_solutions</field>
<field name="arch" type="xml">
<t name="One Solutions Page" t-name="theme_one.page_solutions">
<t t-call="website.layout">
<section></section>
</t>
</t>
</field>
</record>


Any help or guidance on what to do? It would be preferable to be provided with an example of a non-default website.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 10 25
360
2
thg 10 25
428
1
thg 10 25
411
1
thg 9 25
354
3
thg 9 25
2079