我正在尝试在 Odoo 网站上显示日历请找到我的以下代码:
website_calendar_templates.xml
<template id="website_calendar_assets_frontend" inherit_id="website.assets_frontend" name="Calendar block assets">
<xpath expr="." position="inside">
<script type="text/javascript" src="/website_calendar/static/lib/date/js/date.js"></script>
<script type="text/javascript" src="/website_calendar/static/src/js/website_calendar_block.js"></script>
<script type="text/javascript" src="/website_calendar/static/lib/fullcalendar/js/fullcalendar.js"></script>
</xpath>
</template>
<template id="index" name="calendar">
<t t-call="website.layout">
<div id="wrap">
<div class="oe_structure"/>
<div class="container">
<div class="calendar">
</div></div><div class="oe_structure"/></div>
</t>
</template>
website_calendar_block.js
(function () {//odoo.define('website_calendar.website', function(require) {//"use strict";
'use strict';
var website = openerp.website;
var _t = openerp._t;
website.ready().then(function () { website.if_dom_contains('div.calendar', function ($el) { var $calendar = $el.find('.calendar');
}());
主要.py:
class WebsiteCalendarController(http.Controller):
@http.route(['/calendar'], type='http', auth="public", website=True)
def calendar(self ,page=1, **searches):
#return request.redirect("website_calendar.index",values)
return request.render('website_calendar.index', {'values': [""]})
我在顶部菜单中添加了日历。在我的网站页面中单击日历时,它会呈现页面,但不会在网站中显示日历,任何人都可以帮我解决它。