[IMP] mis_builder: cosmetics
parent
39917120e5
commit
5d01916d4d
|
@ -12,9 +12,9 @@
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<template id="assets_report" inherit_id="report.assets_common">
|
<template id="assets_report" inherit_id="report.assets_common">
|
||||||
<xpath expr="." position="inside">
|
<xpath expr="." position="inside">
|
||||||
<link href="/mis_builder/static/src/css/report.css" rel="stylesheet"/>
|
<link href="/mis_builder/static/src/css/report.css" rel="stylesheet"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
@ -26,50 +26,50 @@
|
||||||
<template id="report_mis_report_instance">
|
<template id="report_mis_report_instance">
|
||||||
<t t-call="report.html_container">
|
<t t-call="report.html_container">
|
||||||
<t t-foreach="docs" t-as="o">
|
<t t-foreach="docs" t-as="o">
|
||||||
<t t-call="report.internal_layout">
|
<t t-call="report.internal_layout">
|
||||||
<t t-set="matrix" t-value="o._compute_matrix()"/>
|
<t t-set="matrix" t-value="o._compute_matrix()"/>
|
||||||
<t t-set="style_obj" t-value="o.env['mis.report.style']"/>
|
<t t-set="style_obj" t-value="o.env['mis.report.style']"/>
|
||||||
<div class="page">
|
<div class="page">
|
||||||
<h2><span t-field="o.name" /> - <span t-field="o.company_id.name" /></h2>
|
<h2><span t-field="o.name" /> - <span t-field="o.company_id.name" /></h2>
|
||||||
<div class="mis_table">
|
<div class="mis_table">
|
||||||
<div class="mis_thead">
|
<div class="mis_thead">
|
||||||
<div class="mis_row">
|
<div class="mis_row">
|
||||||
<div class="mis_cell mis_collabel"></div>
|
<div class="mis_cell mis_collabel"></div>
|
||||||
<t t-foreach="matrix.iter_cols()" t-as="col">
|
<t t-foreach="matrix.iter_cols()" t-as="col">
|
||||||
<div class="mis_cell mis_collabel">
|
<div class="mis_cell mis_collabel">
|
||||||
<t t-esc="col.description"/>
|
<t t-esc="col.description"/>
|
||||||
<t t-if="col.comment">
|
<t t-if="col.comment">
|
||||||
<br/>
|
<br/>
|
||||||
<t t-esc="col.comment"/>
|
<t t-esc="col.comment"/>
|
||||||
</t>
|
</t>
|
||||||
</div>
|
</div>
|
||||||
<!-- add empty cells because we have no colspan with css tables -->
|
<!-- add empty cells because we have no colspan with css tables -->
|
||||||
<t t-foreach="list(col.iter_subcols())[1:]" t-as="subcol">
|
<t t-foreach="list(col.iter_subcols())[1:]" t-as="subcol">
|
||||||
<div class="mis_cell mis_collabel"></div>
|
<div class="mis_cell mis_collabel"></div>
|
||||||
</t>
|
</t>
|
||||||
</t>
|
</t>
|
||||||
</div>
|
</div>
|
||||||
<div class="mis_row">
|
<div class="mis_row">
|
||||||
<div class="mis_cell mis_collabel"></div>
|
<div class="mis_cell mis_collabel"></div>
|
||||||
<t t-foreach="matrix.iter_subcols()" t-as="subcol">
|
<t t-foreach="matrix.iter_subcols()" t-as="subcol">
|
||||||
<div class="mis_cell mis_collabel">
|
<div class="mis_cell mis_collabel">
|
||||||
<t t-esc="subcol.description"/>
|
<t t-esc="subcol.description"/>
|
||||||
<t t-if="subcol.comment">
|
<t t-if="subcol.comment">
|
||||||
<br/>
|
<br/>
|
||||||
<t t-esc="subcol.comment"/>
|
<t t-esc="subcol.comment"/>
|
||||||
</t>
|
</t>
|
||||||
</div>
|
</div>
|
||||||
</t>
|
</t>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="mis_tbody">
|
<div class="mis_tbody">
|
||||||
<div t-foreach="matrix.iter_rows()" t-as="row" class="mis_row">
|
<div t-foreach="matrix.iter_rows()" t-as="row" class="mis_row">
|
||||||
<div t-att-style="style_obj.to_css_style(row.style_props)" class="mis_cell mis_rowlabel">
|
<div t-att-style="style_obj.to_css_style(row.style_props)" class="mis_cell mis_rowlabel">
|
||||||
<t t-esc="row.description"/>
|
<t t-esc="row.description"/>
|
||||||
<t t-if="row.comment">
|
<t t-if="row.comment">
|
||||||
<br/>
|
<br/>
|
||||||
<t t-esc="row.comment"/>
|
<t t-esc="row.comment"/>
|
||||||
</t>
|
</t>
|
||||||
</div>
|
</div>
|
||||||
<t t-foreach="row.iter_cells()" t-as="cell">
|
<t t-foreach="row.iter_cells()" t-as="cell">
|
||||||
<div t-att-style="cell and style_obj.to_css_style(cell.style_props) or ''" class="mis_cell mis_amount">
|
<div t-att-style="cell and style_obj.to_css_style(cell.style_props) or ''" class="mis_cell mis_amount">
|
||||||
|
@ -81,7 +81,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</t>
|
</t>
|
||||||
</t>
|
</t>
|
||||||
</t>
|
</t>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -108,9 +108,9 @@ class MisBuilderXslx(ReportXlsx):
|
||||||
continue
|
continue
|
||||||
cell_xlsx_style = style_obj.to_xlsx_style(cell.style_props)
|
cell_xlsx_style = style_obj.to_xlsx_style(cell.style_props)
|
||||||
cell_xlsx_style['align'] = 'right'
|
cell_xlsx_style['align'] = 'right'
|
||||||
kpi_format = workbook.add_format(cell_xlsx_style)
|
cell_format = workbook.add_format(cell_xlsx_style)
|
||||||
val = cell.val / float(cell.style_props.get('divider', 1))
|
val = cell.val / float(cell.style_props.get('divider', 1))
|
||||||
sheet.write(row_pos, col_pos, val, kpi_format)
|
sheet.write(row_pos, col_pos, val, cell_format)
|
||||||
col_width[col_pos] = max(col_width[col_pos],
|
col_width[col_pos] = max(col_width[col_pos],
|
||||||
len(cell.val_rendered or ''))
|
len(cell.val_rendered or ''))
|
||||||
row_pos += 1
|
row_pos += 1
|
||||||
|
|
Loading…
Reference in New Issue