Browse Source

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

pull/86/head
Stéphane Bidoul 10 years ago
parent
commit
b9c18e4440
  1. 3
      mis_builder/models/mis_builder.py
  2. 11
      mis_builder/static/src/css/custom.css
  3. 26
      mis_builder/static/src/xml/mis_widget.xml

3
mis_builder/models/mis_builder.py

@ -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:

11
mis_builder/static/src/css/custom.css

@ -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;
} }

26
mis_builder/static/src/xml/mis_widget.xml

@ -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}">
<div t-att="{'style': value_value.style}">
<a t-att="{'title': value_value.val_c}"
class="mis_builder"
href="javascript:void(0)"
t-att-data-val="JSON.stringify(value_value.val)"
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-name="JSON.stringify(value_value.period_name)">
<td class="mis_builder_ralign open_account_move" t-att="{'style': c_value.default_style}">
<div t-att="{'style': value_value.style, 'title': value_value.val_c}">
<t t-if="value_value.drilldown">
<a href="javascript:void(0)"
class="mis_builder_drilldown"
t-att-data-val="JSON.stringify(value_value.val)"
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-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>

Loading…
Cancel
Save