Initial commit: Core packages

This commit is contained in:
Ernad Husremovic 2025-08-29 15:20:45 +02:00
commit 12c29a983b
9512 changed files with 8379910 additions and 0 deletions

View file

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_base_document_layout" model="ir.ui.view">
<field name="name">Document Layout</field>
<field name="model">base.document.layout</field>
<field name="arch" type="xml">
<form class="o_document_layout">
<group>
<group class="o_document_layout_company">
<field name="company_id" invisible="1"/>
<field name="external_report_layout_id" invisible="1" />
<field name="logo_primary_color" invisible="1" />
<field name="logo_secondary_color" invisible="1" />
<field name="report_layout_id" widget="radio" string="Layout" required="1"/>
<field name="font" widget="selection" required="1"/>
<field name="logo" widget="image" options="{'size': [0, 50]}"/>
<label for="primary_color" string="Colors" />
<div class="o_document_layout_colors">
<field name="primary_color" widget="color"/>
<field name="secondary_color" widget="color"/>
<div class="o_custom_colors" title="Reset to logo colors"
attrs="{'invisible': [('custom_colors', '=', False)]}">
<span class="fa fa-refresh fa-2x"></span>
<field name="custom_colors" nolabel="1"/>
</div>
</div>
<field name="layout_background" widget="selection" required="1"/>
<field name="layout_background_image" options="{'accepted_file_extensions': 'image/*'}" attrs="{'invisible': [('layout_background', '!=', 'Custom')], 'required': [('layout_background', '=', 'Custom')]}">Upload your file</field>
<field name="report_header" placeholder="e.g. Global Business Solutions" options="{'resizable': false}"/>
<field name="company_details" string="Company Details" options="{'resizable': false}"/>
<field name="report_footer" string="Footer" options="{'resizable': false}"/>
<field name="paperformat_id" widget="selection" required="1" domain="[('report_ids', '=', False)]"/>
</group>
<div>
<field name="preview" widget="iframe_wrapper" />
<button name="web.action_report_layout_preview" string="Download PDF Preview" type="action" class="oe_link" icon="fa-arrow-right"/>
</div>
</group>
<footer>
<button string="Save" class="btn-primary" type="object" name="document_layout_save" data-hotkey="q"/>
<button special="cancel" data-hotkey="z" string="Cancel" />
</footer>
</form>
</field>
</record>
<record id="action_base_document_layout_configurator" model="ir.actions.act_window">
<field name="type">ir.actions.act_window</field>
<field name="name">Configure your document layout</field>
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="res_model">base.document.layout</field>
<field name="view_id" ref="web.view_base_document_layout"/>
</record>
</data>
</odoo>

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="assets_backend_legacy_lazy" name="Lazy assets for legacy Views" groups="base.group_user">
<t t-call-assets="web.assets_backend_legacy_lazy" />
</template>
</odoo>

View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="web.neutralize_banner" name="Neutralize Banner" inherit_id="web.layout" active="False">
<xpath expr="//body" position="inside">
<div>
<span id="oe_neutralize_banner" t-attf-style="
text-align: center;
color: #FFFFFF;
background-color: #D0442C;
position: relative;
display: block;
font-size: 16px;
{{ neutralize_banner_style or '' }}">
<t t-out="neutralize_banner_text">This database is neutralized.</t>
</span>
</div>
</xpath>
<xpath expr="//head">
<meta name="robots" content="noindex, nofollow" />
</xpath>
</template>
</odoo>

View file

