Browse Source

account_partner_aged_statement_webkit - try to get one partner report per line

pull/9/head
Marc Cassuto 11 years ago
committed by Maxime Chambreuil
parent
commit
f3324bddc5
  1. 31
      account_partner_aged_statement_webkit/report/partner_aged_statement.mako
  2. 9
      account_partner_aged_statement_webkit/report/partner_aged_statement_report.py

31
account_partner_aged_statement_webkit/report/partner_aged_statement.mako

@ -4,30 +4,14 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
.overflow_ellipsis {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.open_invoice_previous_line {
font-style: italic;
}
.percent_line {
font-style: italic;
}
.amount {
text-align:right;
}
.classif_title {
text-align:right;
}
.total{
font-weight:bold;
}
.break{
display: block;
clear: both;
page-break-after: always;
}
${css}
</style>
@ -65,7 +49,7 @@
%else:
<div class="title">${_('Aged Balance')}</div>
<br>
%for l in get_lines(data['form']):
%for l in get_lines(data['form'], partner):
%if l:
<table class=basic_table style="width: 100%;">
<tr>
@ -176,7 +160,8 @@
%endfor ## for line in getLines60(partner)
</table>
%endif ## if getLines60(partner)
%endif ## if (partner.credit + partner.debit == 0)
%endif ## if (partner.credit + partner.debit == 0
<div class="break"></div>
%endfor ## for partner in objects
</body>
</html>

9
account_partner_aged_statement_webkit/report/partner_aged_statement_report.py

@ -41,7 +41,7 @@ class PartnerAgedTrialReport(aged_trial_report):
current_user = self.localcontext["user"]
self._company = current_user.company_id
if self.localcontext.get("active_model", "") == "res.partner":
self._partner = self.localcontext["active_id"]
self._partners = self.localcontext["active_ids"]
self.localcontext.update({
'message': self._message,
'getLines30': self._lines_get30,
@ -177,10 +177,11 @@ class PartnerAgedTrialReport(aged_trial_report):
data["form"] = form
res = super(PartnerAgedTrialReport, self).set_context(
objects, data, ids, report_type=report_type)
if self._partner is not None:
self.query = "{0} AND l.partner_id = {1}".format(
if self._partners is not None:
self.query = "{0} AND l.partner_id in ({1})".format(
self.query,
self._partner)
", ".join(str(int(i)) for i in self._partners),
)
return res

Loading…
Cancel
Save