Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][IMP] mis_builder_custom_reports: module improvements #87

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mis_builder_custom_reports/models/kpimatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def sum_row(self):
total = 0
for cell in cells:
if cell and cell.val not in (None, "AccountingNone"):
total += float(cell.val)
total += float(cell.val or 0)
return total


Expand Down
29 changes: 29 additions & 0 deletions mis_builder_custom_reports/report/mis_report_instance_qweb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
/>
</div>
</div>
<div class="row">
<div class="col-12">
<span t-field="company_id.cnpj_cpf" />
</div>
</div>
<div class="row">
<div class="col-12">
<span
Expand Down Expand Up @@ -81,6 +86,30 @@
or row.style_props.hide_always) and row.row_id != "check"
</attribute>
</xpath>
<xpath
expr="//div[hasclass('mis_tbody')]/t[@t-as='row']/div[hasclass('mis_row')]//div[hasclass('mis_amount')]/t"
position="replace"
>
<t t-if="cell.row.kpi.type == 'str'">
<span />
</t>
<t t-elif="cell and cell.val_rendered">
<t t-if="cell.val_rendered in ['', '0']">
<span>-</span>
</t>
<t t-elif="float(cell.val or 0) &lt; 0">
<span>(</span>
<t t-esc="cell.val_rendered.replace('‑', '')" />
<span>)</span>
</t>
<t t-else="">
<t t-esc="cell.val_rendered" />
</t>
</t>
<t t-else="">
<span>-</span>
</t>
</xpath>
<xpath expr="//div[@class='page']/h3" position="after">
<div
t-attf-class="footer o_standard_footer o_company_#{company_id.id}_layout"
Expand Down
4 changes: 4 additions & 0 deletions mis_builder_custom_reports/static/src/css/report.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@
display: table-cell;
vertical-align: middle;
}
.mis_table .mis_row {
border-color: none;
border-bottom: none;
}
Loading