@ -0,0 +1,751 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Private templates used internally by reports -->
<template id="report_layout" name="Report layout">&lt;!DOCTYPE html&gt;
<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" t-js="false"/>
<!--The following is kind of a hack-->
<!--in an iframe, we don't want the session to perform qweb_templates rpc-->
<script type="text/javascript">
window.odoo = {};
window.odoo.__session_info__ = {is_report: true};
</script>
<t t-call-assets="web.assets_common" t-css="false"/>
<t t-call-assets="web.report_assets_common" t-css="false"/>
</head>
<body t-att-class="'container' if not full_width else 'container-fluid'" t-att-dir="env['res.lang']._lang_get(lang or env.user.lang).direction or 'ltr'">
<div id="wrapwrap">
<main>
<t t-out="0"/>
</main>
</div>
</body>
</html>
</template>
<template id="report_preview_layout" name="Report layout">&lt;!DOCTYPE html&gt;
<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" t-js="false"/>
<t t-call-assets="web.assets_common" t-css="false"/>
<style>
<t t-out="preview_css"/>
/**
Some css is overridden as it doesn't work properly in the preview.
Before generating 'real' reports, a lot of processing is applied. It is therefore quite
complicated to have an almost exact replica of the pdf report.
This changes down here are hacks to make the preview look as good as possible.
**/
/** The footers are not at the bottom of the page, so we push them down. **/
.o_background_footer, .o_standard_footer, .o_boxed_footer, .o_clean_footer {
position: absolute;
bottom: 0;
left:50px;
right:50px;
font-size: 0.8rem
}
/** Avoid image overflowing and creating a scrollbar **/
.o_background_header {
min-width: initial !important;
}
/** This rule is overridden in web/report.scss to hack around whtml2pdf
Simply set it to its default value so it works properly in preview **/
.col-auto{
-webkit-box-flex: 0 !important;
-webkit-flex: 0 0 auto !important;
flex: 0 0 auto !important;
width: auto !important;
max-width: 100% !important;
}
</style>
</head>
<body t-att-class="'container' if not full_width else 'container-fluid'" style="overflow:hidden" t-att-dir="env['res.lang']._lang_get(lang or env.user.lang).direction or 'ltr'">
<div id="wrapwrap">
<t t-out="0"/>
</div>
</body>
</html>
</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="html_preview_container">
<t t-set="body_classname" t-value="'container'"/>
<t t-call="web.report_preview_layout">
<t t-out="0"/>
</t>
</template>
<template id="report_invoice_wizard_preview">
<t t-call="web.html_preview_container">
<t t-call="web.external_layout">
<t t-set="address">
<address class="mb-0" itemscope="itemscope"
itemtype="http://schema.org/Organization">
<div>
<span itemprop="name">Deco Addict</span>
</div>
<div itemprop="address" itemscope="itemscope"
itemtype="http://schema.org/PostalAddress">
<div class="d-flex align-items-baseline">
<span class="w-100 o_force_ltr" itemprop="streetAddress">77 Santa Barbara
Rd<br/>Pleasant Hill CA 94523<br/>United States</span>
</div>
</div>
</address>
</t>
<div class="page mt-5">
<h2>
<span>Invoice</span>
<span>INV/2023/00003</span>
</h2>
<div id="informations" class="row mt-4 mb-4">
<div class="col-auto col-3 mw-100 mb-2" name="invoice_date">
<strong>Invoice Date:</strong>
<p class="m-0">07/08/2020</p>
</div>
<div class="col-auto col-3 mw-100 mb-2" name="due_date">
<strong>Due Date:</strong>
<p class="m-0">08/07/2020</p>
</div>
</div>
<table class="table table-sm o_main_table table-borderless" name="invoice_line_table">
<thead>
<tr>
<th name="th_description" class="text-start"><span>Description</span></th>
<th name="th_quantity" class="text-end"><span>Quantity</span></th>
<th name="th_priceunit" class="text-end d-md-table-cell"><span>Unit Price</span></th>
<th name="th_taxes" class="text-start d-md-table-cell"><span>Taxes</span></th>
<th name="th_subtotal" class="text-end">
<span>Amount</span>
</th>
</tr>
</thead>
<tbody class="invoice_tbody">
<tr>
<td name="account_invoice_line_name"><span>[FURN_8999] Three-Seat Sofa<br/>
Three Seater Sofa with Lounger in Steel Grey Colour</span></td>
<td class="text-end">
<span>5.00</span>
</td>
<td class="text-end d-md-table-cell">
<span class="text-nowrap">1,500.00</span>
</td>
<td class="text-start d-md-table-cell">
<span id="line_tax_ids">Tax 15%</span>
</td>
<td class="text-end o_price_total">
<span class="text-nowrap">$ <span class="oe_currency_value">7,500.00</span></span>
</td>
</tr>
<tr>
<td name="account_invoice_line_name"><span>[FURN_8220] Four Person Desk<br/>
Four person modern office workstation</span></td>
<td class="text-end">
<span>5.00</span>
</td>
<td class="text-end d-md-table-cell">
<span class="text-nowrap">2,350.00</span>
</td>
<td class="text-start d-md-table-cell">
<span id="line_tax_ids">Tax 15%</span>
</td>
<td class="text-end o_price_total">
<span class="text-nowrap">$ <span class="oe_currency_value">11,750.00</span></span>
</td>
</tr>
</tbody>
</table>
<div class="clearfix">
<div id="total" class="row">
<div class="col-6 ms-auto">
<table class="table table-sm table-borderless" style="page-break-inside: avoid; position:relative;">
<tbody><tr class="border-black o_subtotal" style="">
<td><strong>Untaxed Amount</strong></td>
<td class="text-end">
<span>$ <span class="oe_currency_value">19,250.00</span></span>
</td>
</tr>
<tr style="">
<td><span class="text-nowrap">Tax 15%</span></td>
<td class="text-end o_price_total">
<span class="text-nowrap">$ 2,887.50</span>
</td>
</tr>
<tr class="border-black o_total">
<td><strong>Total</strong></td>
<td class="text-end">
<span class="text-nowrap">$ <span class="oe_currency_value">
22,137.50</span></span>
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<p class="mt-4">
Please use the following communication for your payment : <b><span>
INV/2023/00003</span></b>
</p>
<p name="payment_term">
<span>Payment terms: 30 Days</span>
</p>
</div>
</t>
</t>
</template>
<template id="minimal_layout">
&lt;!DOCTYPE html&gt;
<html style="height: 0;">
<head>
<base t-att-href="base_url"/>
<t t-call-assets="web.report_assets_pdf" t-js="false"/>
<t t-call-assets="web.report_assets_common" t-js="false"/>
<t t-call-assets="web.report_assets_pdf" t-css="false"/>
<meta charset="utf-8"/>
<script t-if="subst">
function subst() {
var vars = {};
var x = document.location.search.substring(1).split('&amp;');
for (var i in x) {
var z = x[i].split('=', 2);
vars[z[0]] = unescape(z[1]);
}
var x = ['sitepage', 'sitepages', 'section', 'subsection', 'subsubsection'];
var z = {'sitepage': 'page', 'sitepages': 'topage'};
for (var i in x) {
var y = document.getElementsByClassName(z[x[i]] || x[i])
for (var j=0; j&lt;y.length; ++j)
y[j].textContent = vars[x[i]];
}
var index = vars['webpage'].split('.', 4)[3];
var header = document.getElementById('minimal_layout_report_headers');
if(header){
var companyHeader = header.children[index];
header.textContent = '';
header.appendChild(companyHeader);
}
var footer = document.getElementById('minimal_layout_report_footers');
if(footer){
var companyFooter = footer.children[index];
footer.textContent = '';
footer.appendChild(companyFooter);
}
}
</script>
</head>
<body class="container" t-att-data-report-id="report_xml_id" t-att-onload="subst and 'subst()'" style="overflow:hidden" t-att-dir="env['res.lang']._lang_get(lang or env.user.lang).direction or 'ltr'">
<t t-out="body"/>
</body>
</html>
</template>
<!-- External layouts styles -->
<template id="address_layout">
<t t-set="colclass" t-value="('col-sm-5' if report_type == 'html' else 'col-5') + ' ms-auto'"/>
<t t-if="address">
<div class="address row">
<t t-if="information_block">
<t t-set="colclass" t-value="'col-5 offset-1'"/>
<div name="information_block" class="col-6">
<t t-out="information_block"/>
</div>
</t>
<div name="address" t-att-class="colclass">
<t t-esc="address"/>
</div>
</div>
</t>
</template>
<template id="external_layout_striped">
<div t-attf-class="o_company_#{company.id}_layout header" t-att-style="report_header_style">
<div class="o_background_header">
<div class="float-end">
<div class="mt0 text-end h3" t-field="company.report_header"/>
</div>
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" class="float-start" alt="Logo"/>
<div class="float-start company_address">
<ul class="list-unstyled">
<li t-if="company.is_company_details_empty"><t t-esc="company.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/></li>
<li t-else=""><t t-esc="company.company_details"/></li>
<li t-if="forced_vat">
<t t-esc="company.country_id.vat_label or 'Tax ID'"/>:
<span t-esc="forced_vat"/>
</li>
</ul>
</div>
<div class="clearfix mb8"/>
</div>
</div>
<t t-set="layout_background_url"
t-value="'data:image/png;base64,%s' % company.layout_background_image.decode('utf-8') if company.layout_background_image and company.layout_background == 'Custom' else '/base/static/img/bg_background_template.jpg' if company.layout_background == 'Geometric' else ''" />
<div t-attf-class="o_company_#{company.id}_layout article o_report_layout_striped {{ 'o_report_layout_background' if company.layout_background in ['Geometric', 'Custom'] else '' }}" t-attf-style="{{ 'background-image: url(%s);' % layout_background_url if layout_background_url else '' }}" 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-call="web.address_layout"/>
<t t-out="0"/>
</div>
<div t-attf-class="o_company_#{company.id}_layout footer o_background_footer">
<div class="text-center">
<ul class="list-inline">
<div t-field="company.report_footer"/>
</ul>
<div t-if="report_type == 'pdf'" class="text-muted">
Page:
<span class="page"/>
of
<span class="topage"/>
</div>
<div t-if="report_type == 'pdf' and display_name_in_footer" class="text-muted">
<span t-field="o.name"/>
</div>
</div>
</div>
</template>
<template id="external_layout_boxed">
<div t-attf-class="header o_company_#{company.id}_layout" t-att-style="report_header_style">
<div class="o_boxed_header">
<div class="row mb8">
<div class="col-6">
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" alt="Logo"/>
</div>
<div class="col-6 text-end mb4">
<t t-if="company.report_header and company.report_header.strip() != '&lt;p&gt;&lt;br&gt;&lt;/p&gt;'">
<div class="mt0 h4" t-field="company.report_header"/>
</t>
<div name="company_address" class="float-end mb4">
<ul class="list-unstyled">
<li t-if="company.is_company_details_empty"><t t-esc="company.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/></li>
<li t-else=""><t t-esc="company.company_details"/></li>
<li t-if="forced_vat">
<t t-esc="company.country_id.vat_label or 'Tax ID'"/>:
<span t-esc="forced_vat"/>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<t t-set="layout_background_url"
t-value="'data:image/png;base64,%s' % company.layout_background_image.decode('utf-8') if company.layout_background_image and company.layout_background == 'Custom' else '/base/static/img/bg_background_template.jpg' if company.layout_background == 'Geometric' else ''" />
<div t-attf-class="article o_report_layout_boxed o_company_#{company.id}_layout {{ 'o_report_layout_background' if company.layout_background in ['Geometric', 'Custom'] else '' }}" t-attf-style="{{ 'background-image: url(%s);' % layout_background_url if layout_background_url else '' }}" 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')">
<div class="pt-5">
<!-- This div ensures that the address is not cropped by the header. -->
<t t-call="web.address_layout"/>
</div>
<t t-out="0"/>
</div>
<div t-attf-class="footer o_boxed_footer o_company_#{company.id}_layout">
<div class="text-center">
<div t-field="company.report_footer"/>
<div t-if="report_type == 'pdf'">
Page: <span class="page"/> / <span class="topage"/>
</div>
<div t-if="report_type == 'pdf' and display_name_in_footer" class="text-muted">
<span t-field="o.name"/>
</div>
</div>
</div>
</template>
<template id="external_layout_bold">
<div t-attf-class="header o_company_#{company.id}_layout" t-att-style="report_header_style">
<div class="o_clean_header">
<div class="row">
<div class="col-6">
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" alt="Logo"/>
</div>
<div class="col-5 offset-1" name="company_address">
<ul class="list-unstyled">
<li t-if="company.is_company_details_empty"><t t-esc="company.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/></li>
<li t-else=""><t t-esc="company.company_details"/></li>
<li t-if="forced_vat">
<t t-esc="company.country_id.vat_label or 'Tax ID'"/>:
<span t-esc="forced_vat"/>
</li>
</ul>
</div>
</div>
</div>
</div>
<t t-set="layout_background_url"
t-value="'data:image/png;base64,%s' % company.layout_background_image.decode('utf-8') if company.layout_background_image and company.layout_background == 'Custom' else '/base/static/img/bg_background_template.jpg' if company.layout_background == 'Geometric' else ''" />
<div t-attf-class="article o_report_layout_bold o_company_#{company.id}_layout {{ 'o_report_layout_background' if company.layout_background in ['Geometric', 'Custom'] else '' }}" t-attf-style="{{ 'background-image: url(%s);' % layout_background_url if layout_background_url else '' }}" 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-call="web.address_layout"/>
<t t-out="0"/>
</div>
<div t-attf-class="footer o_clean_footer o_company_#{company.id}_layout">
<div class="row">
<div class="col-4">
<span t-field="company.report_footer"/>
</div>
<div class="col-4">
<span t-if="company.is_company_details_empty" t-field="company.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/>
<span t-else="" t-field="company.company_details"/>
</div>
<div class="col-3">
<div class="mt0 mb0 h5" t-field="company.report_header"/>
</div>
<div class="col-1">
<ul t-if="report_type == 'pdf'" class="list-inline pagenumber float-end text-center">
<li class="list-inline-item"><strong><span class="page"/></strong></li>
</ul>
</div>
</div>
</div>
</template>
<template id="external_layout_standard">
<div t-attf-class="header o_company_#{company.id}_layout" t-att-style="report_header_style">
<div class="row">
<div class="col-3 mb4">
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" style="max-height: 45px;" alt="Logo"/>
</div>
<div class="col-9 text-end" style="margin-top:22px;" t-field="company.report_header" name="moto"/>
</div>
<div t-if="company.logo or company.report_header" class="row zero_min_height">
<div class="col-12">
<div style="border-bottom: 1px solid black;"/>
</div>
</div>
<div class="row">
<div class="col-6" name="company_address">
<ul class="list-unstyled">
<li t-if="company.is_company_details_empty"><t t-esc="company.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/></li>
<li t-else=""><t t-esc="company.company_details"/></li>
<li t-if="forced_vat">
<t t-esc="company.country_id.vat_label or 'Tax ID'"/>:
<span t-esc="forced_vat"/>
</li>
</ul>
</div>
</div>
</div>
<t t-set="layout_background_url"
t-value="'data:image/png;base64,%s' % company.layout_background_image.decode('utf-8') if company.layout_background_image and company.layout_background == 'Custom' else '/base/static/img/bg_background_template.jpg' if company.layout_background == 'Geometric' else ''" />
<div t-attf-class="article o_report_layout_standard o_company_#{company.id}_layout {{ 'o_report_layout_background' if company.layout_background in ['Geometric', 'Custom'] else '' }}" t-attf-style="{{ 'background-image: url(%s);' % layout_background_url if layout_background_url else '' }}" 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')">
<div class="pt-5">
<!-- This div ensures that the address is not cropped by the header. -->
<t t-call="web.address_layout"/>
</div>
<t t-out="0"/>
</div>
<div t-attf-class="footer o_standard_footer o_company_#{company.id}_layout">
<div class="text-center" style="border-top: 1px solid black;">
<ul class="list-inline mb4">
<div t-field="company.report_footer"/>
</ul>
<div t-if="report_type == 'pdf'" class="text-muted">
Page: <span class="page"/> / <span class="topage"/>
</div>
<div t-if="report_type == 'pdf' and display_name_in_footer" class="text-muted">
<span t-field="o.name"/>
</div>
</div>
</div>
</template>
<!-- Public api: layout to t-call from reports -->
<template id="external_layout">
<t t-if="not o" t-set="o" t-value="doc"/>
<t t-if="not company">
<!-- Multicompany -->
<t t-if="company_id">
<t t-set="company" t-value="company_id"/>
</t>
<t t-elif="o and 'company_id' in o and o.company_id.sudo()">
<t t-set="company" t-value="o.company_id.sudo()"/>
</t>
<t t-else="else">
<t t-set="company" t-value="res_company"/>
</t>
</t>
<t t-if="company.external_report_layout_id" t-call="{{company.external_report_layout_id.sudo().key}}"><t t-out="0"/></t>
<t t-else="else" t-call="web.external_layout_standard"><t t-out="0"/></t>
</template>
<template id="internal_layout">
<t t-if="not o" t-set="o" t-value="doc"/>
<t t-if="not company">
<!-- Multicompany -->
<t t-if="company_id">
<t t-set="company" t-value="company_id"/>
</t>
<t t-elif="o and 'company_id' in o and o.company_id.sudo()">
<t t-set="company" t-value="o.company_id.sudo()"/>
</t>
<t t-else="else">
<t t-set="company" t-value="res_company"/>
</t>
</t>
<div class="header">
<div class="row">
<div class="col-3">
<span t-esc="context_timestamp(datetime.datetime.now()).strftime('%Y-%m-%d %H:%M')"/>
</div>
<div class="col-2 offset-2 text-center">
<span t-esc="company.name"/>
</div>
<div class="col-2 offset-3 text-end">
<ul class="list-inline">
<li class="list-inline-item"><span class="page"/></li>
<li class="list-inline-item">/</li>
<li class="list-inline-item"><span class="topage"/></li>
</ul>
</div>
</div>
</div>
<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>
</template>
<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>
<!-- Customize the company form view by adding paperformat field as well as demo reports -->
<!-- Demo reports definition -->
<template id="preview_internalreport">
<t t-set="company" t-value="env.company"/>
<t t-call="web.html_container">
<t t-set="o" t-value="res_company"/>
<t t-call="web.internal_layout">
<div class="page">
<p>This is a sample of an internal report.</p>
</div>
</t>
</t>
</template>
<template id="preview_externalreport">
<t t-set="company" t-value="env.company"/>
<t t-call="web.html_container">
<t t-set="o" t-value="res_company"/>
<t t-call="web.external_layout">
<div class="page">
<p>This is a sample of an external report.</p>
</div>
</t>
</t>
</template>
<template id="preview_layout_report">
<t t-set="company" t-value="env.company"/>
<t t-call="web.html_container">
<t t-set="o" t-value="res_company"/>
<t t-call="web.report_invoice_wizard_preview"/>
</t>
</template>
<template id="styles_company_report">
<t t-foreach="company_ids" t-as="company" t-translation="off">
<t t-set="forced_vat" t-value="False"/>
<t t-set="font" t-value="company.font or 'Lato'" />
<t t-set="primary" t-value="company.primary_color or 'black'" />
<t t-set="secondary" t-value="company.secondary_color or 'black'" />
<t t-set="layout" t-value="company.external_report_layout_id.key or 'web.external_layout_standard'" />
.o_company_<t t-esc='company.id'/>_layout {
font-family: <t t-esc="font" />;
<t t-if="layout == 'web.external_layout_striped'">
&amp;.o_report_layout_striped {
strong {
color: <t t-esc='secondary'/>;
}
h2 {
color: <t t-esc='primary'/>;
}
thead tr th {
color: <t t-esc='secondary'/>;
}
}
.row > div > table,
div#total table {
&amp;:first-child,
&amp;:last-child,
&amp;.o_subtotal,
&amp;.o_total {
strong {
color: <t t-esc='primary'/>;
}
}
}
</t>
<t t-elif="layout == 'web.external_layout_boxed'">
&amp;.o_report_layout_boxed {
#total strong {
color: <t t-esc='primary'/>;
}
#informations strong {
color: <t t-esc='secondary'/>;
}
h2 span {
color: <t t-esc='primary'/>;
}
table {
thead {
tr th {
color: <t t-esc='secondary'/>;
}
}
tbody tr td {
&amp;.o_line_section td {
background-color: rgba(<t t-esc='primary'/>, 0.7);
}
&amp;.is-subtotal,
td.o_price_total {
background-color: rgba(<t t-esc='secondary'/>, 0.1);
}
}
}
}
.row > div > table,
div#total table {
tr {
&amp;.o_total td {
background-color: rgba(<t t-esc='primary'/>, 0.9);
}
}
}
</t>
<t t-elif="layout == 'web.external_layout_bold'" >
&amp;.o_clean_footer {
border-top: 3px solid <t t-esc='secondary'/>;
h4 {
color: <t t-esc='secondary'/>;
}
.pagenumber {
border: 3px solid <t t-esc='primary'/>;
background-color: <t t-esc='secondary'/>;
}
}
&amp;.o_report_layout_bold {
h1, h2, h3 {
color: <t t-esc='primary'/>;
}
strong {
color: <t t-esc='secondary'/>;
}
table {
thead {
color: <t t-esc='secondary'/>;
tr th {
border-top: 3px solid <t t-esc='secondary'/> !important;
}
}
tbody {
tr:last-child td {
border-bottom: 3px solid <t t-esc='secondary'/>;
}
}
}
#total {
strong {
color: <t t-esc='secondary'/>;
}
}
}
</t>
<t t-elif="layout == 'web.external_layout_standard'">
&amp;.o_report_layout_standard {
h2 {
color: <t t-esc='primary'/>;
}
#informations strong {
color: <t t-esc='secondary'/>;
}
#total strong{
color: <t t-esc='primary'/>;
}
table {
thead {
color: <t t-esc='secondary'/>;
}
}
}
</t>
}
</t>
</template>
<record id="action_report_internalpreview" model="ir.actions.report">
<field name="name">Preview Internal Report</field>
<field name="model">res.company</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">web.preview_internalreport</field>
<field name="report_file">web.preview_internalreport</field>
<field name="binding_model_id" ref="model_res_company"/>
<field name="binding_type">report</field>
</record>
<record id="action_report_externalpreview" model="ir.actions.report">
<field name="name">Preview External Report</field>
<field name="model">res.company</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">web.preview_externalreport</field>
<field name="report_file">web.preview_externalreport</field>
<field name="binding_model_id" ref="model_res_company"/>
<field name="binding_type">report</field>
</record>
<record id="action_report_layout_preview" model="ir.actions.report">
<field name="name">Report Layout Preview</field>
<field name="model">res.company</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">web.preview_layout_report</field>
<field name="report_file">web.preview_layout_report</field>
<field name="binding_model_id" ref="model_res_company"/>
<field name="binding_type">report</field>
</record>
</odoo>

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="view_speedscope_index">
&lt;!DOCTYPE html&gt;
<html lang="en">
<head>
<meta charset="UTF-8"/>
<title>Speedscope for odoo</title>
<script t-if="profile">window.location.hash="#profileURL=<t t-esc="url_root"/>web/content/ir.profile/<t t-esc="profile.id"/>/speedscope"</script>
<link href="https://fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet"/>
<link rel="stylesheet"
t-attf-href="{{cdn}}reset.8c46b7a1.css"
crossorigin="anonymous"
integrity="sha256-mrA/937EwtEDE+8XZ/62tNz2T/BnCLth8QmWsWKpvD8="
/>
</head>
<body>
<script
t-attf-src="{{cdn}}speedscope.026f36b0.js"
crossorigin="anonymous"
integrity="sha256-CvDqAOMjq0Sv/D59O5JSbzzXoClZ3rptt6ts8D/6CWw="
></script>
</body>
</html>
</template>
</odoo>

