Odoo Help

0

How get the category value in Dashboard

By
sridhar
on 3/14/14, 4:08 AM 981 views

How get the category value in Dashboard, when i clicking the show data button x value come as 0,1,2,... I want to replace the 0 by that product category name. see the attachment i want some values x axis.In x axis image has Category name but i cant get the value in the table.

0

Prakash

--Prakash--
3218
| 5 4 7
Bikaner, India
--Prakash--

OpenERP Devloper at SunARC Technology

Prakash
On 3/24/14, 8:09 AM

Default Dashboard show data x value come as 0,1,2,... from the below code:-

Folder: addons\web_graph\static\lib\flotr2\js\plugins\spreadsheet.js

Default OpenERP Code:-

function getRowLabel(value){
  if (this.options.spreadsheet.tickFormatter){
    //TODO maybe pass the xaxis formatter to the custom tick formatter as an opt-out?
    return this.options.spreadsheet.tickFormatter(value);
  }
  else {
    var t = _.find(this.axes.x.ticks, function(t){return t.v == value;});
    if (t) {
      return t.label;
    }
    return value; /* Default it shows 0, 1, 2 */
  }
}

Based on your requirement to change the below code in spreadsheet.js its shows Product Category Name in x-axis

function getRowLabel(value){
  if (this.options.spreadsheet.tickFormatter){
    //TODO maybe pass the xaxis formatter to the custom tick formatter as an opt-out?
    return this.options.spreadsheet.tickFormatter(value);
  }
  else {
    var t = _.find(this.axes.x.ticks, function(t){return t.v == value;});
    if (t) {
      return t.label;
    }
    return  this.options.xaxis.ticks[value][1]; /* It return x-axis value in Data Dashboard */
  }
}

Yes Yes... It is working... Thank You...

sridhar
on 3/24/14, 9:08 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)

Stats

Asked: 3/14/14, 4:08 AM
Seen: 981 times
Last updated: 3/16/15, 8:10 AM