Browse Source

change the query based on current partner to get partner lines

pull/9/head
Vincent Vinet 10 years ago
committed by Maxime Chambreuil
parent
commit
791cd7323e
  1. 16
      account_partner_aged_statement_webkit/report/partner_aged_statement_report.py

16
account_partner_aged_statement_webkit/report/partner_aged_statement_report.py

@ -177,14 +177,26 @@ class PartnerAgedTrialReport(aged_trial_report):
data["form"] = form
res = super(PartnerAgedTrialReport, self).set_context(
objects, data, ids, report_type=report_type)
if self._partners is not None:
self.query = "{0} AND l.partner_id in ({1})".format(
self.orig_query = self.query
if self._partner is not None:
self.query = "{0} AND l.partner_id = {1}".format(
self.query,
", ".join(str(int(i)) for i in self._partners),
)
return res
def _get_lines(self, form, partner):
# self.query is used to get the lines in super()._get_lines
self.query = "{0} AND l.partner_id = {1}".format(
self.orig_query,
partner.id,
)
res = super(PartnerAgedTrialReport, self)._get_lines(form)
self.query = self.orig_query
return res
report_sxw.report_sxw(
'report.webkit.partner_aged_statement_report',
'res.partner',

Loading…
Cancel
Save