Odoo的Qweb报表模板 - xiaohao0576/odoo-doc GitHub Wiki
https://github.com/odoo/odoo/blob/18.0/addons/web/views/report_templates.xml#L6
web.report_layout
web.html_container
web.basic_layout
web.basic_layout
引用了web.html_container
, web.html_container
又引用了web.report_layout
,所以如果需要自定义简单的报表,只需要引用web.basic_layout
就可以了
<template id="basic_layout">
<t t-call="web.html_container">
<t t-if="not o" t-set="o" t-value="doc"/>
<div class="article" t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id" t-att-data-oe-lang="o and o.env.context.get('lang')">
<t t-out="0"/>
</div>
</t>
</template>
<template id="html_container">
<t t-set="body_classname" t-value="'container'"/>
<t t-call="web.report_layout">
<t t-out="0"/>
</t>
</template>
<template id="report_layout" name="Report layout"><!DOCTYPE html>
<html t-att-lang="lang and lang.replace('_', '-')"
t-att-data-report-margin-top="data_report_margin_top"
t-att-data-report-header-spacing="data_report_header_spacing"
t-att-data-report-dpi="data_report_dpi"
t-att-data-report-landscape="data_report_landscape"
t-att-web-base-url="web_base_url">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="initial-scale=1"/>
<title><t t-esc="title or 'Odoo Report'"/></title>
<t t-call-assets="web.report_assets_common"/>
<!-- Temporary code: only used to maintain CSS for legacy HTML reports (full width...) -->
<!-- Should be removed once the reports are fully converted. -->
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', () => {
if (window.self !== window.top) {
document.body.classList.add("o_in_iframe", "container-fluid");
document.body.classList.remove("container");
}
});
</script>
</head>
<body t-attf-class="o_body_html {{'container' if not full_width else 'container-fluid'}} overflow-x-hidden" t-att-dir="env['res.lang']._get_data(code=lang or env.user.lang).direction or 'ltr'">
<div id="wrapwrap">
<main>
<t t-out="0"/>
</main>
</div>
</body>
</html>
</template>