View file

@ -0,0 +1,339 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Call this template instead of "web.assets_tests" to have the proper conditional check -->
<template id="conditional_assets_tests" name="Tests Assets Bundle">
<t t-call-assets="web.assets_tests" t-if="'tests' in debug or test_mode_enabled" defer_load="True" />
</template>
<template id="web.layout" name="Web layout">&lt;!DOCTYPE html&gt;
<html t-att="html_data or {}">
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<title t-esc="title or 'Odoo'"/>
<link type="image/x-icon" rel="shortcut icon" t-att-href="x_icon or '/web/static/img/favicon.ico'"/>
<script id="web.layout.odooscript" type="text/javascript">
var odoo = {
csrf_token: "<t t-nocache="The csrf token must always be up to date." t-esc="request.csrf_token(None)"/>",
debug: "<t t-esc="debug"/>",
};
</script>
<t t-out="head or ''"/>
</head>
<body t-att-class="body_classname">
<t t-out="0"/>
</body>
</html>
</template>
<template id="web.frontend_layout" name="Frontend Layout" inherit_id="web.layout" primary="True">
<xpath expr="//head/meta[last()]" position="after">
<meta name="viewport" content="width=device-width, initial-scale=1"/>
</xpath>
<xpath expr="//head/link[last()]" position="after">
<link rel="preload" href="/web/static/src/libs/fontawesome/fonts/fontawesome-webfont.woff2?v=4.7.0" as="font" crossorigin=""/>
<t t-call-assets="web.assets_frontend" t-js="false"/>
</xpath>
<xpath expr="//head/script[@id='web.layout.odooscript']" position="after">
<script t-nocache="Session information should always be up to date." type="text/javascript">
odoo.__session_info__ = <t t-out="json.dumps(request.env['ir.http'].get_frontend_session_info())"/>;
if (!/(^|;\s)tz=/.test(document.cookie)) {
const userTZ = Intl.DateTimeFormat().resolvedOptions().timeZone;
document.cookie = `tz=${userTZ}; path=/`;
}
</script>
<t t-call-assets="web.assets_frontend_minimal" t-css="false" defer_load="True"/>
<t t-call="web.conditional_assets_tests"/>
<t t-call-assets="web.assets_frontend_lazy" t-css="false" lazy_load="True"/>
</xpath>
<xpath expr="//t[@t-out='0']" position="replace">
<div id="wrapwrap" t-attf-class="#{pageName or ''}">
<header t-if="not no_header" id="top" data-anchor="true">
<img class="img-responsive d-block mx-auto"
t-attf-src="/web/binary/company_logo"
alt="Logo"/>
</header>
<main>
<t t-out="0"/>
</main>
<footer t-cache="no_footer,no_copyright" t-if="not no_footer" id="bottom" data-anchor="true" t-attf-class="bg-light o_footer">
<div id="footer"/>
<div t-if="not no_copyright" class="o_footer_copyright">
<div class="container py-3">
<div class="row">
<div class="col-sm text-center text-sm-start text-muted">
<span class="o_footer_copyright_name me-2">Copyright &amp;copy; <span t-field="res_company.name" itemprop="name">Company name</span></span>
</div>
<div class="col-sm text-center text-sm-end">
<t t-call="web.brand_promotion"/>
</div>
</div>
</div>
</div>
</footer>
</div>
</xpath>
</template>
<template id="brand_promotion_message" name="Brand Promotion Message">
<t t-set="odoo_logo">
<a target="_blank"
t-attf-href="http://www.odoo.com?utm_source=db&amp;utm_medium=#{_utm_medium}"
class="badge text-bg-light">
<img alt="Odoo"
src="/web/static/img/odoo_logo_tiny.png"
width="62" height="20"
style="width: auto; height: 1em; vertical-align: baseline;"/>
</a>
</t>
<t t-set="final_message">Powered by %s%s</t>
<t t-out="final_message % (odoo_logo, _message and ('- ' + _message) or '')"/>
</template>
<template id="brand_promotion" name="Brand Promotion">
<div class="o_brand_promotion">
<t t-call="web.brand_promotion_message">
<t t-set="_message"></t>
<t t-set="_utm_medium" t-valuef="portal"/>
</t>
</div>
</template>
<template id="web.login_layout" name="Login Layout">
<t t-call="web.frontend_layout">
<t t-set="html_data" t-value="{'style': 'height: 100%;'}"/>
<t t-set="body_classname" t-value="'bg-100'"/>
<t t-set="no_header" t-value="True"/>
<t t-set="no_footer" t-value="True"/>
<div class="container py-5">
<div t-attf-class="card border-0 mx-auto bg-100 {{login_card_classes}} o_database_list" style="max-width: 300px;">
<div class="card-body">
<div t-attf-class="text-center pb-3 border-bottom {{'mb-3' if form_small else 'mb-4'}}">
<img t-attf-src="/web/binary/company_logo{{ '?dbname='+db if db else '' }}" alt="Logo" style="max-height:120px; max-width: 100%; width:auto"/>
</div>
<t t-out="0"/>
<div class="text-center small mt-4 pt-3 border-top" t-if="not disable_footer">
<t t-if="not disable_database_manager">
<a class="border-end pe-2 me-1" href="/web/database/manager">Manage Databases</a>
</t>
<a href="https://www.odoo.com?utm_source=db&amp;utm_medium=auth" target="_blank">Powered by <span>Odoo</span></a>
</div>
</div>
</div>
</div>
</t>
</template>
<template id="web.login" name="Login">
<t t-call="web.login_layout">
<form class="oe_login_form" role="form" t-attf-action="/web/login" method="post" onsubmit="this.action = '/web/login' + location.hash">
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<div class="mb-3" t-if="databases and len(databases) &gt; 1">
<label for="db" class="col-form-label">Database</label>
<div t-attf-class="input-group {{'input-group-sm' if form_small else ''}}">
<input type="text" name="db" t-att-value="request.db" id="db" t-attf-class="form-control #{'form-control-sm' if form_small else ''}" required="required" readonly="readonly"/>
<a role="button" href="/web/database/selector" class="btn btn-secondary">Select <i class="fa fa-database" role="img" aria-label="Database" title="Database"></i></a>
</div>
</div>
<div class="mb-3 field-login">
<label for="login" class="form-label">Email</label>
<input type="text" placeholder="Email" name="login" t-att-value="login" id="login" t-attf-class="form-control #{'form-control-sm' if form_small else ''}" required="required" autocomplete="username" autofocus="autofocus" autocapitalize="off"/>
</div>
<div class="mb-3">
<label for="password" class="form-label">Password</label>
<input type="password" placeholder="Password" name="password" id="password" t-attf-class="form-control #{'form-control-sm' if form_small else ''}" required="required" autocomplete="current-password" t-att-autofocus="'autofocus' if login else None" maxlength="4096"/>
</div>
<p class="alert alert-danger" t-if="error" role="alert">
<t t-esc="error"/>
</p>
<p class="alert alert-success" t-if="message" role="status">
<t t-esc="message"/>
</p>
<div t-attf-class="clearfix oe_login_buttons text-center gap-1 d-grid mb-1 {{'pt-2' if form_small else 'pt-3'}}">
<button type="submit" class="btn btn-primary">Log in</button>
<t t-if="debug">
<button type="submit" name="redirect" value="/web/become" class="btn btn-link btn-sm">Log in as superuser</button>
</t>
<div class="o_login_auth"/>
</div>
<input type="hidden" name="redirect" t-att-value="redirect"/>
</form>
</t>
</template>
<template id="web.login_successful" name="Login successful">
<t t-call="web.login_layout">
<div class="oe_login_form">
<p>
You are logged in.
</p>
<div t-attf-class="clearfix oe_login_buttons text-center mb-1 pt-3">
<a class="btn btn-primary btn-block" href="/web/session/logout">Log out</a>
</div>
</div>
</t>
</template>
<template id="web.test_helpers">
<t t-call-assets="web.tests_assets" t-js="False"/>
<style>
body {
position: relative; /* bootstrap-datepicker needs this */
}
body:not(.debug) .modal-backdrop, body:not(.debug) .modal, body:not(.debug) .ui-autocomplete {
opacity: 0 !important;
}
#qunit-testrunner-toolbar label {
font-weight: inherit;
margin-bottom: inherit;
}
#qunit-testrunner-toolbar input[type=text] {
width: inherit;
display: inherit;
}
</style>
<t t-call-assets="web.tests_assets" t-css="False"/>
</template>
<template id="web.qunit_suite">
<t t-call="web.layout">
<t t-set="html_data" t-value="{'style': 'height: 100%;'}"/>
<t t-set="title">Web Tests</t>
<t t-set="head">
<t t-call-assets="web.assets_common" t-js="false"/>
<t t-call-assets="web.assets_backend" t-js="false"/>
<t t-call-assets="web.tests_assets_common" t-css="false"/>
<t t-call-assets="web.assets_backend" t-css="false"/>
<t t-call="web.test_helpers"/>
<t t-call-assets="web.qunit_suite_tests" t-js="false"/>
<t t-call-assets="web.qunit_suite_tests" t-css="false"/>
</t>
<div id="qunit"/>
<div id="qunit-fixture"/>
</t>
</template>
<template id="web.qunit_mobile_suite">
<t t-call="web.layout">
<t t-set="html_data" t-value="{'style': 'height: 100%;'}"/>
<t t-set="title">Web Mobile Tests</t>
<t t-set="head">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"/>
<t t-call-assets="web.assets_common" t-js="false"/>
<t t-call-assets="web.assets_backend" t-js="false"/>
<t t-call-assets="web.tests_assets_common" t-css="false"/>
<t t-call-assets="web.assets_backend" t-css="false"/>
<t t-call="web.test_helpers"/>
<t t-call-assets="web.qunit_mobile_suite_tests" t-js="false"/>
<t t-call-assets="web.qunit_mobile_suite_tests" t-css="false"/>
</t>
<div id="qunit"/>
<div id="qunit-fixture"/>
</t>
</template>
<template id="web.benchmark_suite">
<t t-call="web.layout">
<t t-set="html_data" t-value="{'style': 'height: 100%;'}"/>
<t t-set="title">Web Benchmarks</t>
<t t-set="head">
<script type="text/javascript" src="/web/static/lib/benchmarkjs/lodash.js"></script>
<script type="text/javascript" src="/web/static/lib/benchmarkjs/benchmark.js"></script>
<t t-call-assets="web.assets_common" t-js="false"/>
<t t-call-assets="web.assets_backend" t-js="false"/>
<t t-call-assets="web.assets_common" t-css="false"/>
<t t-call-assets="web.assets_backend" t-css="false"/>
<t t-call="web.test_helpers"/>
<script type="text/javascript">
QUnit.config.hidepassed = false;
</script>
<style>
body:not(.debug) .modal-backdrop, body:not(.debug) .modal, body:not(.debug) .ui-autocomplete {
opacity: 0 !important;
}
#qunit-testrunner-toolbar label {
font-weight: inherit;
margin-bottom: inherit;
}
#qunit-testrunner-toolbar input[type=text] {
width: inherit;
display: inherit;
}
</style>
<script type="text/javascript" src="/web/static/tests/views/list_benchmarks.js"></script>
<script type="text/javascript" src="/web/static/tests/views/kanban_benchmarks.js"></script>
<script type="text/javascript" src="/web/static/tests/views/form_benchmarks.js"></script>
</t>
<div id="qunit"/>
<div id="qunit-fixture"/>
</t>
</template>
<template id="web.webclient_bootstrap">
<t t-call="web.layout">
<t t-set="head_web">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"/>
<!-- Chrome, Firefox OS and Opera -->
<meta name="theme-color" content="#875A7B"/>
<link rel="icon" sizes="192x192" href="/web/static/img/mobile-icons/android-192x192.png"/>
<!-- iOS Safari -->
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<link rel="apple-touch-icon" href="/web/static/img/mobile-icons/apple-152x152.png"/>
<!-- Windows Phone -->
<meta name="msapplication-navbutton-color" content="#875A7B"/>
<meta name="msapplication-TileColor" content="#875A7B"/>
<meta name="msapplication-TileImage" content="/web/static/img/mobile-icons/windows-144x144.png"/>
<script type="text/javascript">
odoo.__session_info__ = <t t-out="json.dumps(session_info)"/>;
odoo.reloadMenus = () => fetch(`/web/webclient/load_menus/${odoo.__session_info__.cache_hashes.load_menus}`).then(res => res.json());
odoo.loadMenusPromise = odoo.reloadMenus();
// Block to avoid leaking variables in the script scope
{
const { user_context, cache_hashes } = odoo.__session_info__;
// Prefetch translations to speedup webclient. This is done in JS because link rel="prefetch"
// is not yet supported on safari.
fetch(`/web/webclient/translations/${cache_hashes.translations}?lang=${user_context.lang}`);
}
</script>
<t t-if="request.httprequest.cookies.get('color_scheme') == 'dark'">
<t t-call-assets="web.dark_mode_assets_common" t-js="false"/>
<t t-call-assets="web.dark_mode_assets_backend" t-js="false"/>
</t>
<t t-else="">
<t t-call-assets="web.assets_common" t-js="false"/>
<t t-call-assets="web.assets_backend" t-js="false"/>
</t>
<t t-call-assets="web.assets_common" t-css="false"/>
<t t-call-assets="web.assets_backend" t-css="false"/>
<t t-call-assets="web.assets_backend_prod_only" t-css="false"/>
<t t-call="web.conditional_assets_tests"/>
</t>
<t t-set="head" t-value="head_web + (head or '')"/>
<t t-set="body_classname" t-value="'o_web_client'"/>
</t>
</template>
</odoo>