Commit 1c3104e1 authored by Benjamin's avatar Benjamin
Browse files

modif erreur view js

parent 8f351420
......@@ -53,6 +53,16 @@ odoo.define('lefilament_tdb.dashboard_year', function (require) {
var self = this;
this.values = {};
this.progess = 0;
var invoice_view_id = new Model('ir.model.data').call('xmlid_to_res_id', ['account.invoice_form'])
.then(function(results) {
self.invoice_view_id = results;
});
var pipe_view_id = new Model('ir.model.data').call('xmlid_to_res_id', ['crm.lead.form.opportunity'])
.then(function(results) {
self.pipe_view_id = results;
});
var dash_model = new Model('lefilament.dashboard');
dash_model.call('retrieve_datas_dashboard')
......@@ -174,7 +184,6 @@ odoo.define('lefilament_tdb.dashboard_year', function (require) {
facture: function() {
var self = this;
var date = moment().startOf('year').format('YYYY-MM-DD');
console.log(date);
var context = { 'user_id': this.session.uid, }
var action = ({
......@@ -182,7 +191,7 @@ odoo.define('lefilament_tdb.dashboard_year', function (require) {
res_model: 'account.invoice',
view_type: 'form',
view_mode: 'tree,form',
views: [[false, 'list'], [false, 'pivot'], [false, 'graph'], [585, 'form']],
views: [[false, 'list'], [false, 'pivot'], [false, 'graph'], [self.invoice_view_id, 'form']],
domain: [['state','in',['open','paid']],['type','=','out_invoice'],['date_invoice','>=',date]],
target:'current',
name: 'Facturé',
......@@ -219,8 +228,8 @@ odoo.define('lefilament_tdb.dashboard_year', function (require) {
res_model: 'crm.lead',
view_type: 'form',
view_mode: 'tree,form',
views: [[false, 'kanban'], [false, 'list'], [326, 'form']],
domain: [['type','=','opportunity'],['date_deadline','<=', deadline]],
views: [[false, 'kanban'], [false, 'list'], [this.pipe_view_id, 'form']],
domain: [['type','=','opportunity'],('|',['date_deadline','<=', deadline],['date_deadline','=', null])],
target:'current',
name: 'Pipe',
context: context
......@@ -238,7 +247,7 @@ odoo.define('lefilament_tdb.dashboard_year', function (require) {
res_model: 'crm.lead',
view_type: 'form',
view_mode: 'kanban,tree,form',
views: [[false, 'kanban'], [false, 'list'], [326, 'form']],
views: [[false, 'kanban'], [false, 'list'], [this.pipe_view_id, 'form']],
domain: [['type','=','opportunity'],['date_deadline','>', deadline]],
target:'current',
name: 'Pipe',
......@@ -256,7 +265,7 @@ odoo.define('lefilament_tdb.dashboard_year', function (require) {
res_model: 'account.invoice',
view_type: 'form',
view_mode: 'tree,form',
views: [[false, 'list'], [false, 'pivot'], [false, 'graph'], [585, 'form']],
views: [[false, 'list'], [false, 'pivot'], [false, 'graph'], [self.invoice_view_id, 'form']],
domain: [['state','=','open'],['type','=','out_invoice']],
target:'current',
name: 'Factures en cours',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment