[ADD] l10n_de: din5008 type B report
Specific report template used in Germany. Add a new report layout as well as a new paperformat. Was part of task: 35289 Was part of PR #25472
This commit is contained in:
committed by
qdp-odoo
parent
c71da7db84
commit
3ff5fea933
@@ -22,5 +22,6 @@ German accounting chart and localization.
|
||||
'data/res.country.state.csv',
|
||||
'data/menuitem_data.xml',
|
||||
'views/account_view.xml',
|
||||
'report/din5008_report.xml',
|
||||
],
|
||||
}
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import datev
|
||||
from . import chart_template
|
||||
from . import chart_template
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from odoo import api, models, _
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class WizardMultiChartsAccounts(models.TransientModel):
|
||||
@@ -12,3 +12,16 @@ class WizardMultiChartsAccounts(models.TransientModel):
|
||||
existing_tags = [x[-1:] for x in res.get('tag_ids', [])]
|
||||
res['tag_ids'] = [(6, 0, existing_tags + [xml_id])]
|
||||
return res
|
||||
|
||||
# Write paperformat and report template used on company
|
||||
@api.model
|
||||
def execute(self):
|
||||
res = super(WizardMultiChartsAccounts, self).execute()
|
||||
if self.company_id.country_id.code == 'DE':
|
||||
self.company_id.write({'external_report_layout': 'din5008', 'paperformat_id': self.env.ref('l10n_de.paperformat_euro_din').id})
|
||||
return res
|
||||
|
||||
class Company(models.Model):
|
||||
_inherit = 'res.company'
|
||||
|
||||
external_report_layout = fields.Selection(selection_add=[('din5008', 'Din 5008')])
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
|
||||
<!-- New report paperformat for din5008 format -->
|
||||
<record id="paperformat_euro_din" model="report.paperformat">
|
||||
<field name="name">European A4 for DIN</field>
|
||||
<field name="default" eval="False" />
|
||||
<field name="format">A4</field>
|
||||
<field name="orientation">Portrait</field>
|
||||
<field name="margin_top">45</field>
|
||||
<field name="margin_bottom">28</field>
|
||||
<field name="margin_left">0</field>
|
||||
<field name="margin_right">0</field>
|
||||
<field name="header_line" eval="False" />
|
||||
<field name="header_spacing">45</field>
|
||||
</record>
|
||||
|
||||
<template id="assets_common" name="l10n_de_din5008_report" inherit_id="web.report_assets_common">
|
||||
<xpath expr="." position="inside">
|
||||
<link rel="stylesheet" type="text/scss" href="/l10n_de/static/src/scss/report_din5008.scss"/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<!-- New report layout for din5008 format -->
|
||||
<template id="web.external_layout_din5008">
|
||||
<t t-if="not o and doc">
|
||||
<t t-set="o" t-value="doc"/>
|
||||
</t>
|
||||
|
||||
<t t-if="o and 'company_id' in o">
|
||||
<t t-set="company" t-value="o.company_id.sudo()"/>
|
||||
</t>
|
||||
<t t-if="not o or not 'company_id' in o">
|
||||
<t t-set="company" t-value="res_company"/>
|
||||
</t>
|
||||
<div>
|
||||
<div class="header din">
|
||||
<div class="pull-right">
|
||||
<h3 class="mt0 text-right" t-field="company.report_header"/>
|
||||
</div>
|
||||
<img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % to_text(company.logo)" class="pull-left"/>
|
||||
</div>
|
||||
|
||||
<div class="article din">
|
||||
<div class="header_address">
|
||||
<t t-if="address">
|
||||
<div name="invoice_address" class="invoice_address">
|
||||
<t t-raw="address"/>
|
||||
</div>
|
||||
</t>
|
||||
<div class="company_address">
|
||||
<div>
|
||||
<strong t-field="company.partner_id.name"/>
|
||||
</div>
|
||||
<span t-field="company.partner_id"
|
||||
t-options='{"widget": "contact", "fields": ["address"], "no_marker": true}'/>
|
||||
<t t-if="information_block">
|
||||
<div class="address">
|
||||
<t t-raw="information_block"/>
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
<t t-raw="0" />
|
||||
</div>
|
||||
|
||||
<div class="footer o_background_footer din">
|
||||
<div class="text-right page_number">
|
||||
<div class="text-muted">
|
||||
Page:
|
||||
<span class="page"/>
|
||||
of
|
||||
<span class="topage"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<ul class="list-inline">
|
||||
<li t-if="company.phone"><i class="fa fa-phone"/> <span t-field="company.phone"/></li>
|
||||
<li t-if="company.email"><i class="fa fa-at"/> <span t-field="company.email"/></li>
|
||||
<li t-if="company.website"><i class="fa fa-globe"/> <span t-field="company.website"/></li>
|
||||
<li t-if="company.vat"><i class="fa fa-building-o"/><t t-esc="company.country_id.vat_label or 'TIN'"/>: <span t-field="company.vat"/></li>
|
||||
</ul>
|
||||
<div t-field="company.report_footer"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 53 KiB |
Binary file not shown.
@@ -0,0 +1,52 @@
|
||||
.din {
|
||||
&.header {
|
||||
min-height: 45mm;
|
||||
max-height: 45mm;
|
||||
overflow: hidden;
|
||||
img {
|
||||
max-height: 45mm;
|
||||
}
|
||||
}
|
||||
.company_address {
|
||||
position: relative;
|
||||
left: 45mm;
|
||||
top: 5mm;
|
||||
width: 75mm;
|
||||
min-width: 75mm;
|
||||
display: inline-block;
|
||||
}
|
||||
.invoice_address {
|
||||
position: relative;
|
||||
left: 25mm;
|
||||
top: 17.7mm;
|
||||
width: 85mm;
|
||||
height: 27.3mm;
|
||||
overflow-y: hidden;
|
||||
word-break: break-word;
|
||||
float: left;
|
||||
}
|
||||
.header_address {
|
||||
min-height: 45mm;
|
||||
}
|
||||
.page_number {
|
||||
margin-top: 4.23mm;
|
||||
margin-bottom: 4.23mm;
|
||||
}
|
||||
&.article {
|
||||
.page {
|
||||
position: relative;
|
||||
top: 8.46mm;
|
||||
left: 25mm;
|
||||
width: 190mm;
|
||||
}
|
||||
.address {
|
||||
margin-top: 5mm;
|
||||
}
|
||||
}
|
||||
&.o_background_footer {
|
||||
position: relative;
|
||||
left: 25mm;
|
||||
top: 8.46mm;
|
||||
width: 190mm;
|
||||
}
|
||||
}
|
||||
@@ -10,4 +10,71 @@
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_company_report_form" model="ir.ui.view">
|
||||
<field name="name">res.company.l10nde.report.form</field>
|
||||
<field name="model">res.company</field>
|
||||
<field name="inherit_id" ref="base.view_company_report_form"></field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="external_report_layout" position="attributes">
|
||||
<attribute name="options">{
|
||||
'background': {
|
||||
'image_link': '/base/static/img/preview_background.png',
|
||||
'preview_link': '/base/static/pdf/preview_background.pdf'
|
||||
},
|
||||
'boxed': {
|
||||
'image_link': '/base/static/img/preview_boxed.png',
|
||||
'preview_link': '/base/static/pdf/preview_boxed.pdf'
|
||||
},
|
||||
'clean': {
|
||||
'image_link': '/base/static/img/preview_clean.png',
|
||||
'preview_link': '/base/static/pdf/preview_clean.pdf'
|
||||
},
|
||||
'standard': {
|
||||
'image_link': '/base/static/img/preview_standard.png',
|
||||
'preview_link': '/base/static/pdf/preview_standard.pdf'
|
||||
},
|
||||
'din5008': {
|
||||
'image_link': '/l10n_de/static/img/preview_din.png',
|
||||
'preview_link': '/l10n_de/static/pdf/preview_din.pdf'
|
||||
}
|
||||
}
|
||||
</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Template use in community -->
|
||||
<record id="view_company_document_template_form" model="ir.ui.view">
|
||||
<field name="name">res.company.l10nde.template.report.form</field>
|
||||
<field name="model">res.company</field>
|
||||
<field name="inherit_id" ref="base.view_company_document_template_form"></field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="external_report_layout" position="attributes">
|
||||
<attribute name="options">{
|
||||
'background': {
|
||||
'image_link': '/base/static/img/preview_background.png',
|
||||
'preview_link': '/base/static/pdf/preview_background.pdf'
|
||||
},
|
||||
'boxed': {
|
||||
'image_link': '/base/static/img/preview_boxed.png',
|
||||
'preview_link': '/base/static/pdf/preview_boxed.pdf'
|
||||
},
|
||||
'clean': {
|
||||
'image_link': '/base/static/img/preview_clean.png',
|
||||
'preview_link': '/base/static/pdf/preview_clean.pdf'
|
||||
},
|
||||
'standard': {
|
||||
'image_link': '/base/static/img/preview_standard.png',
|
||||
'preview_link': '/base/static/pdf/preview_standard.pdf'
|
||||
},
|
||||
'din5008': {
|
||||
'image_link': '/l10n_de/static/img/preview_din.png',
|
||||
'preview_link': '/l10n_de/static/pdf/preview_din.pdf'
|
||||
}
|
||||
}
|
||||
</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user