Browse Source

account_partner_aged_statement_webkit - try to get one partner report per line

pull/9/head
Marc Cassuto 10 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"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<style type="text/css"> <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{ .total{
font-weight:bold; font-weight:bold;
} }
.break{
display: block;
clear: both;
page-break-after: always;
}
${css} ${css}
</style> </style>
@ -65,7 +49,7 @@
%else: %else:
<div class="title">${_('Aged Balance')}</div> <div class="title">${_('Aged Balance')}</div>
<br> <br>
%for l in get_lines(data['form']):
%for l in get_lines(data['form'], partner):
%if l: %if l:
<table class=basic_table style="width: 100%;"> <table class=basic_table style="width: 100%;">
<tr> <tr>
@ -176,7 +160,8 @@
%endfor ## for line in getLines60(partner) %endfor ## for line in getLines60(partner)
</table> </table>
%endif ## if getLines60(partner) %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 %endfor ## for partner in objects
</body> </body>
</html> </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"] current_user = self.localcontext["user"]
self._company = current_user.company_id self._company = current_user.company_id
if self.localcontext.get("active_model", "") == "res.partner": if self.localcontext.get("active_model", "") == "res.partner":
self._partner = self.localcontext["active_id"]
self._partners = self.localcontext["active_ids"]
self.localcontext.update({ self.localcontext.update({
'message': self._message, 'message': self._message,
'getLines30': self._lines_get30, 'getLines30': self._lines_get30,
@ -177,10 +177,11 @@ class PartnerAgedTrialReport(aged_trial_report):
data["form"] = form data["form"] = form
res = super(PartnerAgedTrialReport, self).set_context( res = super(PartnerAgedTrialReport, self).set_context(
objects, data, ids, report_type=report_type) 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.query,
self._partner)
", ".join(str(int(i)) for i in self._partners),
)
return res return res

Loading…
Cancel
Save