Skip to content

Commit

Permalink
porting l10n_it_account to 12
Browse files Browse the repository at this point in the history
  • Loading branch information
eLBati authored and TheMule71 committed Nov 11, 2022
1 parent 099b7a5 commit 4310145
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 65 deletions.
5 changes: 0 additions & 5 deletions l10n_it_account/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# Copyright 2010 OpenERP Italian Community
# (<http://www.openerp-italia.org>).
# Copyright 2014 Associazione Odoo Italia
# (<http://www.openerp-italia.org>).
# Copyright 2015-2017 Agile Business Group (<http://www.agilebg.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
7 changes: 4 additions & 3 deletions l10n_it_account/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@
# Copyright 2015-2017 Agile Business Group (<http://www.agilebg.com>)
# Copyright 2015 Link It Spa (<http://www.linkgroup.it/>)
# Copyright 2018 Sergio Zanchetta (Associazione PNLUG - Gruppo Odoo)
# Copyright 2018 Lorenzo Battistini <https://github.com/eLBati>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
'name': 'Italian Localization - Account',
'version': '11.0.1.2.0',
'version': '12.0.1.0.0',
'category': 'Hidden',
'author': "Agile Business Group, Abstract, "
"Odoo Community Association (OCA)",
'website': 'https://github.com/OCA/l10n-italy/tree/11.0/l10n_it_account',
'website': 'https://github.com/OCA/l10n-italy/tree/12.0/l10n_it_account',
'license': 'AGPL-3',
"depends": [
'account_fiscal_year',
'account_tax_balance',
'web',
],
"data": [
'views/account_setting.xml',
'views/account_view.xml',
'views/account_menuitem.xml',
'views/partner_view.xml',
'views/product_view.xml',
Expand Down
1 change: 0 additions & 1 deletion l10n_it_account/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Copyright 2017 Agile Business Group (<http://www.agilebg.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import account_tax
1 change: 0 additions & 1 deletion l10n_it_account/models/account_tax.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Copyright 2017 Agile Business Group (<http://www.agilebg.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import models, fields
Expand Down
96 changes: 51 additions & 45 deletions l10n_it_account/reports/account_reports_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,80 +45,86 @@

<div class="header">
<div class="row">
<div class="col-xs-4 ">
<div class="col-xs-4">
<h3><span t-esc="company.name"/></h3>
<span t-esc="company.street" class=""/><br/>
<span t-esc="company.zip" class=""/> - <span t-esc="company.city" class=""/> - <span t-esc="company.state_id.code" class=""/><br/>
<span class="text-right">Vat:</span><span t-esc="company.partner_id.vat" class=""/><br/>
<span class="text-right">TIN: </span><span t-esc="company.partner_id.vat" class=""/><br/>
</div>
<div class="col-xs-4 col-xs-offset-4 text-right">
<div class="col-xs-4 col-xs-offset-4 text-right" style="margin-left:10px">
<h3 t-esc="title"/>
</div>
</div>
</div>
<t t-raw="0" />
<div class="footer">
<div class="row">
<div class="col-xs-4">
<!-- The variable "l10n_it_count_fiscal_year" shall be used to set manually the fiscal year
in the report footer. Define it in you report as follows:
<t t-set="l10n_it_count_fiscal_page_base" t-value="<value>"/>
-->
</div>
<div class="col-xs-4 col-xs-offset-4 text-right">
<!-- The variable "l10n_it_count_fiscal_year" shall be used to set manually the fiscal year
in the report footer. Define it in you report as follows:
<t t-set="l10n_it_count_fiscal_year" t-value="<value>"/>
The variable "l10n_it_count_fiscal_page_base" is also available, to set the "Last printed page"
-->
<div class="text-center">
<div class="text-muted">
<span style="display: none;" id="l10n_it_count_fiscal_page_base" t-esc="l10n_it_count_fiscal_page_base" />
<ul class="list-inline">Pag:
<li>
<t t-if="l10n_it_count_fiscal_year">
<span t-esc="l10n_it_count_fiscal_year"/>
</t>
<t t-if="not l10n_it_count_fiscal_year">
<li><span t-esc="context_timestamp(datetime.datetime.now()).strftime('%Y')"/></li>
</t>
</li>
<li>/</li>
<li><span class="page"/></li>
</ul>
</div>
</div>
Page:
<t t-if="l10n_it_count_fiscal_year">
<span t-esc="l10n_it_count_fiscal_year"/>
</t>
<t t-if="not l10n_it_count_fiscal_year">
<li><span t-esc="context_timestamp(datetime.datetime.now()).strftime('%Y')"/></li>
</t>
<span> / </span>
<span class="page"/>
</div>
</div>
</div>
</template>


<template id="minimal_layout" inherit_id="web.minimal_layout">
<xpath expr="//head" position="inside">
<link rel="stylesheet" href="/l10n_it_vat_registries/static/src/css/l10n_it_vat_registries.css"/>
<link rel="stylesheet" href="/l10n_it_account/static/src/css/l10n_it_account.css"/>
</xpath>
<xpath expr="//head/t/script" position="replace">
<xpath expr="//head/t[5]/script" position="replace">
<script>
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=['frompage', 'topage', 'page', 'webpage', 'section', 'subsection', 'subsubsection'];
for (var i in x) {
var y = document.getElementsByClassName(x[i]);
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]);
}

// l10n_it_account
fiscal_page_base = 0
if (document.getElementById('l10n_it_count_fiscal_page_base')!=null){
if (document.getElementById('l10n_it_count_fiscal_page_base').innerHTML){
fiscal_page_base = parseInt(document.getElementById('l10n_it_count_fiscal_page_base').innerHTML);
}
}

for (var j=0; j&lt;y.length; ++j)
if (x[i] == 'page') {
y[j].textContent = parseInt(eval(vars[x[i]]) + fiscal_page_base);
}
else {
y[j].textContent = vars[x[i]];
}
var fromPage = document.getElementsByClassName('page');
for(var j = 0; j&lt;fromPage.length; j++)
fromPage[j].textContent = parseInt(eval(vars['sitepage']) + fiscal_page_base);
var toPage = document.getElementsByClassName('topage');
for(var j = 0; j&lt;toPage.length; j++)
toPage[j].textContent = parseInt(eval(vars['sitepage']) + fiscal_page_base);

var index = vars['webpage'].split('.', 4)[3]
var header = document.getElementById('minimal_layout_report_headers');
if(header !== null){
var companyHeader = header.children[index];
header.textContent = '';
header.appendChild(companyHeader);
}
var footer = document.getElementById('minimal_layout_report_footers');
if(footer !== null){
var companyFooter = footer.children[index];
footer.textContent = '';
footer.appendChild(companyFooter);
}
}
</script>
</script>
</xpath>
</template>
</data>
Expand Down
32 changes: 32 additions & 0 deletions l10n_it_account/static/src/css/l10n_it_account.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
table {border: 0px;}
thead {background: #F5F5F5;}


.left_with_line {
text-align:left; vertical-align:text-top; border-top:1px solid #A1A1A1; padding:5px;
}
.right_with_line {
text-align:right; vertical-align:text-top; border-top:1px solid #A1A1A1; padding:5px;
}
.left_without_line {
text-align:left; vertical-align:text-top; padding:5px;
}
.right_without_line {
text-align:right; vertical-align:text-top; padding:5px;
}
.left_with_line_bottom {
text-align:left; vertical-align:text-top; border-bottom:1px solid #A1A1A1; padding:5px;
}
.right_with_line_bottom {
text-align:right; vertical-align:text-top; border-bottom:1px solid #A1A1A1; padding:5px;
}
.left_without_line_bold {
text-align:left; vertical-align:text-top; padding:5px; font-weight: bold;
}
.right_without_line_bold {
text-align:right; vertical-align:text-top; padding:5px; font-weight: bold; white-space: nowrap;
}

.first_th_row {
border-style:solid;border-width:1px;border-color:#A1A1A1; background: #fff;
}
10 changes: 0 additions & 10 deletions l10n_it_account/views/account_view.xml

This file was deleted.

0 comments on commit 4310145

Please sign in to comment.