diff --git a/__manifest__.py b/__manifest__.py index d9939ec94d38de2ce8a0f19384f4a479bdc9ee11..17d368caee2f4e0db3a28febe655e6696ab42d85 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -20,7 +20,7 @@ 'website': "http://www.le-filament.com", 'version': '10.0.1', 'license': 'AGPL-3', - 'depends': ['crm','account'], + 'depends': ['crm','account','hr_expense'], 'data': [ 'security/lefilament_dashboard_security.xml', 'security/ir.model.access.csv', diff --git a/static/src/js/dashboard_year.js b/static/src/js/dashboard_year.js index 2d037a95d613d5e7004491c9f7acc5442bfc979d..2ae629499ff025a6ac29a791721b56aeee6c7058 100644 --- a/static/src/js/dashboard_year.js +++ b/static/src/js/dashboard_year.js @@ -103,13 +103,22 @@ odoo.define('lefilament_tdb.dashboard_year', function (require) { ///////////////////////////////////////// this.ctx = this.$el.find('#target')[0].getContext('2d'); + + var ptarg = this.ptarg; + var max_xaxis = 100; + + if (this.ptarg < 0 ) { + ptarg = 0; + max_xaxis = 100 - this.ptarg; + } var dataset_stacked = [ { label: 'Facturé', data: [this.pfact], backgroundColor: '#8ED8A2', }, { label: 'Commandes', data: [this.pcomm], backgroundColor: '#F6DCA2', }, { label: 'Gagné', data: [this.ppipe_win], backgroundColor: '#F6CCA2', }, { label: 'Pipe', data: [this.ppipe_to_win], backgroundColor: '#F6ACA2', }, - { label: 'To Do', data: [this.ptarg], backgroundColor: '#eee', }]; + { label: 'To Do', data: [ptarg], backgroundColor: '#eee', }, + ]; var label = 'Année ' + moment(Date.now()).format('YYYY'); @@ -119,6 +128,7 @@ odoo.define('lefilament_tdb.dashboard_year', function (require) { }; var options = { + responsive: true, legend: { display: false, }, @@ -129,7 +139,16 @@ odoo.define('lefilament_tdb.dashboard_year', function (require) { xAxes: [{ stacked: true, scaleShowLabels: false, - display : false , + display : true , + ticks: { + max: max_xaxis, + stepSize: 50, + fontSize: 10, + fontColor: '#999', + callback: function(value, index, values) { + return value + '%'; + }, + }, }], yAxes: [{ stacked: true, diff --git a/static/src/xml/lefilament_tdb.xml b/static/src/xml/lefilament_tdb.xml index 299c415d01043dc6f512ab697cb2fcda6f08ddb3..57b2bdb44610326513ecb7e025c0889ae553ccc4 100644 --- a/static/src/xml/lefilament_tdb.xml +++ b/static/src/xml/lefilament_tdb.xml @@ -135,7 +135,7 @@ <p class="card-number"> <t t-esc="widget.render_monetary(widget.values.target)"></t> </p> - <canvas id="target" width="auto" height="100"></canvas> + <canvas id="target" width="auto" height="125"></canvas> <!-- <div id="hchart" ></div> --> <table class="table-legend"> <tr>