[IMP] mis_builder: links only on cells where drilldown is possible

pull/86/head
Stéphane Bidoul 2015-04-25 22:17:08 +02:00
parent ce9d9ad364
commit b9c18e4440
3 changed files with 26 additions and 14 deletions

View File

@ -657,6 +657,8 @@ class mis_report_instance_period(orm.Model):
except: except:
kpi_style = None kpi_style = None
drilldown = bool(aep.get_aml_domain_for_expr(kpi.expression))
res[kpi.name] = { res[kpi.name] = {
'val': kpi_val, 'val': kpi_val,
'val_r': kpi_val_rendered, 'val_r': kpi_val_rendered,
@ -668,6 +670,7 @@ class mis_report_instance_period(orm.Model):
'is_percentage': kpi.type == 'pct', 'is_percentage': kpi.type == 'pct',
'period_id': c.id, 'period_id': c.id,
'period_name': c.name, 'period_name': c.name,
'drilldown': drilldown,
} }
if len(recompute_queue) == 0: if len(recompute_queue) == 0:

View File

@ -1,6 +1,11 @@
.openerp .ralign { .mis_builder_ralign {
text-align: right; text-align: right;
} }
.openerp a.mis_builder {
color: #4c4c4c; a.mis_builder_drilldown {
color: inherit;
}
a.mis_builder_drilldown:hover {
text-decoration: underline;
} }

View File

@ -6,7 +6,7 @@
<tr class="oe_list_header_columns"> <tr class="oe_list_header_columns">
<th class="oe_list_header_char"></th> <th class="oe_list_header_char"></th>
<t t-foreach="widget.mis_report_data.header" t-as="h"> <t t-foreach="widget.mis_report_data.header" t-as="h">
<th t-foreach="h_value.cols" t-as="header" class="oe_list_header_char ralign"> <th t-foreach="h_value.cols" t-as="header" class="oe_list_header_char mis_builder_ralign">
<div> <div>
<t t-esc="header.name"/> <t t-esc="header.name"/>
</div> </div>
@ -25,17 +25,21 @@
</div> </div>
</td> </td>
<t t-foreach="c_value.cols" t-as="value"> <t t-foreach="c_value.cols" t-as="value">
<td class="ralign open_account_move" t-att="{'style': c_value.default_style}"> <td class="mis_builder_ralign open_account_move" t-att="{'style': c_value.default_style}">
<div t-att="{'style': value_value.style}"> <div t-att="{'style': value_value.style, 'title': value_value.val_c}">
<a t-att="{'title': value_value.val_c}" <t t-if="value_value.drilldown">
class="mis_builder" <a href="javascript:void(0)"
href="javascript:void(0)" class="mis_builder_drilldown"
t-att-data-val="JSON.stringify(value_value.val)" t-att-data-val="JSON.stringify(value_value.val)"
t-att-data-val-c="JSON.stringify(value_value.val_c)" t-att-data-val-c="JSON.stringify(value_value.val_c)"
t-att-data-period-id="JSON.stringify(value_value.period_id)" t-att-data-period-id="JSON.stringify(value_value.period_id)"
t-att-data-period-name="JSON.stringify(value_value.period_name)"> t-att-data-period-name="JSON.stringify(value_value.period_name)">
<t t-esc="value_value.val_r"/> <t t-esc="value_value.val_r"/>
</a> </a>
</t>
<t t-if="!value_value.drilldown">
<t t-esc="value_value.val_r"/>
</t>
</div> </div>
</td> </td>
</t> </t>