Browse Source

[IMP][mis_builder] Add default style for mis_builder report.

pull/189/head
Adrien Peiffer (ACSONE) 9 years ago
parent
commit
161e3a34b2
  1. 60
      mis_builder/report/report_mis_report_instance.xml
  2. 19
      mis_builder/static/src/css/custom.css
  3. 47
      mis_builder/static/src/css/report.css
  4. 5
      mis_builder/views/mis_builder.xml

60
mis_builder/report/report_mis_report_instance.xml

@ -4,21 +4,23 @@
<template id="report_mis_report_instance">
<t t-call="report.html_container">
<t t-set="data_report_margin_top" t-value="12"/>
<t t-set="data_report_header_spacing" t-value="9"/>
<t t-set="data_report_dpi" t-value="110"/>
<t t-foreach="docs" t-as="o">
<t t-call="report.internal_layout">
<div class="page">
<h2 t-field="o.name"></h2>
<table class="table table-condensed">
<thead>
<h2><span t-field="o.name" /> - <span t-field="o.company_id.name" /></h2>
<div class="mis_table">
<div class="mis_thead">
<t t-foreach="docs_computed[o.id]['header']" t-as="h">
<tr>
<th>
<div class="mis_row labels">
<div class="mis_cell">
<div>
<t t-esc="h_value['kpi_name']"/>
</div>
</th>
</div>
<t t-foreach="h_value['cols']" t-as="col">
<th class="text-center" t-att-colspan="col.get('colspan', 1)">
<div class="mis_cell amount" t-att-colspan="col.get('colspan', 1)">
<div>
<t t-esc="col['name']"/>
</div>
@ -27,31 +29,47 @@
<t t-esc="col['date']"/>
</div>
</t>
</th>
</div>
</t>
</tr>
</div>
</t>
</thead>
<tbody>
<tr t-foreach="docs_computed[o.id]['content']" t-as="c">
<td t-att-style="c_value['default_style']">
</div>
<div class="mis_tbody">
<div t-foreach="docs_computed[o.id]['content']" t-as="c" class="mis_row lines">
<div t-att-style="c_value['default_style']" class="mis_cell">
<div class="text-left">
<t t-esc="c_value['kpi_name']"/>
</div>
</td>
</div>
<t t-foreach="c_value['cols']" t-as="value">
<td t-att-style="c_value['default_style']">
<div t-att-style="c_value['default_style']" class="mis_cell">
<div t-att-style="value_value.get('style')" class="text-right">
<t t-esc="value_value['val_r']"/>
</div>
</td>
</t>
</tr>
</tbody>
</table>
</div>
</t>
</div>
</div>
</div>
</div>
</t>
<div class="footer">
<div style="border-top: 1px solid black;">
<div class="col-xs-3">
<span t-esc="context_timestamp(datetime.datetime.now()).strftime('%Y-%m-%d %H:%M')"/>
</div>
<div class="col-xs-2 col-xs-offset-2 text-center">
</div>
<div class="col-xs-2 col-xs-offset-3 text-right">
<ul class="list-inline">
Page
<li><span class="page"/></li>
<li>of</li>
<li><span class="topage"/></li>
</ul>
</div>
</div>
</div>
</t>
</template>

19
mis_builder/static/src/css/custom.css

@ -15,3 +15,22 @@
.openerp .oe_mis_builder_buttons {
padding-bottom: 10px;
}
.openerp .mis_builder_ralign {
text-align: right;
}
.openerp .mis_builder a {
/* we don't want the link color, to respect user styles */
color: inherit;
}
.openerp .mis_builder a:hover {
/* underline links on hover to give a visual cue */
text-decoration: underline;
}
.openerp .oe_mis_builder_buttons {
padding-bottom: 10px;
}

47
mis_builder/static/src/css/report.css

@ -0,0 +1,47 @@
.mis_table {
display: table ;
width: 100%;
table-layout: fixed ;
}
.mis_row {
display: table-row ;
page-break-inside: avoid;
}
.mis_cell {
display: table-cell ;
page-break-inside: avoid;
}
.mis_thead {
display: table-header-group ;
}
.mis_tbody {
display: table-row-group ;
}
.mis_row.labels {
background-color:#F0F0F0 ;
}
.mis_table, .mis_table .mis_row {
border-left:0px;
border-right:0px;
text-align:left;
padding-right:3px;
padding-left:3px;
padding-top:2px;
padding-bottom:2px;
border-collapse:collapse;
}
.mis_table .mis_row.labels, .mis_table .mis_row.lines {
border-color:grey ;
border-bottom:1px solid lightGrey ;
}
.mis_table .mis_cell {
word-wrap: break-word;
}
.mis_cell.amount {
word-wrap:normal;
text-align:right;
}
.mis_table .mis_cell{
padding-left: 5px;
/* border-right:1px solid lightGrey; uncomment to active column lines */
}

5
mis_builder/views/mis_builder.xml

@ -8,6 +8,11 @@
<script type="text/javascript" src="/mis_builder/static/src/js/mis_builder.js"></script>
</xpath>
</template>
<template id="assets_report" inherit_id="report.assets_common">
<xpath expr="." position="inside">
<link href="/mis_builder/static/src/css/report.css" rel="stylesheet"/>
</xpath>
</template>
<record model="ir.ui.view" id="mis_report_view_tree">
<field name="name">mis.report.view.tree</field>

Loading…
Cancel
Save