19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:31:21 +01:00
parent 7dc55599c6
commit 7f43bbbfcc
650 changed files with 45260 additions and 33436 deletions

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data>
<template id="external_layout_din5008_account_move" inherit_id="l10n_din5008.external_layout_din5008">
<xpath expr="//div[@id='din5008_report_main_address']" position="before">
<t t-if="o and o._name == 'account.move' and o.partner_id">
<t t-set="address">
<address class="mb-0" t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/>
</t>
</t>
</xpath>
</template>
</data>
</odoo>

View file

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="report_invoice_wizard_preview" inherit_id="web.report_invoice_wizard_preview">
<xpath expr="//t[@t-set='address']" position="after">
<t t-set="din5008_document_information">
<div class="information_block" t-if="company and company._name=='base.document.layout'">
<table>
<tr>
<td>Invoice No.:</td>
<td>INV/<t t-out="company.l10n_din5008_invoice_date.year"/>/12345</td>
</tr>
<tr>
<td>Invoice Date:</td>
<td><t t-out="company.l10n_din5008_invoice_date" t-options="{'widget': 'date'}"/></td>
</tr>
<tr>
<td>Due Date:</td>
<td><t t-out="company.l10n_din5008_due_date" t-options="{'widget': 'date'}"/></td>
</tr>
<tr>
<td>Delivery Date:</td>
<td><t t-out="company.l10n_din5008_delivery_date" t-options="{'widget': 'date'}"/></td>
</tr>
<tr>
<td>Reference:</td>
<td>SO/2021/45678</td>
</tr>
</table>
</div>
</t>
</xpath>
</template>
</odoo>

View file

