Browse Source

[IMP] mis_builder: remove _ from some method names

because they are part of the public API (though not usable over rpc)
pull/189/head
Stéphane Bidoul 9 years ago
parent
commit
6fdb58ce23
  1. 9
      mis_builder/models/mis_report.py
  2. 6
      mis_builder/models/mis_report_instance.py

9
mis_builder/models/mis_report.py

@ -768,7 +768,7 @@ class MisReport(models.Model):
# TODO: kpi name cannot be start with query name
@api.multi
def _prepare_kpi_matrix(self):
def prepare_kpi_matrix(self):
self.ensure_one()
kpi_matrix = KpiMatrix(self.env)
for kpi in self.kpi_ids:
@ -776,7 +776,7 @@ class MisReport(models.Model):
return kpi_matrix
@api.multi
def _prepare_aep(self, company):
def prepare_aep(self, company):
self.ensure_one()
aep = AEP(self.env)
for kpi in self.kpi_ids:
@ -853,7 +853,7 @@ class MisReport(models.Model):
return res
@api.multi
def _declare_and_compute_period(self, kpi_matrix,
def declare_and_compute_period(self, kpi_matrix,
col_key,
col_description,
col_comment,
@ -866,7 +866,8 @@ class MisReport(models.Model):
get_additional_query_filter=None):
""" Evaluate a report for a given period, populating a KpiMatrix.
:param kpi_matrix: the KpiMatrix object to be populated
:param kpi_matrix: the KpiMatrix object to be populated created
with prepare_kpi_matrix()
:param col_key: the period key to use when populating the KpiMatrix
:param aep: an AccountingExpressionProcessor instance created
using _prepare_aep()

6
mis_builder/models/mis_report_instance.py

@ -353,8 +353,8 @@ class MisReportInstance(models.Model):
@api.multi
def _compute_matrix(self):
self.ensure_one()
aep = self.report_id._prepare_aep(self.company_id)
kpi_matrix = self.report_id._prepare_kpi_matrix()
aep = self.report_id.prepare_aep(self.company_id)
kpi_matrix = self.report_id.prepare_kpi_matrix()
for period in self.period_ids:
if period.date_from == period.date_to:
comment = self._format_date(period.date_from)
@ -362,7 +362,7 @@ class MisReportInstance(models.Model):
date_from = self._format_date(period.date_from)
date_to = self._format_date(period.date_to)
comment = _('from %s to %s') % (date_from, date_to)
self.report_id._declare_and_compute_period(
self.report_id.declare_and_compute_period(
kpi_matrix,
period.id,
period.name,

Loading…
Cancel
Save