[IMP] l10n_sk,l10n_cz: invoice layout legal imp
before this PR, some legal information were missing from our invoice layout, for the l10n_cz and l10n_sk localization. For l10n_cz: - On move we add a taxable supply date - On the company we add a trade registry field - On report template we add the company_registry, the vat number For l10n_sk: - On move we add a taxable supply date - On the company we add a trade registry field and income tax id - On report template we add the company_registry, the vat number and income tax id closes odoo/odoo#126837 Task: 3374969 Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
This commit is contained in:
@@ -847,7 +847,7 @@
|
||||
<label for="invoice_payment_term_id" string="Payment terms"
|
||||
attrs="{'invisible': [('invoice_payment_term_id', '=', False)]}"/>
|
||||
</div>
|
||||
<div class="d-flex" attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt'))]}">
|
||||
<div class="d-flex" attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt'))]}" name="due_date">
|
||||
<field name="invoice_date_due" force_save="1"
|
||||
placeholder="Date"
|
||||
attrs="{'invisible': [('invoice_payment_term_id', '!=', False)]}"/>
|
||||
|
||||
@@ -23,6 +23,13 @@ Tento modul definuje:
|
||||
'base_iban',
|
||||
'base_vat',
|
||||
],
|
||||
'data': [
|
||||
'views/report_invoice.xml',
|
||||
'views/res_partner_views.xml',
|
||||
'views/res_company_views.xml',
|
||||
'views/account_move_views.xml',
|
||||
'views/report_template.xml',
|
||||
],
|
||||
'demo': [
|
||||
'data/demo_company.xml',
|
||||
],
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from . import template_cz
|
||||
from . import res_company
|
||||
from . import account_move
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class AccountMove(models.Model):
|
||||
_inherit = 'account.move'
|
||||
|
||||
taxable_supply_date = fields.Date()
|
||||
@@ -0,0 +1,15 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResCompany(models.Model):
|
||||
_inherit = "res.company"
|
||||
|
||||
trade_registry = fields.Char()
|
||||
|
||||
class BaseDocumentLayout(models.TransientModel):
|
||||
_inherit = 'base.document.layout'
|
||||
|
||||
account_fiscal_country_id = fields.Many2one(related="company_id.account_fiscal_country_id")
|
||||
company_registry = fields.Char(related='company_id.company_registry')
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="view_move_form_l10n_cz" model="ir.ui.view">
|
||||
<field name="name">account.move.form.l10n_cz</field>
|
||||
<field name="model">account.move</field>
|
||||
<field name="inherit_id" ref="account.view_move_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@name='due_date']" position="after">
|
||||
<field name="taxable_supply_date" attrs="{'invisible': [('country_code', '!=', 'CZ')]}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_invoice_document" inherit_id="account.report_invoice_document">
|
||||
<!-- add company id to partner details-->
|
||||
<xpath expr="//div[@id='partner_vat_address_not_same_as_shipping']" position="after">
|
||||
<div t-if="o.partner_id.company_registry and o.company_id.country_code == 'CZ'">
|
||||
ID: <span t-field="o.partner_id.company_registry"/>
|
||||
</div>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//div[@id='partner_vat_address_same_as_shipping']" position="after">
|
||||
<div t-if="o.partner_id.company_registry and o.company_id.country_code == 'CZ'">
|
||||
ID: <span t-field="o.partner_id.company_registry"/>
|
||||
</div>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//div[@id='partner_vat_no_shipping']" position="after">
|
||||
<div t-if="o.partner_id.company_registry and o.company_id.country_code == 'CZ'">
|
||||
ID: <span t-field="o.partner_id.company_registry"/>
|
||||
</div>
|
||||
</xpath>
|
||||
|
||||
<!-- add taxable supply -->
|
||||
<xpath expr="//div[@name='due_date']" position="after">
|
||||
<div t-attf-class="#{'col-auto col-3 mw-100' if report_type != 'html' else 'col'} mb-2" t-if="o.taxable_supply_date and o.company_id.country_code == 'CZ'" name="taxable_supply_date">
|
||||
<strong>Taxable Supply:</strong>
|
||||
<p class="m-0" t-field="o.taxable_supply_date"/>
|
||||
</div>
|
||||
</xpath>
|
||||
|
||||
<!-- add trade registry-->
|
||||
<xpath expr="//div[@name='comment']" position="after">
|
||||
<p t-if="o.company_id.trade_registry and o.company_id.country_code == 'CZ'" name="trade_registry">
|
||||
<strong>Trade registry: </strong><t t-out="o.company_id.trade_registry"/>
|
||||
</p>
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
||||
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="l10n_cz_external_layout_standard" inherit_id="web.external_layout_standard">
|
||||
<xpath expr="//ul[@name='company_address_list']" position="inside">
|
||||
<li t-if="company.vat and company.account_fiscal_country_id.code == 'CZ'">
|
||||
<t t-esc="company.country_id.vat_label or 'Tax ID'"/>:
|
||||
<span t-esc="company.vat"/>
|
||||
</li>
|
||||
<li t-if="company.company_registry and company.account_fiscal_country_id.code == 'CZ'">
|
||||
ID: <span t-field="company.company_registry"/>
|
||||
</li>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="l10n_cz_external_layout_bold" inherit_id="web.external_layout_bold">
|
||||
<xpath expr="//ul[@name='company_address_list']" position="inside">
|
||||
<li t-if="company.vat and company.account_fiscal_country_id.code == 'CZ'">
|
||||
<t t-esc="company.country_id.vat_label or 'Tax ID'"/>:
|
||||
<span t-esc="company.vat"/>
|
||||
</li>
|
||||
<li t-if="company.company_registry and company.account_fiscal_country_id.code == 'CZ'">
|
||||
ID: <span t-field="company.company_registry"/>
|
||||
</li>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="l10n_cz_external_layout_boxed" inherit_id="web.external_layout_boxed">
|
||||
<xpath expr="//ul[@name='company_address_list']" position="inside">
|
||||
<li t-if="company.vat and company.account_fiscal_country_id.code == 'CZ'">
|
||||
<t t-esc="company.country_id.vat_label or 'Tax ID'"/>:
|
||||
<span t-esc="company.vat"/>
|
||||
</li>
|
||||
<li t-if="company.company_registry and company.account_fiscal_country_id.code == 'CZ'">
|
||||
ID: <span t-field="company.company_registry"/>
|
||||
</li>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="l10n_cz_external_layout_striped" inherit_id="web.external_layout_striped">
|
||||
<xpath expr="//ul[@name='company_address_list']" position="inside">
|
||||
<li t-if="company.vat and company.account_fiscal_country_id.code == 'CZ'">
|
||||
<t t-esc="company.country_id.vat_label or 'Tax ID'"/>:
|
||||
<span t-esc="company.vat"/>
|
||||
</li>
|
||||
<li t-if="company.company_registry and company.account_fiscal_country_id.code == 'CZ'">
|
||||
ID: <span t-field="company.company_registry"/>
|
||||
</li>
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="view_company_form_inherit_l10n_ck" model="ir.ui.view">
|
||||
<field name="name">res.company.form.inherit.l10n_ck</field>
|
||||
<field name="inherit_id" ref="base.view_company_form"/>
|
||||
<field name="model">res.company</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="currency_id" position="after">
|
||||
<field name="trade_registry" attrs="{'invisible': [('country_code', '!=', 'CZ')]}"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="res_partner_view_form_inherit_l10n_cz" model="ir.ui.view">
|
||||
<field name="name">res.partner.view.form.inherit.l10n.cz</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="account.view_partner_property_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='company_registry']" position="replace">
|
||||
<field name="company_registry" attrs="{'invisible': [('fiscal_country_codes', 'ilike', 'CZ')]}"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='vat']" position="after">
|
||||
<field name="company_registry" attrs="{'invisible': [('fiscal_country_codes', 'not ilike', 'CZ')]}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -27,6 +27,13 @@ Pre viac informácií kontaktujte info@26house.com alebo navštívte https://www
|
||||
'base_vat',
|
||||
'account',
|
||||
],
|
||||
'data': [
|
||||
'views/res_partner_views.xml',
|
||||
'views/res_company_views.xml',
|
||||
'views/report_invoice.xml',
|
||||
'views/account_move_views.xml',
|
||||
'views/report_template.xml',
|
||||
],
|
||||
'demo': [
|
||||
'demo/demo_company.xml',
|
||||
],
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from . import template_sk
|
||||
from . import account_move
|
||||
from . import res_company
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class AccountMove(models.Model):
|
||||
_inherit = 'account.move'
|
||||
|
||||
taxable_supply_date = fields.Date()
|
||||
@@ -0,0 +1,18 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResCompany(models.Model):
|
||||
_inherit = "res.company"
|
||||
|
||||
trade_registry = fields.Char()
|
||||
income_tax_id = fields.Char(string="Income Tax ID")
|
||||
|
||||
|
||||
class BaseDocumentLayout(models.TransientModel):
|
||||
_inherit = 'base.document.layout'
|
||||
|
||||
account_fiscal_country_id = fields.Many2one(related="company_id.account_fiscal_country_id")
|
||||
company_registry = fields.Char(related='company_id.company_registry')
|
||||
income_tax_id = fields.Char(related='company_id.income_tax_id')
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="view_move_form_l10n_sk" model="ir.ui.view">
|
||||
<field name="name">account.move.form.l10n_sk</field>
|
||||
<field name="model">account.move</field>
|
||||
<field name="inherit_id" ref="account.view_move_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@name='due_date']" position="after">
|
||||
<field name="taxable_supply_date" attrs="{'invisible': [('country_code', '!=', 'SK')]}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_invoice_document" inherit_id="account.report_invoice_document">
|
||||
<!-- add company id to partner details-->
|
||||
<xpath expr="//div[@id='partner_vat_address_not_same_as_shipping']" position="after">
|
||||
<div t-if="o.partner_id.company_registry and o.company_id.country_code == 'SK'">
|
||||
ID: <span t-field="o.partner_id.company_registry"/>
|
||||
</div>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//div[@id='partner_vat_address_same_as_shipping']" position="after">
|
||||
<div t-if="o.partner_id.company_registry and o.company_id.country_code == 'SK'">
|
||||
ID: <span t-field="o.partner_id.company_registry"/>
|
||||
</div>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//div[@id='partner_vat_no_shipping']" position="after">
|
||||
<div t-if="o.partner_id.company_registry and o.company_id.country_code == 'SK'">
|
||||
ID: <span t-field="o.partner_id.company_registry"/>
|
||||
</div>
|
||||
</xpath>
|
||||
|
||||
<!-- add taxable supply -->
|
||||
<xpath expr="//div[@name='due_date']" position="after">
|
||||
<div t-attf-class="#{'col-auto col-3 mw-100' if report_type != 'html' else 'col'} mb-2" t-if="o.taxable_supply_date and o.company_id.country_code == 'SK'" name="taxable_supply_date">
|
||||
<strong>Taxable Supply:</strong>
|
||||
<p class="m-0" t-field="o.taxable_supply_date"/>
|
||||
</div>
|
||||
</xpath>
|
||||
|
||||
<!-- add trade registry-->
|
||||
<xpath expr="//div[@name='comment']" position="after">
|
||||
<p t-if="o.company_id.trade_registry and o.company_id.country_code == 'SK'" name="trade_registry">
|
||||
<strong>Trade registry: </strong><t t-out="o.company_id.trade_registry"/>
|
||||
</p>
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
||||
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="l10n_sk_external_layout_standard" inherit_id="web.external_layout_standard">
|
||||
<xpath expr="//ul[@name='company_address_list']" position="inside">
|
||||
<li t-if="company.vat and company.account_fiscal_country_id.code == 'SK'">
|
||||
<t t-esc="company.country_id.vat_label or 'Tax ID'"/>:
|
||||
<span t-esc="company.vat"/>
|
||||
</li>
|
||||
<li t-if="company.company_registry and company.account_fiscal_country_id.code == 'SK'">
|
||||
ID: <span t-field="company.company_registry"/>
|
||||
</li>
|
||||
<li t-if="company.income_tax_id and company.account_fiscal_country_id.code == 'SK'">
|
||||
Tax ID: <span t-field="company.income_tax_id"/>
|
||||
</li>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="l10n_sk_external_layout_bold" inherit_id="web.external_layout_bold">
|
||||
<xpath expr="//ul[@name='company_address_list']" position="inside">
|
||||
<li t-if="company.vat and company.account_fiscal_country_id.code == 'SK'">
|
||||
<t t-esc="company.country_id.vat_label or 'Tax ID'"/>:
|
||||
<span t-esc="company.vat"/>
|
||||
</li>
|
||||
<li t-if="company.company_registry and company.account_fiscal_country_id.code == 'SK'">
|
||||
ID: <span t-field="company.company_registry"/>
|
||||
</li>
|
||||
<li t-if="company.income_tax_id and company.account_fiscal_country_id.code == 'SK'">
|
||||
Tax ID: <span t-field="company.income_tax_id"/>
|
||||
</li>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="l10n_sk_external_layout_boxed" inherit_id="web.external_layout_boxed">
|
||||
<xpath expr="//ul[@name='company_address_list']" position="inside">
|
||||
<li t-if="company.vat and company.account_fiscal_country_id.code == 'SK'">
|
||||
<t t-esc="company.country_id.vat_label or 'Tax ID'"/>:
|
||||
<span t-esc="company.vat"/>
|
||||
</li>
|
||||
<li t-if="company.company_registry and company.account_fiscal_country_id.code == 'SK'">
|
||||
ID: <span t-field="company.company_registry"/>
|
||||
</li>
|
||||
<li t-if="company.income_tax_id and company.account_fiscal_country_id.code == 'SK'">
|
||||
Tax ID: <span t-field="company.income_tax_id"/>
|
||||
</li>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="l10n_sk_external_layout_striped" inherit_id="web.external_layout_striped">
|
||||
<xpath expr="//ul[@name='company_address_list']" position="inside">
|
||||
<li t-if="company.vat and company.account_fiscal_country_id.code == 'SK'">
|
||||
<t t-esc="company.country_id.vat_label or 'Tax ID'"/>:
|
||||
<span t-esc="company.vat"/>
|
||||
</li>
|
||||
<li t-if="company.company_registry and company.account_fiscal_country_id.code == 'SK'">
|
||||
ID: <span t-field="company.company_registry"/>
|
||||
</li>
|
||||
<li t-if="company.income_tax_id and company.account_fiscal_country_id.code == 'SK'">
|
||||
Tax ID: <span t-field="company.income_tax_id"/>
|
||||
</li>
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="view_company_form_inherit_l10n_ck" model="ir.ui.view">
|
||||
<field name="name">res.company.form.inherit.l10n_ck</field>
|
||||
<field name="inherit_id" ref="base.view_company_form"/>
|
||||
<field name="model">res.company</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="currency_id" position="after">
|
||||
<field name="trade_registry" attrs="{'invisible': [('country_code', '!=', 'SK')]}"/>
|
||||
<field name="income_tax_id" attrs="{'invisible': [('country_code', '!=', 'SK')]}"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="res_partner_view_form_inherit_l10n_sk" model="ir.ui.view">
|
||||
<field name="name">res.partner.view.form.inherit.l10n.sk</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="account.view_partner_property_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='company_registry']" position="replace">
|
||||
<field name="company_registry" attrs="{'invisible': [('fiscal_country_codes', 'ilike', 'SK')]}"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='vat']" position="after">
|
||||
<field name="company_registry" attrs="{'invisible': [('fiscal_country_codes', 'not ilike', 'SK')]}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -324,7 +324,7 @@
|
||||
</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">
|
||||
<ul class="list-unstyled" name='company_address_list'>
|
||||
<li t-if="company.is_company_details_empty"><span t-field="company.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'>
|
||||
<div class="bg-light border-1 rounded h-100 d-flex flex-column align-items-center justify-content-center p-4 w-100 opacity-75 text-muted text-center">
|
||||
<strong>Company address block</strong>
|
||||
@@ -383,7 +383,7 @@
|
||||
<div class="col-6 text-end mb4">
|
||||
<div class="mt0 h4" t-if="company.report_header" t-field="company.report_header">Company tagline</div>
|
||||
<div name="company_address" class="float-end mb4">
|
||||
<ul class="list-unstyled">
|
||||
<ul class="list-unstyled" name="company_address_list">
|
||||
<li t-if="company.is_company_details_empty"><span t-field="company.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'>
|
||||
<div class="bg-light border-1 rounded h-100 d-flex flex-column align-items-center justify-content-center p-4 w-100 opacity-75 text-muted text-center">
|
||||
<strong>Company address block</strong>
|
||||
@@ -439,7 +439,7 @@
|
||||
<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">
|
||||
<ul class="list-unstyled" name='company_address_list'>
|
||||
<li t-if="company.is_company_details_empty"><span t-field="company.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'>
|
||||
<div class="bg-light border-1 rounded h-100 d-flex flex-column align-items-center justify-content-center p-4 w-100 opacity-75 text-muted text-center">
|
||||
<strong>Company address block</strong>
|
||||
@@ -506,7 +506,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-6" name="company_address">
|
||||
<ul class="list-unstyled">
|
||||
<ul class="list-unstyled" name="company_address_list">
|
||||
<li t-if="company.is_company_details_empty"><span t-field="company.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'>
|
||||
<div class="bg-light border-1 rounded h-100 d-flex flex-column align-items-center justify-content-center p-4 w-100 opacity-75 text-muted text-center">
|
||||
<strong>Company address block</strong>
|
||||
|
||||
Reference in New Issue
Block a user