[IMP] salesteams: crm_case_section kanban sparkline with html tooltip
bzr revid: chm@openerp.com-20130418091759-7q02xo1p4pqauowa
This commit is contained in:
@@ -199,7 +199,6 @@ class crm_case_section(osv.osv):
|
||||
|
||||
'open_lead_per_duration': fields.function(_get_open_lead_per_duration, string='Open Leads per duration', type="string", readonly=True),
|
||||
'won_opportunity_per_duration': fields.function(_get_won_opportunity_per_duration, string='Rate of opporunities whon per duration', type="string", readonly=True)
|
||||
|
||||
}
|
||||
|
||||
def _get_stage_common(self, cr, uid, context):
|
||||
|
||||
@@ -101,11 +101,11 @@
|
||||
<div class="oe_items_list">
|
||||
<div>
|
||||
<a t-if="record.use_leads.raw_value" name="%(crm_case_form_view_salesteams_lead)d" type="action">Leads</a>
|
||||
<a name="%(crm_case_form_view_salesteams_lead)d" type="action" class="oe_sparkline_bar" title="Number of opening leads per duration.\n(last item is the most recent)"><t t-raw="record.open_lead_per_duration.raw_value"/></a>
|
||||
<a name="%(action_report_crm_lead)d" type="action" class="oe_sparkline_bar" t-att-data-value="record.open_lead_per_duration.raw_value">Number of opening leads per duration.<br/>(last one is <t t-esc="record.target_duration_txt.raw_value"/>)</a>
|
||||
</div>
|
||||
<div>
|
||||
<a name="%(crm_case_form_view_salesteams_opportunity)d" type="action">Opportunities</a>
|
||||
<a name="%(crm_case_form_view_salesteams_opportunity)d" type="action" class="oe_sparkline_bar" title="Rate of won opportunities per duration.\n(last item is the most recent)"><t t-raw="record.won_opportunity_per_duration.raw_value"/></a>
|
||||
<a name="%(action_report_crm_opportunity)d" type="action" class="oe_sparkline_bar" t-att-data-value="record.won_opportunity_per_duration.raw_value">Rate of won opportunities per duration.<br/>(last one is <t t-esc="record.target_duration_txt.raw_value"/>)</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -64,4 +64,5 @@
|
||||
|
||||
.openerp .oe_kanban_view .oe_sparkline_bar {
|
||||
float: right;
|
||||
height: 20px;
|
||||
}
|
||||
@@ -61,7 +61,14 @@ openerp.crm = function(openerp) {
|
||||
});
|
||||
}
|
||||
});
|
||||
setTimeout(function () {self.$(".oe_sparkline_bar").sparkline('html', {type: 'bar', barWidth: 5} );}, 0);
|
||||
setTimeout(function () {
|
||||
self.$(".oe_sparkline_bar").each(function () {
|
||||
var $el = $(this);
|
||||
$el.data("title", $el.html());
|
||||
$el.sparkline($el.data("value").split(','), {type: 'bar', barWidth: 5} );
|
||||
$el.tipsy({'delayIn': 0, 'html': true, 'title': function(){return $(this).data("title")}, 'gravity': 'n'});
|
||||
});
|
||||
}, 0);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
@@ -227,26 +227,29 @@
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//field[@name='name']" position="after">
|
||||
|
||||
|
||||
<field name="quotation_ids"/>
|
||||
<field name="sale_order_ids"/>
|
||||
<field name="invoice_ids"/>
|
||||
|
||||
|
||||
<field name="sum_duration_invoice"/>
|
||||
<field name="forcasted"/>
|
||||
<field name="target_invoice"/>
|
||||
</xpath>
|
||||
<xpath expr="//div[@class='oe_items_list']" position="inside">
|
||||
<div>
|
||||
<a name="%(action_quotations_salesteams)d" type="action"><t t-raw="record.quotation_ids.raw_value.length"/><t t-if="record.quotation_ids.raw_value.length >= 2">Quotations</t><t t-if="record.quotation_ids.raw_value.length < 2">Quotation</t></a>
|
||||
<a name="%(action_quotations_salesteams)d" type="action" class="oe_sparkline_bar"><t t-raw="[6,4,7,2,1]"/></a>
|
||||
<a name="%(action_quotations_salesteams)d" type="action">Quotations</a>
|
||||
<a name="%(action_quotations_salesteams)d" type="action" class="oe_sparkline_bar" data-value="6,4,7,2,6">jhfhgj</a>
|
||||
</div>
|
||||
<div>
|
||||
<a name="%(action_orders_salesteams)d" type="action"><t t-raw="record.sale_order_ids.raw_value.length"/><t t-if="record.sale_order_ids.raw_value.length >= 2">Sales Orders</t><t t-if="record.sale_order_ids.raw_value.length < 2">Sales Order</t>
|
||||
</a>
|
||||
<a name="%(action_orders_salesteams)d" type="action" class="oe_sparkline_bar"><t t-raw="[6,4,7,4,2]"/></a>
|
||||
<a name="%(action_orders_salesteams)d" type="action">Sales Orders</a>
|
||||
<a name="%(action_orders_salesteams)d" type="action" class="oe_sparkline_bar" data-value="6,4,7,2,6">jfhjh</a>
|
||||
</div>
|
||||
<div>
|
||||
<a name="%(action_invoice_salesteams)d" type="action" groups="account.group_account_invoice"><t t-raw="record.invoice_ids.raw_value.length"/><t t-if="record.invoice_ids.raw_value.length >= 2">Invoices</t><t t-if="record.invoice_ids.raw_value.length < 2">Invoice</t></a>
|
||||
<a name="%(action_invoice_salesteams)d" type="action" class="oe_sparkline_bar"><t t-raw="[6,4,7,2,6]"/></a>
|
||||
<a name="%(action_invoice_salesteams)d" type="action" groups="account.group_account_invoice">Invoices</a>
|
||||
<a name="%(action_invoice_salesteams)d" type="action" class="oe_sparkline_bar" data-value="6,4,7,2,6">jfghjgh</a>
|
||||
</div>
|
||||
</xpath>
|
||||
<xpath expr="//div[@class='oe_items_list']" position="after">
|
||||
|
||||
Reference in New Issue
Block a user