@ -34,91 +34,80 @@
<!-- New report layout for din5008 format -->
<template id="external_layout_din5008">
<div>
<div t-attf-class="header din_page o_company_#{company.id}_layout #{'din_page_pdf' if report_type == 'pdf' else ''}">
<t t-set="is_din_paperformat"
t-value="company.paperformat_id in [env.ref('l10n_din5008.paperformat_euro_din_a', raise_if_not_found=False), env.ref('l10n_din5008.paperformat_euro_din', raise_if_not_found=False)]" />
<div t-attf-class="header din_page o_company_#{company.id}_layout #{'din_page_pdf' if report_type == 'pdf' and is_din_paperformat else ''}">
<table class="company_header table-borderless" t-att-style="'height: %dmm;' % (din_header_spacing or 27)">
<tr>
<td><h3 class="mt0" t-field="company.report_header"/></td>
<td><div class="h3 mt0" t-field="company.report_header"/></td>
<td><img t-if="company.logo" t-att-src="image_data_uri(company.logo)" t-att-style="'max-height: %dmm;' % (din_header_spacing or 27)"/></td>
</tr>
</table>
</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="din_page invoice_note article o_company_#{company.id}_layout {{'o_report_layout_background' if company.layout_background in ['Geometric', 'Custom'] else ''}} #{'din_page_pdf' if report_type == 'pdf' else ''}"
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/demo_logo_report.png' if company.layout_background == 'Demo logo' else ''" />
<div t-attf-class="din_page invoice_note article o_company_#{company.id}_layout {{'o_report_layout_background' if company.layout_background in ['Geometric', 'Custom'] else ''}} #{'din_page_pdf' if report_type == 'pdf' and is_din_paperformat 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')">
<table class="table-borderless" t-if="not skip_headers">
t-att-data-oe-id="o and o.id">
<table class="din_company_info table-borderless">
<tr>
<td>
<div class="address">
<t t-if="company.name">
<span t-field="company.name"/>
</t>
<t t-if="company.street">
<span>|</span> <span t-field="company.street"/>
</t>
<t t-if="company.street2">
<span>|</span> <span t-field="company.street2"/>
</t>
<t t-if="company.zip">
<span>|</span> <span t-field="company.zip"/>
</t>
<t t-if="company.city">
<span t-if="not company.zip">|</span> <span t-field="company.city"/>
</t>
<t t-if="company.country_id">
<span>|</span> <span t-field="company.country_id.name"/>
</t>
<div class="address" id="din5008_report_main_address">
<div class="colored_address">
<t t-if="company.name">
<span t-field="company.name"/>
</t>
<t t-if="company.street">
<span>|</span> <span t-field="company.street"/>
</t>
<t t-if="company.street2">
<span>|</span> <span t-field="company.street2"/>
</t>
<t t-if="company.zip">
<span>|</span> <span t-field="company.zip"/>
</t>
<t t-if="company.city">
<span t-if="not company.zip">|</span> <span t-field="company.city"/>
</t>
<t t-if="company.country_id">
<span>|</span> <span t-field="company.country_id.name"/>
</t>
</div>
<hr class="company_invoice_line" />
<div t-if="address">
<span t-if="address">
<t t-out="address"/>
</div>
<div t-else="fallback_address">
<t t-esc="fallback_address"
</span>
<span t-else="fallback_address">
<t t-out="fallback_address"
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}' />
</div>
</span>
</div>
</td>
<td>
<div class="information_block">
<t t-if="'l10n_din5008_template_data' in company" t-set="template_data" t-value="company.l10n_din5008_template_data"/>
<t t-if="o and 'l10n_din5008_template_data' in o" t-set="template_data" t-value="o.l10n_din5008_template_data"/>
<table>
<t t-foreach="template_data" t-as="row">
<tr><td><t t-esc="row[0]"/></td><td><t t-esc="row[1]"/></td></tr>
</t>
</table>
</div>
<td t-if="din5008_document_information">
<t t-out="din5008_document_information"/>
</td>
</tr>
<div>
<tr t-if="o and 'l10n_din5008_addresses' in o">
<t t-foreach="o.l10n_din5008_addresses" t-as="doc_address">
<td>
<div class="shipping_address">
<strong><t t-esc="doc_address[0]"/></strong>
<div t-esc="doc_address[1]" t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True}'/>
</div>
</td>
</t>
</tr>
</div>
<t t-if="din5008_address_block">
<t t-out="din5008_address_block"/>
</t>
</table>
<h2 t-if="not skip_headers">
<span t-if="not o and not docs"><t t-esc="company.l10n_din5008_document_title"/></span>
<h2>
<span t-if="not o and not docs">Invoice</span>
<span t-else="">
<t t-set="o" t-value="docs[0]" t-if="not o" />
<span t-if="'l10n_din5008_document_title' in o"><t t-esc="o.l10n_din5008_document_title"/></span>
<t t-if="din5008_document_title">
<t t-out="din5008_document_title"/>
</t>
<span t-elif="'name' in o" t-field="o.name"/>
</span>
</h2>
<t t-out="0"/>
</div>
<div t-attf-class="din_page footer o_company_#{company.id}_layout #{'din_page_pdf' if report_type == 'pdf' else ''}">
<div t-attf-class="din_page footer o_company_#{company.id}_layout #{'din_page_pdf' if report_type == 'pdf' and is_din_paperformat else ''}">
<div class="text-end page_number">
<div class="text-muted">
Page: <span class="page"/> of <span class="topage"/>
@ -127,36 +116,31 @@
<div class="company_details">
<table class="table-borderless">
<tr>
<td>
<ul class="list-inline text-nowrap">
<li t-if="company.name"><span t-field="company.name"/></li>
<li t-if="company.street"><span t-field="company.street"/></li>
<li t-if="company.street2"><span t-field="company.street2"/></li>
<li><span t-if="company.zip" t-field="company.zip"/> <span t-if="company.city" t-field="company.city"/></li>
<li t-if="company.country_id"><span t-field="company.country_id.name"/></li>
<td colspan="3">
<ul class="list-inline">
<li t-if="company.company_details"><span t-field="company.company_details"/></li>
</ul>
</td>
<td>
<td colspan="4">
<ul class="list-inline">
<li t-if="company.phone"><span t-field="company.phone"/></li>
<li t-if="company.email"><span t-field="company.email"/></li>
<li t-if="company.website"><span t-field="company.website"/></li>
<li t-if="company.report_footer"><span t-field="company.report_footer"/></li>
</ul>
</td>
<td>
<td colspan="2">
<ul class="list-inline">
<li t-if="company.vat"><t t-esc="company.account_fiscal_country_id.vat_label or 'Tax ID'"/>:
<span t-if="forced_vat" t-esc="forced_vat"/>
<t t-set="default_vat_label">Tax ID</t>
<li t-if="company.vat"><t t-out="company.account_fiscal_country_id.vat_label or default_vat_label"/>:
<span t-if="forced_vat" t-out="forced_vat"/>
<span t-else="" t-field="company.vat"/>
</li>
<li>HRB Nr: <span t-field="company.company_registry"/></li>
</ul>
</td>
<td>
<ul class="list-inline" t-if="company.partner_id.bank_ids">
<td colspan="3" t-if="company.partner_id.bank_ids">
<ul class="list-inline">
<t t-foreach="company.partner_id.bank_ids[:2]" t-as="bank">
<li><span t-field="bank.bank_id.name"/></li>
<li>IBAN: <span t-field="bank.acc_number"/></li>
<li class="text-nowrap">IBAN: <span t-field="bank.acc_number"/></li>
<li>BIC: <span t-field="bank.bank_id.bic"/></li>
</t>
</ul>
@ -175,25 +159,25 @@
&amp;.header {
.company_header {
.name_container {
color: <t t-esc='primary'/>;
color: <t t-out='primary'/>;
}
}
}
&amp;.invoice_note {
td {
.address {
> span {
color: <t t-esc='secondary'/>;
.colored_address {
color: <t t-out='secondary'/>;
}
}
}
h2 {
color: <t t-esc='primary'/>;
color: <t t-out='primary'/>;
}
.page {
[name=invoice_line_table], [name=stock_move_table], .o_main_table {
th {
color: <t t-esc='secondary'/>;
color: <t t-out='secondary'/>;
}
}
}
@ -202,5 +186,129 @@
</t>
</xpath>
</template>
<template id="report_invoice_document" inherit_id="account.report_invoice_document">
<xpath expr="//t[@t-set='forced_vat']" position="after">
<t t-set="din5008_document_information">
<div class="information_block" t-if="o and o._name=='account.move'">
<table>
<tr t-if="o.name">
<td>Invoice No.</td>
<td><t t-out="o.name"/></td>
</tr>
<tr t-if="o.invoice_date">
<td>Invoice Date</td>
<td><t t-out="o.invoice_date" t-options="{'widget': 'date'}"/></td>
</tr>
<tr t-if="o.invoice_date_due">
<td>Invoice Date Due</td>
<td><t t-out="o.invoice_date_due" t-options="{'widget': 'date'}"/></td>
</tr>
<tr t-if="o.delivery_date">
<td>Delivery Date</td>
<td><t t-out="o.delivery_date" t-options="{'widget': 'date'}"/></td>
</tr>
<tr t-if="o.invoice_incoterm_id">
<td>Incoterm</td>
<td t-if="o.incoterm_location">
<span t-out="o.invoice_incoterm_id.code"/> - <span t-out="o.incoterm_location"/>
</td>
<td t-else="" t-out="o.invoice_incoterm_id.code"/>
</tr>
<tr t-if="o.invoice_origin">
<td>Source</td>
<td><t t-out="o.invoice_origin"/></td>
</tr>
<tr t-if="o.ref">
<td>Reference</td>
<td><t t-out="o.ref"/></td>
</tr>
<div t-if="o.partner_id">
<tr><td colspan="2" style="height:20px;"></td></tr>
<tr t-if="o.partner_id.commercial_partner_id == o.partner_id and o.partner_id.commercial_partner_id.vat">
<td>VAT</td>
<td><t t-out="o.partner_id.commercial_partner_id.vat"/></td>
</tr>
</div>
</table>
</div>
</t>
<t t-set="din5008_address_block">
<t t-if="o and o._name=='account.move'">
<t t-set="commercial_partner" t-value="o.commercial_partner_id"/>
<t t-set="invoice_partner" t-value="o.partner_id"/>
<t t-set="delivery_partner" t-value="o.partner_shipping_id"/>
<t t-set="different_partner_count" t-value="len({partner.id for partner in [o.partner_id.commercial_partner_id, o.partner_id, o.partner_shipping_id] if partner})"/>
<tr t-if="different_partner_count > 1">
<t t-if="delivery_partner and delivery_partner != commercial_partner">
<td class="shipping_address">
<span class="fw-bold">Shipping Address:</span>
<address t-esc="o.partner_shipping_id" t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True}'/>
</td>
</t>
<t t-if="invoice_partner and invoice_partner != commercial_partner">
<td class="shipping_address">
<span class="fw-bold">Beneficiary:</span>
<address class="mb-0" t-esc="o.commercial_partner_id" t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True}'/>
<div t-if="o.commercial_partner_id.vat">
<t t-if="o.commercial_partner_id.company_id.account_fiscal_country_id.vat_label" t-out="o.commercial_partner_id.company_id.account_fiscal_country_id.vat_label" id="inv_tax_id_label"/>
<t t-else="">Tax ID</t>: <span t-field="o.commercial_partner_id.vat"/>
</div>
</td>
</t>
</tr>
</t>
</t>
<t t-set="din5008_document_title">
<span t-if="o and o._name == 'account.move'">
<t t-if="o.move_type == 'out_invoice'">
<t t-if="o.state == 'posted'">Invoice</t>
<t t-if="o.state == 'draft'">Draft Invoice</t>
<t t-if="o.state == 'cancel'">Cancelled Invoice</t>
</t>
<t t-if="o.move_type == 'out_refund'">Credit Note</t>
<t t-if="o.move_type == 'in_refund'">Vendor Credit Note</t>
<t t-if="o.move_type == 'in_invoice'">Vendor Bill</t>
</span>
</t>
</xpath>
<!-- Insert Position Column as the First Column in the Table Header -->
<xpath expr="//table[@name='invoice_line_table']/thead/tr/th[1]" position="before">
<t t-if="o.company_id.has_position_column">
<th name="th_position" class="text-start">Position</th>
</t>
</xpath>
<!-- Insert Empty Column for Position Numbers to Handle Section Misalignment -->
<xpath expr="//td[@name='line_name_td']" position="after">
<t t-if="o.company_id.has_position_column">
<td/>
</t>
</xpath>
<xpath expr="//table[@name='invoice_line_table']/tbody//t[1]" position="before">
<t t-if="o.company_id.has_position_column">
<t t-set="line_number" t-value="1"/>
</t>
</xpath>
<xpath expr="//table[@name='invoice_line_table']/tbody//tr[1]//td[1]" position="before">
<t t-if="o.company_id.has_position_column">
<td class="text-start" t-esc="line_number"/>
<t t-set="line_number" t-value="line_number+1"/>
</t>
</xpath>
<!--adding currency to unit price-->
<xpath expr="//td[@name='td_price_unit']/span" position="attributes">
<attribute name="t-options">{"widget": "monetary", "display_currency": o.currency_id}</attribute>
</xpath>
<!-- Insert the payments terms under the total line-->
<xpath expr="//div[@id='payment_term']" position="before">
<hr class="w-100 border-0"/>
</xpath>
</template>
</data>
</odoo>