Skip to content

Commit

Permalink
FIX avoid breaking inheritance of report.minimal_layout
Browse files Browse the repository at this point in the history
  • Loading branch information
eLBati committed Sep 4, 2015
1 parent 24d0b1d commit 3d1618a
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 106 deletions.
26 changes: 0 additions & 26 deletions account_vat_period_end_statement/static/src/js/subst.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,6 @@
<openerp>
<data>

<template id="report.minimal_layout">
<t t-raw="'&lt;base href=%s&gt;' % base_url"/>
&lt;!DOCTYPE html&gt;
<html style="height: 0;">
<head>
<link href="/report/static/src/css/reset.min.css" rel="stylesheet"/>
<link href="/web/static/lib/bootstrap/css/bootstrap.css" rel="stylesheet"/>
<link href="/website/static/src/css/website.css" rel="stylesheet"/>
<link href="/web/static/lib/fontawesome/css/font-awesome.css" rel="stylesheet"/>
<link rel="stylesheet" href="/l10n_it_vat_registries/static/src/css/l10n_it_vat_registries.css"/>
<style type='text/css'><t t-raw="css"/></style>
<t t-if="subst is True">
<script src='/account_vat_period_end_statement/static/src/js/subst.js'></script>
</t>
</head>
<body class="container" onload="subst()">
<t t-raw="body"/>
</body>
</html>
</template>

<!--
Document
-->
Expand Down Expand Up @@ -244,7 +223,9 @@ Main
-->
<template id="report_vatperiodendstatement">
<t t-call="report.html_container">
<t t-set="count_fiscal_page_base" t-value="fiscal_page_base"/>
<!-- not used
<t t-set="l10n_it_count_fiscal_page_base" t-value="fiscal_page_base"/>
-->
<t t-set="title" t-value="'Vat End Period Statement'"/>
<t t-foreach="doc_ids" t-as="doc_id">
<t t-set="statement" t-value="statement(doc_id)"/>
Expand Down
Empty file.
39 changes: 38 additions & 1 deletion l10n_it_account/reports/account_reports_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

</div>
<div class="col-xs-4 col-xs-offset-4 text-right">
<span style="display: none;" id="count_fiscal_page_base" t-esc="count_fiscal_page_base" />
<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><span t-esc="context_timestamp(datetime.datetime.now()).strftime('%Y')"/></li>
<li>/</li>
Expand All @@ -75,5 +75,42 @@
</div>
</template>


<template id="minimal_layout" inherit_id="report.minimal_layout">
<xpath expr="//head" position="inside">
<link rel="stylesheet" href="/l10n_it_vat_registries/static/src/css/l10n_it_vat_registries.css"/>
</xpath>
<xpath expr="//head/t/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]);

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]];
}
}
}
</script>
</xpath>
</template>
</data>
</openerp>
26 changes: 0 additions & 26 deletions l10n_it_vat_registries/static/src/js/subst.js

This file was deleted.

3 changes: 2 additions & 1 deletion l10n_it_vat_registries/vat_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ def set_context(self, objects, data, ids, report_type=None):
'registry_type': data['form'].get('registry_type'),
'only_totals': data['form'].get('only_totals'),
'tax_registry_name': data['form'].get('tax_registry_name'),
'fiscal_page_base': data['form'].get('fiscal_page_base'),
'l10n_it_count_fiscal_page_base': data['form'].get(
'fiscal_page_base'),
})
return super(Parser, self).set_context(
objects, data, ids, report_type=report_type)
Expand Down
30 changes: 0 additions & 30 deletions l10n_it_vat_registries/views/report_registro_iva.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,10 @@
<openerp>
<data>

<!-- template id="layout" inherit_id="report.minimal_layout">
<xpath expr="//head" position="inside">
<link rel="stylesheet" href="/l10n_it_vat_registries/static/src/css/l10n_it_vat_registries.css"/>
<script src='/l10n_it_vat_registries/static/src/js/subst.js'></script>
</xpath>
</template -->


<template id="report.minimal_layout">
<t t-raw="'&lt;base href=%s&gt;' % base_url"/>
&lt;!DOCTYPE html&gt;
<html style="height: 0;">
<head>
<link href="/report/static/src/css/reset.min.css" rel="stylesheet"/>
<link href="/web/static/lib/bootstrap/css/bootstrap.css" rel="stylesheet"/>
<link href="/website/static/src/css/website.css" rel="stylesheet"/>
<link href="/web/static/lib/fontawesome/css/font-awesome.css" rel="stylesheet"/>
<link rel="stylesheet" href="/l10n_it_vat_registries/static/src/css/l10n_it_vat_registries.css"/>
<style type='text/css'><t t-raw="css"/></style>
<t t-if="subst is True">
<script src='/l10n_it_vat_registries/static/src/js/subst.js'></script>
</t>
</head>
<body class="container" onload="subst()">
<t t-raw="body"/>
</body>
</html>
</template>



<template id="report_registro_iva">
<t t-call="report.html_container">
<!-- t t-set="count_fiscal_page_base" t-value="fiscal_page_base"/ -->
<t t-if="registry_type == 'customer'">
<t t-set="title" t-value="'Registro Iva Vendite'"/>
</t>
Expand Down

0 comments on commit 3d1618a

Please sign in to comment.