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

Theme tutorial v12 example raising an error on URL http://localhost:8071/services

<?xml version="1.0" encoding="utf-8" ?>
<odoo>

<!-- === Services Page === -->
<template id="services_page_template">
<t t-call="website.layout">
<div id="wrap">
<div class="container">
<h1>Our Services</h1>
<ul class="services">
<li>Cloud Hosting</li>
<li>Support</li>
<li>Unlimited space</li>
</ul>

<!-- === Snippets' area === -->
<div class="oe_structure" />
</div>
</div>
</t>
</template>
<record id="services_page" model="website.page">
<field name="name">Services page</field>
<field name="website_published">True</field>
<field name="url">/services</field>
<field name="view_id" ref="services_page_template"/>
</record>

</odoo>

Error:
node = et.find(exception.path.replace('/templates/t/', './'))
AttributeError: 'NoneType' object has no attribute 'replace' - - -



But when we create a menu it created sucessfully the menu .By using theme tutorial example code.
But when we clicks the menu: service in navigation bar It show internal error.

<record id="services_page_link" model="website.menu">
<field name="name">Services</field>
<field name="page_id" ref="services_page"/>
<field name="parent_id" ref="website.main_menu" />
<field name="sequence" type="int">99</field>
</record>

Same here also how to create a separate menu for multiple website via code.Any idea?
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất
You need to add the module name in ref="module_name.services_page_template" in that code. Thanks.
<record id="services_page" model="website.page">
<field name="name">Services page</field>
<field name="website_published">True</field>
<field name="url">/services</field>
<field name="view_id" ref="services_page_template"/>
</record>
like that.
<field name="view_id" ref="module_name.services_page_template"/>
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

You can create two separate web pages for the websites by giving the website id while creating the website page.

See the sample,

<record id="home_option_10_demo_page" model="website.page">
<field name="name">Home Option 10</field>
<field name="url">/home-option-10</field>
<field name="view_id" ref="alan_customize.Home_Option_10_view"/>
<field name="website_indexed">True</field>
<field name="website_published">True</field>
<field name="website_id" ref="website.default_website"/>
</record>


Thanks

Ảnh đại diện
Huỷ bỏ
Tác giả

After these changes also. Still facing the error template not found. Have u tried by clicking the URL it shows page?

Any examples further to proceed.

Error message:

None

Traceback (most recent call last):

File "/opt/odoo/12.0-LS/12.0/odoo/tools/cache.py", line 88, in lookup

r = d[key]

File "/opt/odoo/12.0-LS/12.0/odoo/tools/func.py", line 69, in wrapper

return func(self, *args, **kwargs)

File "/opt/odoo/12.0-LS/12.0/odoo/tools/lru.py", line 44, in __getitem__

a = self.d[obj].me

KeyError: ('ir.qweb', <function IrQWeb.compile at 0x7fb38f3c3400>, 4, ('en_US', True, None, None, False, 1))

Template not found

Template: 4

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 11 22
2261
3
thg 5 22
5418
1
thg 8 19
4280
1
thg 9 21
4940
1
thg 11 16
6274