Browse Source

correct comparison function name call. correct drill_down

pull/90/head
Laetitia Gangloff 10 years ago
committed by Stéphane Bidoul
parent
commit
05b6a04bb0
  1. 10
      mis_builder/models/aep.py
  2. 9
      mis_builder/models/mis_builder.py

10
mis_builder/models/aep.py

@ -195,10 +195,10 @@ class AccountingExpressionProcessor(object):
"""Test if an string contains an accounting variable.""" """Test if an string contains an accounting variable."""
return bool(cls.ACC_RE.search(expr)) return bool(cls.ACC_RE.search(expr))
def get_aml_domain_for_expr(self, expr,
def get_aml_domain_for_expr(self, cr, uid, expr,
date_from, date_to, date_from, date_to,
period_from, period_to, period_from, period_to,
target_move):
target_move, context=None):
""" Get a domain on account.move.line for an expression. """ Get a domain on account.move.line for an expression.
Prerequisite: done_parsing() must have been invoked. Prerequisite: done_parsing() must have been invoked.
@ -221,9 +221,11 @@ class AccountingExpressionProcessor(object):
aml_domains.append(expression.normalize_domain(aml_domain)) aml_domains.append(expression.normalize_domain(aml_domain))
if mode not in date_domain_by_mode: if mode not in date_domain_by_mode:
date_domain_by_mode[mode] = \ date_domain_by_mode[mode] = \
self.get_aml_domain_for_dates(date_from, date_to,
self.get_aml_domain_for_dates(cr, uid,
date_from, date_to,
period_from, period_to, period_from, period_to,
mode, target_move)
mode, target_move,
context=context)
return expression.OR(aml_domains) + \ return expression.OR(aml_domains) + \
expression.OR(date_domain_by_mode.values()) expression.OR(date_domain_by_mode.values())

9
mis_builder/models/mis_builder.py

@ -495,12 +495,13 @@ class MisReportInstancePeriod(orm.Model):
aep.done_parsing(cr, uid, this.report_instance_id.root_account, aep.done_parsing(cr, uid, this.report_instance_id.root_account,
context=context) context=context)
domain = aep.get_aml_domain_for_expr( domain = aep.get_aml_domain_for_expr(
expr,
cr, uid, expr,
this.date_from, this.date_to, this.date_from, this.date_to,
this.period_from, this.period_to, this.period_from, this.period_to,
this.report_instance_id.target_move)
this.report_instance_id.target_move,
context=context)
return { return {
'name': expr + ' - ' + self.name,
'name': expr + ' - ' + this.name,
'domain': domain, 'domain': domain,
'type': 'ir.actions.act_window', 'type': 'ir.actions.act_window',
'res_model': 'account.move.line', 'res_model': 'account.move.line',
@ -849,7 +850,7 @@ class MisReportInstance(orm.Model):
# add comparison values # add comparison values
for kpi in r.report_id.kpi_ids: for kpi in r.report_id.kpi_ids:
rows_by_kpi_name[kpi.name]['cols'].append({ rows_by_kpi_name[kpi.name]['cols'].append({
'val_r': kpi_obj.render_comparison(
'val_r': kpi_obj._render_comparison(
cr, cr,
uid, uid,
lang_id, lang_id,

Loading…
Cancel
Save