Browse Source

FIX ADD Agregado report de tareas y agregado filtros en crm y produccion

Sebas 6 years ago
parent
commit
0c8e489014

+ 11 - 6
static/src/js/configuration_reporting.js

@@ -109,19 +109,24 @@ function configuration_reporting (instance, widget) {
                 action: 'ReportStock'
             },
             // {
-            //     title: 'Análisis de Stock por Ubicación',
-            //     description: 'Permite realizar un analisis de los productos disponibles en el stock por Ubicación.',
-            //     action: 'ReportStockLocation'
+            //     title: 'Análisis de Stock Original',
+            //     description: 'Permite realizar un analisis de los productos disponibles en el stock.',
+            //     action: 'ReportStockOriginal'
             // },
+            {
+                title: 'Análisis de Stock por Ubicación',
+                description: 'Permite realizar un analisis de los productos disponibles en el stock por Ubicación.',
+                action: 'ReportStockLocation'
+            },
             {
                 title: 'Análisis de Movimientos de Stock',
                 description: 'Permite realizar un analisis de los productos disponibles en el stock.',
                 action: 'ReportStockMove'
             },
             {
-                title: 'Histórico de Llamadas CRM',
-                description: 'Permite visualizar las llamadas CRM',
-                action: 'ReportPhoneCall'
+                title: 'Histórico de Tareas CRM',
+                description: 'Permite visualizar las Tareas en CRM',
+                action: 'ReportCrmTask'
             },
             {
                 title: 'Histórico CRM',

+ 5 - 2
static/src/js/main.js

@@ -19,11 +19,12 @@ openerp.eiru_reporting = function (instance) {
         report_sales_invoice_analysis(reporting);
         report_purchases_invoice_analysis(reporting);
         report_stock(reporting);
+        // report_stock_original(reporting);
         // report_stock_location(reporting);
         report_stock_move(reporting);
         report_crm(reporting);
         report_mensajecrm(reporting);
-        report_phonecall(reporting);
+        report_crmtask(reporting);
         report_project(reporting);
         reporting_accountpending_pagar(reporting);
         reporting_accountpending(reporting);
@@ -130,7 +131,7 @@ openerp.eiru_reporting = function (instance) {
     // CRM
     instance.web.client_actions.add('eiru_reporting.crm_action_report', 'instance.eiru_reporting.ReportCrmWidget');
     // Historico de llamadas
-    instance.web.client_actions.add('eiru_reporting.crm_call_action_report', 'instance.eiru_reporting.ReportPhoneCallWidget');
+    instance.web.client_actions.add('eiru_reporting.crm_task_action_report', 'instance.eiru_reporting.ReportCrmTaskWidget');
     // Historico de mensajes
     instance.web.client_actions.add('eiru_reporting.crm_messages_action_report', 'instance.eiru_reporting.ReportMensajeCrmWidget');
     // Proyectos
@@ -147,6 +148,8 @@ openerp.eiru_reporting = function (instance) {
     // ******************************************* Stock *************************************************************************
     // Analisis de stock
     instance.web.client_actions.add('eiru_reporting.stock_action_report', 'instance.eiru_reporting.ReportStockWidget');
+    // Analisis de stock
+    // instance.web.client_actions.add('eiru_reporting.stock_original_action_report', 'instance.eiru_reporting.ReportStockOriginalWidget');
     // Analisis de stock por location
     // instance.web.client_actions.add('eiru_reporting.stock_location_action_report', 'instance.eiru_reporting.ReportStockLocationWidget');
     // Analisis de movimientos de stock

+ 16 - 35
static/src/js/reports/report_crm.js

@@ -196,8 +196,9 @@ function report_crm(reporting){
                 self.showMensaje('crm');
                 return defer;
             }
+            var filter = [['type','=','opportunity'],['active', '=', true]];
             var AccountVoucher = new instance.web.Model('crm.lead');
-            AccountVoucher.query(['id', 'partner_id', 'name', 'description', 'create_date', 'user_id', 'stage_id', 'type']).filter([['active', '=', true]]).all().then(function(results){
+            AccountVoucher.query(['id', 'partner_id', 'name', 'description', 'create_date', 'user_id', 'stage_id', 'date_last_stage_update','write_date','type']).filter(filter).all().then(function(results){
                 defer.resolve(results);
             });
 
@@ -268,6 +269,8 @@ function report_crm(reporting){
                   description: self.valorNull(item.description),
                   partner: item.partner_id[1],
                   create_date: moment(item.create_date).format("DD/MM/YYYY"),
+                  date_last_stage_update: moment(item.date_last_stage_update).format("DD/MM/YYYY"),
+                  write_date: moment(item.write_date).format("DD/MM/YYYY"),
                   date: moment(item.create_date).format("YYYY-MM-DD"),
                   user: item.user_id[1],
                   crm_type: crm_type,
@@ -281,57 +284,33 @@ function report_crm(reporting){
 
         factSearch: function(){
             var self = this;
-            var hoy = moment().format('YYYY-MM-DD');
+            var today = moment().format('YYYY-MM-DD');
+            var yesterday = moment().add(-1, 'days').format('YYYY-MM-DD');
+            var month = moment().format('YYYY-MM');
+            var last_month = moment().add(-1, 'months').format('YYYY-MM');
             var desde = this.$el.find('#from').val();
             var hasta = this.$el.find('#to').val();
             var partner= this.$el.find('#partner').val().split('-');
             var content = self.content;
 
             if ($('#A').is(":checked")){
-                 content = _.filter(content, function (inv){
-                     return inv.date == hoy;
-                 });
+                content = _.filter(content, function (inv){
+                    return moment(inv.date).format('YYYY-MM-DD') == today;
+                });
             }
             if ($('#B').is(":checked")){
-                var date = hoy.split('-');
-                var ayer = date[2] - 1;
-                date.splice(2,0);
-                if(date[2] < 10){
-                     date[2] = '0'+ayer;
-                }else{
-                    date[2] = ayer;
-                }
                 content = _.filter(content, function (inv){
-                    return inv.date == date[0]+'-'+date[1]+'-'+date[2];
+                    return moment(inv.date).format('YYYY-MM-DD') == yesterday;
                 });
             }
             if ($('#C').is(":checked")){
-                var date = hoy.split('-');
                 content = _.filter(content, function (inv){
-                    var mes = inv.date.split('-');
-                    return mes[0]+'-'+mes[1] == date[0]+'-'+date[1];
+                    return moment(inv.date).format('YYYY-MM') == month;
                 });
             }
             if ($('#D').is(":checked")){
-                 var date = hoy.split('-');
-                 var mes = date[1] - 1;
-                 var year;
-                 date.splice(1,0);
-                 if(date[1] == 1){
-                     date[1] = '12';
-                     year = date[0] - 1;
-                     date[0] = year;
-                 }else{
-
-                  if(date[1] < 10){
-                      date[1] = '0'+mes;
-                  }else{
-                      date[1] = mes;
-                  }
-                 }
                 content = _.filter(content, function (inv){
-                    var mes = inv.date.split('-');
-                    return mes[0]+'-'+mes[1] == date[0]+'-'+date[1];
+                    return moment(inv.date).format('YYYY-MM') == last_month;
                 });
             }
             if ($('#Z').is(":checked")){
@@ -430,6 +409,8 @@ function report_crm(reporting){
                   partner : {columnWidth: '8px'},
                   date : {columnWidth: '8px'},
                   stage : {columnWidth: '8px'},
+                  date_last_stage_update: {columnWidth: '7px'},
+                  write_date: {columnWidth: '7px'},
                   user : {columnWidth: '8px'}
                 },
                 margin: { top: 16, horizontal: 7},

+ 139 - 74
static/src/js/reports/report_phonecall.js → static/src/js/reports/report_crmtask.js

@@ -1,28 +1,31 @@
-function report_phonecall(reporting){
+function report_crmtask(reporting){
     "use strict";
 
     var instance = openerp;
 
-    reporting.ReportPhoneCallWidget = reporting.Base.extend({
-        template:'ReportPhoneCall',
+    reporting.ReportCrmTaskWidget = reporting.Base.extend({
+        template:'ReportCrmTask',
         Crm: [],
-        CrmPhone: [],
+        CrmTask: [],
         content:[],
         rowsData :[],
         modules:[],
         events:{
             'click #toolbar > button' : 'clickOnAction',
-            'click #volver_btn' : 'volver',
             'click #X' : 'factSearch',
             'click #A' : 'factSearch',
             'click #B' : 'factSearch',
             'click #C' : 'factSearch',
             'click #D' : 'factSearch',
             'click #Z' : 'factSearch',
-
             'click #Y' : 'factSearch',
+            'click #done' : 'factSearch',
+            'click #cancel' : 'factSearch',
+            'click #pending' : 'factSearch',
+            'click #current-type' : 'factSearch',
+            'click #W' : 'factSearch',
             'click #customer' : 'factSearch',
-
+            'click #task' : 'factSearch',
             'change #from' : 'factSearch',
             'change #to' : 'factSearch',
             'click-row.bs.table #table ' : 'clickAnalysisDetail',
@@ -96,28 +99,28 @@ function report_phonecall(reporting){
         clickAnalysisDetail: function(e, row, $element, field){
             if (field == 'partner'){
                  this.do_action({
-                     name:"CRM Llamadas",
+                     name:"Registro de Cliente",
                      type: 'ir.actions.act_window',
-                     res_model: "crm.phonecall",
+                     res_model: "res.partner",
                      views: [[false,'form']],
                      target: 'new',
-                     domain: [['id','=', row.id]],
+                     domain: [['id','=', row.partner_id]],
                      context: {},
                      flags: {'form': {'action_buttons': false, 'options': {'mode': 'view'}}},
-                     res_id: row.id,
+                     res_id: row.partner_id,
                  });
             }
-            if (field === 'opportunity_id'){
+            if (field === 'activity'){
                 this.do_action({
-                    name:"Registro",
+                    name:"Registro de Tareas",
                     type: 'ir.actions.act_window',
-                    res_model: "crm.lead",
+                    res_model: "crm.task",
                     views: [[false,'form']],
                     target: 'new',
-                    domain: [['id','=', row.partner_id]],
+                    domain: [['id','=', row.id]],
                     context: {},
                     flags: {'form': {'action_buttons': false, 'options': {'mode': 'view'}}},
-                    res_id: row.partner_id,
+                    res_id: row.id,
                 });
             }
 
@@ -130,9 +133,16 @@ function report_phonecall(reporting){
                 self.modules = modules;
                 return modules;
             }).then(function(modules){
-                return self.fetchCrmPhone();
-            }).then(function(CrmPhone) {
-                self.CrmPhone = CrmPhone;
+                return self.fetchCrmTask();
+            }).then(function(CrmTask) {
+                self.CrmTask = CrmTask;
+                return self.fetchTaskType();
+            }).then(function (TaskType) {
+                self.TaskType = TaskType;
+                self.$el.find('#current-type').append('<option value="9999999">Todas los tipos</option>');
+                _.each(TaskType,function(item){
+                    self.$el.find('#current-type').append('<option value="' + item.id + '">' + item.name + '</option>');
+                });
                 return self.fetchCrm();
             }).then(function (Crm) {
                 self.Crm = Crm;
@@ -140,6 +150,7 @@ function report_phonecall(reporting){
             }).then(function(ResPartner){
                 self.ResPartner = ResPartner;
                 self.search();
+                self.searchTaskType();
                 return self.BuildTable();
             });
         },
@@ -192,16 +203,28 @@ function report_phonecall(reporting){
             }
         },
 
-        fetchCrmPhone: function () {
+        fetchCrmTask: function () {
             var self = this;
             var defer = $.Deferred();
-            var modules = self.checkModel('crm');
+            var modules = self.checkModel('eiru_crm');
             if (modules.length <= 0){
-                self.showMensaje('crm');
+                self.showMensaje('eiru_crm');
                 return defer;
             }
-            var CrmPhone = new instance.web.Model('crm.phonecall');
-            CrmPhone.query(['id', 'partner_id', 'name', 'date', 'opportunity_id', 'partner_mobile', 'user_id', 'state']).filter([['active', '=', true]]).all().then(function(results){
+            var CrmTask = new instance.web.Model('crm.task');
+            CrmTask.query(['id', 'partner_id', 'name', 'date_create', 'description', 'opportunity_id', 'task_type_id', 'user_id', 'state','date_action_next']).filter([['active', '=', true]]).all().then(function(results){
+                defer.resolve(results);
+            });
+
+            return defer;
+        },
+
+        fetchTaskType: function () {
+            var self = this;
+            var defer = $.Deferred();
+
+            var TaskType = new instance.web.Model('crm.task.type');
+            TaskType.query(['id', 'name']).filter([['active', '=', true]]).all().then(function(results){
                 defer.resolve(results);
             });
 
@@ -237,13 +260,41 @@ function report_phonecall(reporting){
             });
         },
 
-        getCrmPhone: function (id) {
+
+
+        getCrmTask: function (id) {
             var self = this;
-            return _.filter(self.CrmPhone,function (item) {
+            return _.filter(self.CrmTask,function (item) {
                 return item.id == id;
             });
         },
 
+        searchTaskType: function () {
+            var self = this;
+            var results = self.TaskType;
+            results = _.map(results, function (item) {
+                return {
+                        label: item.id + '-'+ item.name,
+                        value: item.id + '-'+ item.name
+                }
+            });
+            self.$('#task').autocomplete({
+                source: results,
+                minLength:0,
+                search: function(event, ui) {
+                    if (!(self.$('#task').val())){
+                        self.factSearch();
+                    }
+                },
+                close: function( event, ui ) {
+                        self.factSearch();
+                },
+                select: function(event, ui) {
+                    self.factSearch();
+                }
+            });
+        },
+
         search: function () {
             var self = this;
             var results = self.ResPartner;
@@ -270,38 +321,44 @@ function report_phonecall(reporting){
             });
         },
 
-        // volver
-        volver: function(){
-            this.$el.find('#volver_btn').empty();
-            this.$el.find('.bootstrap-table').show({
-                effect: 'drop',
-                direction: 'down',
-                duration: 200,
-            });
-        },
-
         BuildTable: function(){
             var self = this;
-            var crmphone = self.CrmPhone;
+            var crmtask = self.CrmTask;
             var invoice;
             var Crm;
+            var taskType;
+            var stage;
             var data = [];
 
-            _.each(crmphone, function(item){
+            _.each(crmtask, function(item){
 
-                invoice = self.getCrmPhone(item.id).shift();
-                Crm = self.getCrm(item.id);
+                if(item.state=='pending'){
+                    stage = 'Pendiente'
+                }else{
+                    if(item.state=='done'){
+                        stage = 'Realizado'
+                    }else{
+                        stage = 'Cancelado'
+                    }
+                }
 
+                invoice = self.getCrmTask(item.id).shift();
+                Crm = self.getCrm(item.id);
+                // taskType = self.getTaskType(item.task_type_id);
 
                 data.push({
                     id : item.id,
                     opportunity_id : self.valorNull(item.opportunity_id),
-                    partner: self.valorNull(Crm.partner_id),
-                    description: self.valorNull(item.name),
-                    create_date: moment(item.date).format("DD/MM/YYYY"),
-                    date: moment(item.date).format("YYYY-MM-DD"),
+                    partner: self.valorNull(item.partner_id[1]),
+                    description: self.valorNull(item.description),
+                    activity: self.valorNull(item.name),
+                    create_date: moment(item.date_create).format("DD/MM/YYYY"),
+                    date: moment(item.date_create).format("YYYY-MM-DD"),
                     user: item.user_id[1],
-                    stage: item.state,
+                    task_type_id: item.task_type_id[0],
+                    next_date: moment(item.date_action_next).format("DD/MM/YYYY"),
+                    task_name:  item.task_type_id[1],
+                    stage: stage,
                     partner_id : item.partner_id[0]
                 });
             });
@@ -315,26 +372,29 @@ function report_phonecall(reporting){
              var yesterday = moment().add(-1, 'days').format('YYYY-MM-DD');
              var month = moment().format('YYYY-MM');
              var last_month = moment().add(-1, 'months').format('YYYY-MM');
+             var desde = this.$el.find('#from').val();
+             var hasta = this.$el.find('#to').val();
              var partner= this.$el.find('#partner').val().split('-');
+             var task= this.$el.find('#current_task').val().split('-');
              var content = self.content;
              if ($('#A').is(":checked")){
                  content = _.filter(content, function (inv){
-                     return moment(inv.date).format('YYYY-MM-DD') == today;
+                     return moment(inv.date_create).format('YYYY-MM-DD') == today;
                  });
              }
              if ($('#B').is(":checked")){
                  content = _.filter(content, function (inv){
-                     return moment(inv.date).format('YYYY-MM-DD') == yesterday;
+                     return moment(inv.date_create).format('YYYY-MM-DD') == yesterday;
                  });
              }
              if ($('#C').is(":checked")){
                  content = _.filter(content, function (inv){
-                     return moment(inv.date).format('YYYY-MM') == month;
+                     return moment(inv.date_create).format('YYYY-MM') == month;
                  });
              }
              if ($('#D').is(":checked")){
                  content = _.filter(content, function (inv){
-                     return moment(inv.date).format('YYYY-MM') == last_month;
+                     return moment(inv.date_create).format('YYYY-MM') == last_month;
                  });
              }
              if ($('#Z').is(":checked")){
@@ -355,30 +415,33 @@ function report_phonecall(reporting){
                  $('#datepicker').css('display','none');
              }
 
-             this.$el.find('#volver_btn').append(selector);
-             this.$el.find('.bootstrap-table').hide({
-                 effect: 'drop',
-                 direction: 'up',
-                 duration: 200,
-                 complete: function () {
-
-                 }
-             });
-             this.$el.find('#toolbar').hide({
-                 effect: 'drop',
-                 direction: 'up',
-                 duration: 200,
-                 complete: function () {
-
-                 }
-             });
-
-
              if (partner != ""){
                  content = _.filter(content, function(inv){
                      return inv.partner_id == partner[0];
                  });
              }
+             if (task != ""){
+                 content = _.filter(content, function(inv){
+                     return inv.task_type_id == task[0];
+                 });
+             }
+
+             if ($('#pending').is(":checked")){
+                 content = _.filter(content, function (inv){
+                     return inv.stage == 'Pendiente';
+                 });
+             }
+             if ($('#done').is(":checked")){
+                 content = _.filter(content, function (inv){
+                     return inv.stage == 'Realizado';
+                 });
+             }
+             if ($('#cancel').is(":checked")){
+                 content = _.filter(content, function (inv){
+                     return inv.stage == 'Cancelado';
+                 });
+             }
+
              self.loadTable(content)
          },
 
@@ -436,12 +499,14 @@ function report_phonecall(reporting){
             pdfDoc.autoTable(getColumns, rows, {
                 styles: { overflow: 'linebreak', fontSize: 8, columnWidth: 'wrap'},
                 columnStyles: {
-                  opportunity_id : {columnWidth: '8px'},
+                  create_date : {columnWidth: '8px'},
                   partner : {columnWidth: '8px'},
+                  activity : {columnWidth: '8px'},
+                  user : {columnWidth: '8px'},
                   description : {columnWidth: '8px'},
-                  date : {columnWidth: '8px'},
-                  stage : {columnWidth: '8px'},
-                  user : {columnWidth: '8px'}
+                  task_name: {columnWidth: '8px'},
+                  stage : {columnWidth: '8px'}
+
                 },
                 margin: { top: 16, horizontal: 7},
 
@@ -449,7 +514,7 @@ function report_phonecall(reporting){
                     pdfDoc.setFontSize(12);
                     pdfDoc.setFontStyle('bold');
                     pdfDoc.setTextColor(40);
-                    pdfDoc.text('Histórico de llamadas de crm ', data.settings.margin.left, 10);
+                    pdfDoc.text('Histórico de Tareas CRM ', data.settings.margin.left, 10);
 
                     if(desde.length > 0 || hasta.length > 0){
                         var fecha='';
@@ -480,7 +545,7 @@ function report_phonecall(reporting){
             if (typeof pdfDoc.putTotalPages === 'function') {
                 pdfDoc.putTotalPages(totalPagesExp);
             }
-            pdfDoc.save('Histórico de llamadas crm.pdf')
+            pdfDoc.save('Histórico de Tareas CRM.pdf')
         },
     });
 }

+ 30 - 40
static/src/js/reports/report_mrp.js

@@ -202,7 +202,7 @@ function report_mrp(reporting){
                     }
                     var filter = [['state','in',['in_production','done']]];
                     var Mrp = new instance.web.Model('mrp.production');
-                    Mrp.query(['id', 'name', 'product_id', 'date_planned', 'product_qty', 'create_date', 'state']).filter(filter).all().then(function(results){
+                    Mrp.query(['id', 'name', 'product_id', 'date_planned', 'product_qty', 'create_date', 'state','move_created_ids2']).filter(filter).all().then(function(results){
                         defer.resolve(results);
                     });
 
@@ -256,19 +256,32 @@ function report_mrp(reporting){
                     var self = this;
                     var Mrp = self.Mrp;
                     var invoice;
+                    var stage;
+                    var qty_produced=0;
+                    var qty_toproduced=0;
                     var data = [];
 
                     _.each(Mrp, function(item){
 
+                        if(item.state=='in_production'){
+                            stage = 'En Producción'
+                            qty_toproduced=item.product_qty
+                            qty_produced=0
+                        }else{
+                            stage = 'Realizado'
+                            qty_produced=item.product_qty
+                            qty_toproduced=0
+                        }
+
                         data.push({
                             id : item.id,
                             name : item.name,
                             product: self.valorNull(item.product_id[1]),
                             create_date: moment(item.create_date).format("DD/MM/YYYY"),
                             date: moment(item.create_date).format("YYYY-MM-DD"),
-                            product_qty: accounting.formatNumber(self.valorNull(item.product_qty),2, ".", ","),
-                            qty_produced: accounting.formatNumber(self.valorNull(item.qty_produced),2, ".", ","),
-                            state: item.state,
+                            product_qty: accounting.formatNumber(self.valorNull(qty_toproduced),2, ".", ","),
+                            qty_produced: accounting.formatNumber(self.valorNull(qty_produced),2, ".", ","),
+                            state: stage,
                             date_planned: moment(item.date_planned).format("DD/MM/YYYY"),
                             product_id : item.product_id[0]
                         });
@@ -279,7 +292,10 @@ function report_mrp(reporting){
 
                  factSearch: function(){
                      var self = this;
-                     var hoy = moment().format('YYYY-MM-DD');
+                     var today = moment().format('YYYY-MM-DD');
+                     var yesterday = moment().add(-1, 'days').format('YYYY-MM-DD');
+                     var month = moment().format('YYYY-MM');
+                     var last_month = moment().add(-1, 'months').format('YYYY-MM');
                      var desde = this.$el.find('#from').val();
                      var hasta = this.$el.find('#to').val();
                      var product= this.$el.find('#product').val();
@@ -287,49 +303,22 @@ function report_mrp(reporting){
 
                      if ($('#A').is(":checked")){
                          content = _.filter(content, function (inv){
-                             return inv.date == hoy;
+                             return moment(inv.date).format('YYYY-MM-DD') == today;
                          });
                      }
                      if ($('#B').is(":checked")){
-                         var date = hoy.split('-');
-                         var ayer = date[2] - 1;
-                         date.splice(2,0);
-                         if(date[2] < 10){
-                             date[2] = '0'+ayer;
-                         }else{
-                             date[2] = ayer;
-                         }
                          content = _.filter(content, function (inv){
-                             return inv.date == date[0]+'-'+date[1]+'-'+date[2];
+                             return moment(inv.date).format('YYYY-MM-DD') == yesterday;
                          });
                      }
                      if ($('#C').is(":checked")){
-                         var date = hoy.split('-');
                          content = _.filter(content, function (inv){
-                             var mes = inv.date.split('-');
-                             return mes[0]+'-'+mes[1] == date[0]+'-'+date[1];
+                             return moment(inv.date).format('YYYY-MM') == month;
                          });
                      }
                      if ($('#D').is(":checked")){
-                         var date = hoy.split('-');
-                         var mes = date[1] - 1;
-                         var year;
-                         date.splice(1,0);
-                         if(date[1] == 1){
-                             date[1] = '12';
-                             year = date[0] - 1;
-                             date[0] = year;
-                         }else{
-
-                          if(date[1] < 10){
-                              date[1] = '0'+mes;
-                          }else{
-                              date[1] = mes;
-                          }
-                         }
                          content = _.filter(content, function (inv){
-                             var mes = inv.date.split('-');
-                             return mes[0]+'-'+mes[1] == date[0]+'-'+date[1];
+                             return moment(inv.date).format('YYYY-MM') == last_month;
                          });
                      }
                      if ($('#Z').is(":checked")){
@@ -350,14 +339,15 @@ function report_mrp(reporting){
                          $('#datepicker').css('display','none');
                      }
 
+
                      if ($('#in_production').is(":checked")){
                          content = _.filter(content, function (inv){
-                             return inv.state == 'in_production';
+                             return inv.state == 'En Producción';
                          });
                      }
                      if ($('#done').is(":checked")){
                          content = _.filter(content, function (inv){
-                             return inv.state == 'done';
+                             return inv.state == 'Realizado';
                          });
                      }
 
@@ -437,7 +427,7 @@ function report_mrp(reporting){
                             pdfDoc.setFontSize(12);
                             pdfDoc.setFontStyle('bold');
                             pdfDoc.setTextColor(40);
-                            pdfDoc.text('Histórico de producción', data.settings.margin.left, 10);
+                            pdfDoc.text('Histórico de Fabricación', data.settings.margin.left, 10);
 
                             if(desde.length > 0 || hasta.length > 0){
                                 var fecha='';
@@ -468,7 +458,7 @@ function report_mrp(reporting){
                     if (typeof pdfDoc.putTotalPages === 'function') {
                         pdfDoc.putTotalPages(totalPagesExp);
                     }
-                    pdfDoc.save('Histórico de producción.pdf')
+                    pdfDoc.save('Histórico de fabricacion.pdf')
                 },
             });
         }

+ 1 - 1
static/src/js/reports/report_resumen_ingresos.js

@@ -259,7 +259,7 @@ function report_resumen_ingresos (reporting){
             for (var i = 0; i < objJournal.length; i++) {
                 voucherObjectItem=[];
                 journal=objJournal[i];
-                //Generar la Cabezera con el nombre de la sucursal
+                //Generar la Cabecera con el nombre de la sucursal
                 for (var f = 0; f < journal.journal_ids.length; f++) {
                     voucherLine = journal.journal_ids[f];
                     voucherItem = self.getVoucherjournal(objVoucher,voucherLine)

+ 67 - 119
static/src/js/reports/report_stock.js

@@ -65,8 +65,8 @@ function report_stock (reporting){
             }).then(function(StockQuant){
                 self.StockQuant = StockQuant;
                 return self.fecthProductProduct(StockQuant);
-            }).then(function(productProduct){
-                self.productProduct = productProduct;
+            }).then(function(ProductProduct){
+                self.ProductProduct = ProductProduct;
                 return self.fecthProductCategory();
             }).then(function(ProductCategory){
                 self.ProductCategory = ProductCategory;
@@ -74,7 +74,7 @@ function report_stock (reporting){
                 _.each(ProductCategory, function (item) {
                     self.$el.find('#current-category').append('<option value="' + item.id + '">' + item.name + '</option>');
                 });
-                self.searchProduct();
+                self.search();
                 return self.BuildTable(self.StockQuant, self.StockLocation);
             });
         },
@@ -106,15 +106,15 @@ function report_stock (reporting){
             })
             return defer;
         },
-        fecthProductProduct: function(quant){
+        fecthProductProduct: function(){
             var self = this;
             var defer = $.Deferred();
-            var ids = _.flatten(_.map(quant, function (item) {
+            var ids = _.flatten(_.map(self.StockQuant, function (item) {
                 return item.product_id[0];
             }));
             var fields = ['id','name','name_template', 'standard_price','type','attribute_value_ids', 'lst_price','ean13','categ_id','attribute_str'];
-            var productProduct =  new instance.web.Model('product.product');
-            productProduct.query(fields).filter([['id', 'in', ids]]).all().then(function (results) {
+            var ProductProduct =  new instance.web.Model('product.product');
+            ProductProduct.query(fields).filter([['id', 'in', ids]]).all().then(function (results) {
               defer.resolve(results)
             });
             return defer;
@@ -129,14 +129,13 @@ function report_stock (reporting){
             });
             return defer;
         },
-
-        getProdcutoProduct: function(productProduct, StockQuant){
+        getProductProduct: function(ProductProduct, StockQuant){
             var self = this;
             var product_ids= _.flatten(_.map(StockQuant,function(map){
                 return map.product_id[0];
             }));
 
-            return _.filter(productProduct,function(prod){return _.contains(product_ids, prod.id)});
+            return _.filter(ProductProduct,function(prod){return _.contains(product_ids, prod.id)});
         },
         getStockQuant: function(product_id, quantObjs){
             var self = this;
@@ -148,14 +147,56 @@ function report_stock (reporting){
             }
             return quantProduct;
         },
+        BuildTable : function(StockQuant,StockLocation){
+            var self = this;
+            var data=[];
+            var itemLocation;
+            var itemProduct;
+            var itemQuant;
+            var ProductProduct;
+            var product;
+            var quantity = 0;
+            var total=0;
+            ProductProduct = self.getProductProduct(self.ProductProduct, self.StockQuant);
+    
+            _.each(ProductProduct, function(item){
+                itemProduct = item;
 
-        searchProduct: function () {
+                itemQuant = self.getStockQuant( itemProduct.id, self.StockQuant);
+                if (itemQuant.length > 0){
+                    quantity = _.reduce(_.map(itemQuant,function(item){
+                        return item.qty;
+                    }),function(mamo, num){
+                        return mamo + num;
+                    },0);
+                    product = itemQuant.shift();
+                    total = parseInt(quantity * itemProduct.standard_price);
+                    data.push({
+                        id : product.product_id[0],
+                        product : product.product_id[1],
+                        ean13 : self.valorNull(itemProduct.ean13),
+                        category_name : itemProduct.categ_id[1],
+                        qty : accounting.formatNumber(quantity,2, ".", ","),
+                        standard_price : accounting.formatNumber(itemProduct.standard_price,0, ".", ","),
+                        lst_price : accounting.formatNumber(itemProduct.lst_price,0, ".", ","),
+                        valuation: accounting.formatNumber(total,0,".",","),
+                        category_id : itemProduct.categ_id[0],
+                        location_id : product.location_id[0],
+                        location_name: product.location_id[1],
+                        total : total
+                    });
+                }
+            })
+            self.content = data;
+            self.loadTable(data);
+        },
+        search: function () {
             var self = this;
-            var results = self.productProduct;
+            var results = self.ProductProduct;
             results = _.map(results, function (item) {
                 return {
-                    label: item.id + '- '+ ' [ ' + self.valorNull(item.default_code) + ' - ' + self.valorNull(item.ean13) + ' ] ' + item.name + ' ( ' +  self.valorNull(item.attribute_str) + ' ) ' ,
-                    value: item.id + '- '+ ' [ ' + self.valorNull(item.default_code) + ' - ' + self.valorNull(item.ean13) + ' ] ' + item.name + ' ( ' +  self.valorNull(item.attribute_str) + ' ) '
+                        label: item.id + '- '+ ' [ ' + self.valorNull(item.default_code) + ' - ' + self.valorNull(item.ean13) + ' ] ' + item.name + ' ( ' +  self.valorNull(item.attribute_str) + ' ) ' ,
+                        value: item.id + '- '+ ' [ ' + self.valorNull(item.default_code) + ' - ' + self.valorNull(item.ean13) + ' ] ' + item.name + ' ( ' +  self.valorNull(item.attribute_str) + ' ) '
                 }
             });
             self.$('#product').autocomplete({
@@ -174,128 +215,35 @@ function report_stock (reporting){
                 }
             });
         },
-
-        BuildTable : function(StockQuant,StockLocation){
-            var self = this;
-            var data=[];
-            var stock=[];
-            var itemLocation;
-            var itemProduct;
-            var itemQuant;
-            var ProductProduct;
-            var product;
-            var quantity = 0;
-            var total=0;
-            var cat = 0;
-            var quant;
-            for (var i = 0; i < StockLocation.length; i++) {
-                itemLocation = StockLocation[i];
-                ProductProduct = self.getProdcutoProduct(self.productProduct, self.StockQuant, itemLocation.id);
-                // console.log(ProductProduct);
-                for (var f = 0; f < ProductProduct.length; f++) {
-                    itemProduct = ProductProduct[f];
-                    //console.log(itemProduct);
-                    itemQuant = self.getQuantProduct(itemLocation.id, itemProduct.id, StockQuant);
-                    // console.log(itemQuant);
-                    // if (itemQuant.length = 0){
-                    //     itemQuant={};
-                    //     console.log(itemProduct);
-                    //     itemQuant.qty=0;
-                    //     product = itemQuant.shift();
-                    //     total = parseInt(quantity * itemProduct.standard_price);
-                    //     data.push({
-                    //         id : product.product_id[0],
-                    //         product : product.product_id[1],
-                    //         ean13 : self.valorNull(itemProduct.ean13),
-                    //         category_name : itemProduct.categ_id[1],
-                    //         qty : accounting.formatNumber(quantity,2, ".", ","),
-                    //         standard_price : accounting.formatNumber(itemProduct.standard_price,0, ".", ","),
-                    //         lst_price : accounting.formatNumber(itemProduct.lst_price,0, ".", ","),
-                    //         valuation: accounting.formatNumber(total,0,".",","),
-                    //         category_id : itemProduct.categ_id[0],
-                    //         location_id : product.location_id[0],
-                    //         location_name: product.location_id[1],
-                    //         total : total
-                    //     });
-                    // }
-                    if (itemQuant.length > 0){
-                        quantity = _.reduce(_.map(itemQuant,function(item){
-                            return item.qty;
-                        }),function(mamo, num){
-                            return mamo + num;
-                        },0);
-                        product = itemQuant.shift();
-                        total = parseInt(quantity * itemProduct.standard_price);
-                        data.push({
-                            id : product.product_id[0],
-                            product : product.product_id[1],
-                            ean13 : self.valorNull(itemProduct.ean13),
-                            category_name : itemProduct.categ_id[1],
-                            qty : accounting.formatNumber(quantity,2, ".", ","),
-                            standard_price : accounting.formatNumber(itemProduct.standard_price,0, ".", ","),
-                            lst_price : accounting.formatNumber(itemProduct.lst_price,0, ".", ","),
-                            valuation: accounting.formatNumber(total,0,".",","),
-                            category_id : itemProduct.categ_id[0],
-                            location_id : product.location_id[0],
-                            location_name: product.location_id[1],
-                            total : total
-                        });
-                    }
-                }
-            }
-
-            self.content = data;
-            self.loadTable(data);
-        },
-
-        // Obtener  Qaunt  por productos
-        getQuantProduct: function(location_id, product_id, quantObjs){
-            var self = this;
-            var quantProdcut = quantObjs;
-            if (location_id){
-                quantProdcut = _.filter(quantProdcut, function(item){
-                    return item.location_id[0] === location_id;
-                });
-            }
-            if (product_id){
-                quantProdcut = _.filter(quantProdcut, function(item){
-                    return item.product_id[0] === product_id;
-                });
-            }
-            return quantProdcut;
-        },
-
         factSearch: function(){
             var self = this;
             var category = this.$el.find('#current-category').val();
             var product= this.$el.find('#product').val().split('-');
-            var location =this.$el.find('#current-location').val();
-            // console.log(location);
-            // var locationObjs = self.StockLocation;
-            // var quantObjs = self.StockQuant;
             var content = self.content;
-            // console.log(content);
             if(category != 9999999){
                 content = _.filter(content,function(inv){
                     return inv.category_id == category;
                 });
             }
-            if (location != 9999999){
-                content=_.filter(content, function (inv){
-                    return inv.location_id == location;
-                });
-            }
-
             if (product != ""){
                 content = _.filter(content, function(inv){
                     return inv.id == product[0];
                 });
             }
-            self.loadTable(content)
-            // self.BuildTable(quantObjs,locationObjs)
-        },
 
+            var amount_total_total = _.reduce(_.map(content,function(map){
+                return(map.total);
+            }),function(memo, num){
+                return memo + num;
+            },0);
+
+            content.push({
+                product: "Total",
+                valuation: accounting.formatNumber((amount_total_total),0,".",","),
+            });
 
+            self.loadTable(content)
+        },
         loadTable:function(rowsTable){
             var self = this;
             self.rowsData = rowsTable;

+ 389 - 0
static/src/js/reports/report_stock_original.js

@@ -0,0 +1,389 @@
+function report_stock_original (reporting){
+    "use strict";
+
+    var instance = openerp;
+
+    reporting.ReportStockOriginalWidget = reporting.Base.extend({
+        template: 'ReportStockOriginal',
+        stockLocation: [],
+        stockQuant: [],
+        productProduct : [],
+        rowsData: [],
+        content: [],
+        newStock: [],
+
+        events : {
+            'change #current-location' : 'factSearch',
+            'change #current-category' : 'factSearch',
+            'click #toolbar > button' : 'clickOnAction',
+            'click-row.bs.table #table ' : 'clickAnalysisDetail',
+        },
+        init : function(parent){
+            this._super(parent);
+        },
+        start : function(){
+            var self = this;
+            var dato=[];
+            var table = this.$el.find('#table');
+            table.bootstrapTable({data : self.rowsData});
+            self.submitForm();
+        },
+        valorNull:function(dato){
+            var valor ="";
+            if (dato){
+                valor=dato;
+            }
+            return valor;
+        },
+        clickAnalysisDetail: function(e, row, $element,field){
+            if (field == 'product'){
+                this.do_action({
+                    name:"Variantes de Producto",
+                    type: 'ir.actions.act_window',
+                    res_model: "product.product",
+                    views: [[false,'form']],
+                    target: 'new',
+                    domain: [['id', '=',row.id ]],
+                    context: {},
+                    flags: {'form': {'action_buttons': false, 'options': {'mode': 'view'}}},
+                    res_id: row.id,
+                });
+            }
+            e.stopImmediatePropagation();
+        },
+        submitForm: function(){
+            var self = this;
+            self.fecthStockLocation().then(function(StockLocation){
+                self.StockLocation=StockLocation;
+                return StockLocation;
+            }).then(function(StockLocation){
+                self.$el.find('#current-location').append('<option value="9999999">Todas las Ubicación.</option>');
+                _.each(StockLocation,function(item){
+                    self.$el.find('#current-location').append('<option value="' + item.id + '">' + item.location_id[1]+" / "+item.name + '</option>');
+                });
+                return self.fecthStockQuant();
+            }).then(function(StockQuant){
+                self.StockQuant = StockQuant;
+                return self.fecthProductProduct(StockQuant);
+            }).then(function(productProduct){
+                self.productProduct = productProduct;
+                return self.fecthProductCategory();
+            }).then(function(ProductCategory){
+                self.ProductCategory = ProductCategory;
+                self.$el.find('#current-category').append('<option value="9999999">Todos las categorias</option>');
+                _.each(ProductCategory, function (item) {
+                    self.$el.find('#current-category').append('<option value="' + item.id + '">' + item.name + '</option>');
+                });
+                self.searchProduct();
+                return self.BuildTable(self.StockQuant, self.StockLocation);
+            });
+        },
+        fecthStockLocation : function(){
+            var self = this;
+            var defer = $.Deferred();
+            var location = new instance.web.Model('stock.location');
+            var fields = ['id', 'name', 'company_id', 'location_id'];
+            var domain =[['active', '=', true],['usage', '=', 'internal']];
+            location.query(fields).filter(domain).order_by('id').all().then(function(results){
+                defer.resolve(results);
+            })
+            return defer;
+        },
+        fecthStockQuant : function(){
+            var self = this;
+            var defer = $.Deferred();
+            var location = _.flatten(_.map(self.StockLocation,function(item){
+                return item.id;
+            }));
+            var company_id =(_.map(self.StockLocation, function(item){
+                return item.company_id[0];
+            })).shift();
+            var quant = new instance.web.Model('stock.quant');
+            var fields = ['id', 'product_id', 'qty', 'cost','location_id'];
+            var domain =[['company_id', '=', company_id],['location_id', 'in',location]];
+            quant.query(fields).filter(domain).all().then(function(results){
+                defer.resolve(results);
+            })
+            return defer;
+        },
+        fecthProductProduct: function(quant){
+            var self = this;
+            var defer = $.Deferred();
+            var ids = _.flatten(_.map(quant, function (item) {
+                return item.product_id[0];
+            }));
+            var fields = ['id','name','name_template', 'standard_price','type','attribute_value_ids', 'lst_price','ean13','categ_id','attribute_str'];
+            var productProduct =  new instance.web.Model('product.product');
+            productProduct.query(fields).filter([['id', 'in', ids]]).all().then(function (results) {
+              defer.resolve(results)
+            });
+            return defer;
+        },
+        fecthProductCategory: function(){
+            var self = this;
+            var defer = $.Deferred();
+            var fields = ['id','name'];
+            var ProductCategory =  new instance.web.Model('product.category');
+            ProductCategory.query(fields).filter([['type', '=', 'normal']]).all().then(function (results) {
+              defer.resolve(results)
+            });
+            return defer;
+        },
+
+        getProdcutoProduct: function(productProduct, StockQuant){
+            var self = this;
+            var product_ids= _.flatten(_.map(StockQuant,function(map){
+                return map.product_id[0];
+            }));
+
+            return _.filter(productProduct,function(prod){return _.contains(product_ids, prod.id)});
+        },
+        getStockQuant: function(product_id, quantObjs){
+            var self = this;
+            var quantProduct = quantObjs;
+            if (product_id){
+                quantProduct = _.filter(quantProduct, function(item){
+                    return item.product_id[0] == product_id;
+                });
+            }
+            return quantProduct;
+        },
+
+        searchProduct: function () {
+            var self = this;
+            var results = self.productProduct;
+            results = _.map(results, function (item) {
+                return {
+                    label: item.id + '- '+ ' [ ' + self.valorNull(item.default_code) + ' - ' + self.valorNull(item.ean13) + ' ] ' + item.name + ' ( ' +  self.valorNull(item.attribute_str) + ' ) ' ,
+                    value: item.id + '- '+ ' [ ' + self.valorNull(item.default_code) + ' - ' + self.valorNull(item.ean13) + ' ] ' + item.name + ' ( ' +  self.valorNull(item.attribute_str) + ' ) '
+                }
+            });
+            self.$('#product').autocomplete({
+                source: results,
+                minLength:0,
+                search: function(event, ui) {
+                    if (!(self.$('#product').val())){
+                        self.factSearch();
+                    }
+                },
+                close: function( event, ui ) {
+                        self.factSearch();
+                },
+                select: function(event, ui) {
+                    self.factSearch();
+                }
+            });
+        },
+
+        BuildTable : function(StockQuant,StockLocation){
+            var self = this;
+            console.log(self);
+            var data=[];
+            var stock=[];
+            var itemLocation;
+            var itemProduct;
+            var itemQuant;
+            var ProductProduct;
+            var product;
+            var quantity = 0;
+            var total=0;
+            var cat = 0;
+            var quant;
+            for (var i = 0; i < StockLocation.length; i++) {
+                itemLocation = StockLocation[i];
+                ProductProduct = self.getProdcutoProduct(self.productProduct, self.StockQuant, itemLocation.id);
+                // console.log(ProductProduct);
+                for (var f = 0; f < ProductProduct.length; f++) {
+                    itemProduct = ProductProduct[f];
+                    //console.log(itemProduct);
+                    itemQuant = self.getQuantProduct(itemLocation.id, itemProduct.id, StockQuant);
+                    // console.log(itemQuant);
+                    // if (itemQuant.length = 0){
+                    //     itemQuant={};
+                    //     console.log(itemProduct);
+                    //     itemQuant.qty=0;
+                    //     product = itemQuant.shift();
+                    //     total = parseInt(quantity * itemProduct.standard_price);
+                    //     data.push({
+                    //         id : product.product_id[0],
+                    //         product : product.product_id[1],
+                    //         ean13 : self.valorNull(itemProduct.ean13),
+                    //         category_name : itemProduct.categ_id[1],
+                    //         qty : accounting.formatNumber(quantity,2, ".", ","),
+                    //         standard_price : accounting.formatNumber(itemProduct.standard_price,0, ".", ","),
+                    //         lst_price : accounting.formatNumber(itemProduct.lst_price,0, ".", ","),
+                    //         valuation: accounting.formatNumber(total,0,".",","),
+                    //         category_id : itemProduct.categ_id[0],
+                    //         location_id : product.location_id[0],
+                    //         location_name: product.location_id[1],
+                    //         total : total
+                    //     });
+                    // }
+                    if (itemQuant.length > 0){
+                        quantity = _.reduce(_.map(itemQuant,function(item){
+                            return item.qty;
+                        }),function(mamo, num){
+                            return mamo + num;
+                        },0);
+                        product = itemQuant.shift();
+                        total = parseInt(quantity * itemProduct.standard_price);
+                        data.push({
+                            id : product.product_id[0],
+                            product : product.product_id[1],
+                            ean13 : self.valorNull(itemProduct.ean13),
+                            category_name : itemProduct.categ_id[1],
+                            qty : accounting.formatNumber(quantity,2, ".", ","),
+                            standard_price : accounting.formatNumber(itemProduct.standard_price,0, ".", ","),
+                            lst_price : accounting.formatNumber(itemProduct.lst_price,0, ".", ","),
+                            valuation: accounting.formatNumber(total,0,".",","),
+                            category_id : itemProduct.categ_id[0],
+                            location_id : product.location_id[0],
+                            location_name: product.location_id[1],
+                            total : total
+                        });
+                    }
+                }
+            }
+
+            self.content = data;
+            self.loadTable(data);
+        },
+
+        // Obtener  Qaunt  por productos
+        getQuantProduct: function(location_id, product_id, quantObjs){
+            var self = this;
+            var quantProdcut = quantObjs;
+            if (location_id){
+                quantProdcut = _.filter(quantProdcut, function(item){
+                    return item.location_id[0] === location_id;
+                });
+            }
+            if (product_id){
+                quantProdcut = _.filter(quantProdcut, function(item){
+                    return item.product_id[0] === product_id;
+                });
+            }
+            return quantProdcut;
+        },
+
+        factSearch: function(){
+            var self = this;
+            var category = this.$el.find('#current-category').val();
+            var product= this.$el.find('#product').val().split('-');
+            var location =this.$el.find('#current-location').val();
+            var content = self.content;
+            // console.log(content);
+            if(category != 9999999){
+                content = _.filter(content,function(inv){
+                    return inv.category_id == category;
+                });
+            }
+            if (location != 9999999){
+                content=_.filter(content, function (inv){
+                    return inv.location_id == location;
+                });
+            }
+
+            if (product != ""){
+                content = _.filter(content, function(inv){
+                    return inv.id == product[0];
+                });
+            }
+            self.loadTable(content)
+            // self.BuildTable(quantObjs,locationObjs)
+        },
+
+
+        loadTable:function(rowsTable){
+            var self = this;
+            self.rowsData = rowsTable;
+            var table = self.$el.find('#table');
+            table.bootstrapTable('load' ,rowsTable);
+        },
+        getObjectPdf: function(){
+            var self = this;
+            var rows=[];
+            var rows = self.rowsData;
+            var total = _.reduce(_.map(rows,function(map){
+                return(map.total);
+            }),function(memo, num){
+                return memo + num;
+            },0);
+            if (rows.length > 0){
+                rows.push({
+                    product: "Totales ",
+                    valuation: accounting.formatNumber(total,0,".",","),
+                });
+            }
+            return rows;
+        },
+        clickOnAction: function (e) {
+            var self = this;
+            var rowsNew;
+            var action = self.$el.find(e.target).val();
+            var table = self.$el.find("#table");
+            var data2 = table.bootstrapTable('getVisibleColumns');
+            var getColumns=[];
+            var rows=[];
+            rowsNew = self.getObjectPdf();
+            if (action === 'pdf') {
+                var dataNEW = _.map(data2, function (val){
+                    return val.field;
+                });
+                _.each(rowsNew,function (item){
+                    rows.push(_.pick(item, dataNEW));
+                });
+                // Obtener los nombre de la Cabezera
+                _.each(_.map(data2,function(val){
+                        return val;
+                    }), function(item){
+                            getColumns.push([{
+                                        title: item.title,
+                                        dataKey: item.field
+                                    }]);
+                });
+                this.drawPDF(_.flatten(getColumns),rows);
+            }
+        },
+        drawPDF:function(getColumns,rows){
+            var self = this;
+            var fechaActu= new Date();
+            var location = this.sucDescrip = this.$el.find('#current-location option:selected').text();
+            var totalPagesExp = "{total_pages_count_string}";
+            var pdfDoc = new jsPDF();
+            pdfDoc.autoTable(getColumns, rows, {
+                    styles: { overflow: 'linebreak', fontSize:8 , columnWidth: 'wrap'},
+                    columnStyles:{
+                                    product :{columnWidth: '8px'},
+                                    qty : {halign:'center'},
+                                    standard_price : {halign:'right'},
+                                    lst_price : {halign:'right'},
+                                    valuation : {halign:'right'},
+                                    category_name :{columnWidth: '8px'},
+                                    location_name :{columnWidth: '8px'},
+                                },
+                    margin: { top: 16, horizontal: 7},
+                addPageContent: function (data) {
+                    pdfDoc.setFontSize(12);
+                    pdfDoc.setFontStyle('bold');
+                    pdfDoc.setTextColor(40);
+                    pdfDoc.text('Listado de productos', data.settings.margin.left, 10);
+                    // FOOTER
+                    var str = "Pagina  " + data.pageCount;
+                    if (typeof pdfDoc.putTotalPages === 'function') {
+                        str = str + " de " + totalPagesExp;
+                        // +"\n  Día de Expedición  "+fechaActu.getDate()+"/"+fechaActu.getMonth()+"/"+fechaActu.getFullYear();
+                    }
+                    pdfDoc.setFontSize(9);
+                    pdfDoc.setFontStyle('bold');
+                    pdfDoc.setTextColor(40);
+                    pdfDoc.text(str, data.settings.margin.left, pdfDoc.internal.pageSize.height - 5);
+                }
+            });
+            if (typeof pdfDoc.putTotalPages === 'function') {
+                pdfDoc.putTotalPages(totalPagesExp);
+            }
+            pdfDoc.save('Listado de productos.pdf');
+        }
+    });
+}

+ 4 - 2
static/src/reports/report_crm.xml

@@ -60,11 +60,11 @@
                                         <input type="radio" name="tipo" id="Y" value="Y" checked="checked"/>
                                         <label for="Y">Sin Filtro</label>
                                         <li>
-                                            <input type="radio" name="cateritica" id="lead" value="lead"/>
+                                            <input type="radio" name="tipo" id="lead" value="lead"/>
                                             <label for="lead">Iniciativa</label>
                                         </li>
                                         <li>
-                                            <input type="radio" name="cateritica" id="opportunity" value="opportunity"/>
+                                            <input type="radio" name="tipo" id="opportunity" value="opportunity"/>
                                             <label for="opportunity">Oportunidad</label>
                                         </li>
                                     </li>
@@ -101,6 +101,8 @@
                         <th data-field="partner">Cliente</th>
                         <th data-field="create_date" data-sortable="true">Fecha</th>
                         <th data-field="stage">Estado</th>
+                        <th data-field="date_last_stage_update">Fecha Cambio Etapa</th>
+                        <th data-field="write_date">Fecha Modificado</th>
                     </tr>
                 </thead>
             </table>

+ 39 - 10
static/src/reports/report_phonecall.xml → static/src/reports/report_crmtask.xml

@@ -1,10 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <template xml:space="preserve">
-    <t t-name="ReportPhoneCall">
+    <t t-name="ReportCrmTask">
         <div class="report_view">
             <div class="reporting_page_header">
-                <h1>Histórico de Llamadas CRM</h1>
-                <div id="volver"></div>
+                <h1>Histórico de Tareas CRM</h1>
             </div>
             <button type="button" class="oe_button oe_form_button oe_highlight" aria-label="Left Align" data-toggle="collapse" href="#collapseExample" aria-expanded="false" aria-controls="collapseExample">FILTRAR
             </button>
@@ -55,9 +54,38 @@
                         <div class="panel panel-default">
                             <div class="panel-heading">Características</div>
                             <div class="panel-body">
-                                <div class="form-group">
-                                    <label for="partner">Buscar Cliente:</label>
-                                    <input id="partner" type="text" class="form-control ui-autocomplete-input" autocomplete="off" placeholder="Nombre/ CI/ Ruc"/>
+                                <div class="col-xs-6">
+                                    <h3>Estado</h3>
+                                    <ul class="list-unstyled">
+                                        <li>
+                                            <input type="radio" name="estado" id="W" value="W" checked="checked"/>
+                                            <label for="W">Sin Filtro</label>
+                                        </li>
+                                        <li>
+                                            <input type="radio" name="estado" id="pending" value="pending"/>
+                                            <label for="pending">Pendiente</label>
+                                        </li>
+                                        <li>
+                                            <input type="radio" name="estado" id="done" value="done"/>
+                                            <label for="done">Realizado</label>
+                                        </li>
+                                        <li>
+                                            <input type="radio" name="estado" id="cancel" value="cancel"/>
+                                            <label for="cancel">Cancelado</label>
+                                        </li>
+                                    </ul>
+                                </div>
+                                <div class="col-xs-12">
+                                    <div class="form-group">
+                                        <label for="current_task">Buscar Tipo:</label>
+                                        <select id="current_task" class="form-control ui-autocomplete-input" name="task" placeholder="Tipo"/>
+                                    </div>
+                                </div>
+                                <div class="col-xs-12">
+                                    <div class="form-group">
+                                        <label for="partner">Buscar Cliente:</label>
+                                        <input id="partner" type="text" class="form-control ui-autocomplete-input" autocomplete="off" placeholder="Nombre/ CI/ Ruc"/>
+                                    </div>
                                 </div>
                             </div>
                         </div>
@@ -66,7 +94,6 @@
             </div>
             <div id="toolbar">
                 <button class="oe_button oe_form_button oe_highlight" value="pdf" id="pdf">PDF</button>
-                <button type="button" class="oe_button oe_form_button oe_highlight" href="#volver_btn">Atras</button>
             </div>
             <table id="table" class="table_paint_first_row"
                 data-pagination="true"
@@ -81,15 +108,17 @@
                 data-search="true">
                 <thead>
                     <tr>
-                        <th data-field="opportunity_id" data-sortable="true">Oportunidad</th>
+                        <th data-field="create_date" data-sortable="true">Fecha</th>
                         <th data-field="partner">Cliente</th>
+                        <th data-field="activity" data-sortable="true">Actividad</th>
+                        <th data-field="user">Cliente</th>
                         <th data-field="description">Descripcion</th>
-                        <th data-field="create_date" data-sortable="true">Fecha</th>
+                        <th data-field="task_name">Tipo</th>
                         <th data-field="stage">Estado</th>
                     </tr>
                 </thead>
             </table>
-            <canvas></canvas>
+            <!-- <canvas></canvas> -->
             <div id="dialog"></div>
         </div>
     </t>

+ 1 - 1
static/src/reports/report_mrp.xml

@@ -3,7 +3,7 @@
     <t t-name="ReportMrp">
         <div class="report_view">
             <div class="reporting_page_header">
-                <h1>Histórico de Producción</h1>
+                <h1>Histórico de Fabricación</h1>
             </div>
             <button type="button" class="oe_button oe_form_button oe_highlight" aria-label="Left Align" data-toggle="collapse" href="#collapseExample" aria-expanded="false" aria-controls="collapseExample">FILTRAR
             </button>

+ 64 - 0
static/src/reports/report_stock_original.xml

@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+    <template xml:space="preserve">
+        <t t-name="ReportStockOriginal">
+            <div class="report_view">
+                <div class="reporting_page_header">
+                    <h1>Análisis de Stock</h1>
+                </div>
+                <button type="button" class="oe_button oe_form_button oe_highlight" aria-label="Left Align" data-toggle="collapse" href="#collapseExample" aria-expanded="false" aria-controls="collapseExample">FILTRAR
+                </button>
+                <div class="collapse" id="collapseExample">
+                    <br/>
+                    <div class="row">
+                        <div class="col-xs-12">
+                            <div class="panel panel-default">
+                                <div class="panel-heading">Características</div>
+                                <div class="panel-body">
+                                    <div class="col-xs-6">
+                                        <div class="form-group">
+                                            <label for="current-location">Todas las Ubicaciones: </label>
+                                            <select id="current-location" class="form-control ui-autocomplete-input"  name="current-location"></select>
+                                        </div>
+                                        <!-- <div class="form-group">
+                                            <label for="current-category">Todas la categorias: </label>
+                                            <select id="current-category" class="form-control ui-autocomplete-input"  name="current-category"></select>
+                                        </div> -->
+                                        <div class="form-group">
+                                            <label for="product">Buscar Producto:</label>
+                                            <input id="product" type="text" class="form-control ui-autocomplete-input" autocomplete="off" placeholder="Nombre/ Referencia/ Codigo de barras"/>
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+                <div id="toolbar">
+                    <button class="oe_button oe_form_button oe_highlight" value="pdf" id="pdf">PDF</button>
+                </div>
+                <table id="table" class="table_paint_first_row"
+                       data-pagination="true"
+                       data-toggle="table"
+                       data-reorderable-columns="true"
+                       data-toolbar="#toolbar"
+                       data-show-columns="true"
+                       data-buttons-class="oe_button oe_form_button oe_highlight"
+                       data-height="auto"
+                       data-classes="table table-hover table-condensed"
+                       data-row-style="rowStyle"
+                       data-search="true">
+                    <thead class="table_header">
+                        <tr>
+                            <th data-field="product" data-sortable="true">Productos</th>
+                            <th data-field="qty" data-sortable="true" data-align="center">Cantidad</th>
+                            <th data-field="standard_price" data-sortable="true" data-align="right">Precio de compra</th>
+                            <th data-field="lst_price" data-sortable="true" data-align="right">Precio de venta </th>
+                            <th data-field="total" data-sortable="true" data-align="right">Valoración de stock</th>
+                            <!-- <th data-field="category_name" data-sortable="true" >Categoria</th> -->
+                            <th data-field="location_name" data-sortable="true">Ubicación</th>
+                        </tr>
+                    </thead>
+                </table>
+            </div>
+        </t>
+    </template>

+ 1 - 1
static/src/xml/eiru_reporting_welcome.xml

@@ -11,7 +11,7 @@
                       <h1>Bienvenido al Area de Reportes</h1>
                     </div>
                     <p style="font-size:20px">
-                        Este sistema te ofrece una funcionalidad muy necesaria para realizar el análisis de la información, denominada “reportes”, que tiene como objetivo principal mostrar la situación actual de la empresa de forma detallada. Consecuentemente, estos reportes revelan la situación de las operaciones regulares dentro de su organización para poder controlar y dirigir de forma ágil.
+                        <!-- Este sistema te ofrece una funcionalidad muy necesaria para realizar el análisis de la información, denominada “reportes”, que tiene como objetivo principal mostrar la situación actual de la empresa de forma detallada. Consecuentemente, estos reportes revelan la situación de las operaciones regulares dentro de su organización para poder controlar y dirigir de forma ágil. -->
                     </p>
                 </div>
                 <div class="col-md-6">

+ 4 - 3
templates.xml

@@ -39,7 +39,8 @@
                 <!-- Analisis de compras -->
                 <script type="text/javascript" src="/eiru_reporting/static/src/js/reports/report_purchases_invoice_analysis.js" />
                 <script type="text/javascript" src="/eiru_reporting/static/src/js/reports/report_stock.js" />
-                <!-- <script type="text/javascript" src="/eiru_reporting/static/src/js/reports/report_stock_location.js" /> -->
+                <!-- <script type="text/javascript" src="/eiru_reporting/static/src/js/reports/report_stock_original.js" />
+                <script type="text/javascript" src="/eiru_reporting/static/src/js/reports/report_stock_location.js" /> -->
                 <script type="text/javascript" src="/eiru_reporting/static/src/js/reports/report_stock_move.js" />
                 <script type="text/javascript" src="/eiru_reporting/static/src/js/reports/report_refund_invoice_supplier.js" />
                 <!-- account -->
@@ -49,8 +50,8 @@
 
                 <!-- crm -->
                 <script type="text/javascript" src="/eiru_reporting/static/src/js/reports/report_crm.js"/>
-                <!-- crm_phonecall -->
-                <script type="text/javascript" src="/eiru_reporting/static/src/js/reports/report_phonecall.js"/>
+                <!-- crm_task -->
+                <script type="text/javascript" src="/eiru_reporting/static/src/js/reports/report_crmtask.js"/>
                   <!-- crm_mensaje -->
                   <script type="text/javascript" src="/eiru_reporting/static/src/js/reports/report_mensajecrm.js"/>
                   <!-- project -->

+ 9 - 3
views/actions.xml

@@ -174,9 +174,9 @@
         </record>
 
         <!-- Historico de llamadas -->
-        <record id="crm_call_report_action" model="ir.actions.client">
-            <field name="name">Historico Llamadas</field>
-            <field name="tag">eiru_reporting.crm_call_action_report</field>
+        <record id="crm_task_report_action" model="ir.actions.client">
+            <field name="name">Historico de Tareas CRM</field>
+            <field name="tag">eiru_reporting.crm_task_action_report</field>
         </record>
 
         <!-- Historico de Mensajes -->
@@ -219,6 +219,12 @@
             <field name="tag">eiru_reporting.stock_action_report</field>
         </record>
 
+		<!-- Analisis de stock original -->
+        <!-- <record id="stock_original_report_action" model="ir.actions.client">
+            <field name="name">Analisis de Stock Original</field>
+            <field name="tag">eiru_reporting.stock_original_action_report</field>
+        </record> -->
+
 		<!-- Analisis de stock por location-->
 		<!-- <record id="stock_location_report_action" model="ir.actions.client">
 			<field name="name">Analisis de Stock por Ubicacion</field>

+ 61 - 56
views/menus.xml

@@ -13,34 +13,19 @@
 	        <menuitem id="report_menu_submenu" parent="report_dashboard_parent_menu" name="Bienvenido" action="all_report_action" />
 
 	    <!-- Segundo Submenu -->
-        <menuitem id="account_report_parent_menu" name="Finanzas" parent="eiru_report_main_menu" sequence="2"/>
+        <menuitem id="purchase_report_parent_menu" name="Compras" parent="eiru_report_main_menu" sequence="1"/>
 
-	        <!-- Resumen Ingreso -->
-	        <menuitem id="resumen_ingreso_report_menu_submenu" parent="account_report_parent_menu" name="Resumen Ingresos" action="ingreso_report_action" sequence="0"/>
+            <!-- Analisis de compras -->
+            <menuitem id="purchase_detail_report_menu_submenu" parent="purchase_report_parent_menu" name="Analisis de compras" action="purchase_detail_report_action" />
 
-	        <!-- Resumen Egreso -->
-	        <menuitem id="resumen_egreso_report_menu_submenu" parent="account_report_parent_menu" name="Resumen Egresos" action="egreso_report_action" sequence="1"/>
-
-	        <!-- Historico de facturas -->
-	        <menuitem id="invoice_report_menu_submenu" parent="account_report_parent_menu" name="Historico de Facturas" action="invoice_report_action" sequence="2"/>
-
-            <!-- Historico de Movimiento de Bancos-->
-            <menuitem id="bank_movements_report_menu_submenu" parent="account_report_parent_menu" name="Historico de Movimiento de Banco" action="bank_movements_report_action" sequence="3"/>
-
-            <!-- Historico de Movimiento de Bancos-->
-            <!-- <menuitem id="bank_gral_report_menu_submenu" parent="account_report_parent_menu" name="Listado de Movimiento Generales de Banco" action="bank_gral_report_action" sequence="4"/> -->
-
-	        <!-- Historico de pagos -->
-	        <menuitem id="voucher_report_menu_submenu" parent="account_report_parent_menu" name="Historico de Pagos" action="voucher_report_action" sequence="5"/>
-
-	        <!-- Listado de cuentas a cobrar-->
-	        <menuitem id="account_pending_menu_submenu" parent="account_report_parent_menu" name="Cuentas a Cobrar" action="account_report_action" sequence="6"/>
+            <!-- Ranking de productos -->
+            <menuitem id="product_ranking_report_menu_submenu" parent="purchase_report_parent_menu" name="Ranking de productos" action="product_ranking_report_action" />
 
-	        <!-- Listado de cuentas a pagar-->
-	        <menuitem id="account_report_menu_submenu" parent="account_report_parent_menu" name="Cuentas a Pagar" action="account_pending_report_action" sequence="7"/>
+            <!-- Ranking de proveedores -->
+            <menuitem id="suppliers_ranking_report_menu_submenu" parent="purchase_report_parent_menu" name="Ranking de proveedores a quien mas compras" action="suppliers_ranking_report_action" />
 
 	    <!-- Ventas Submenu -->
-        <menuitem id="sale_report_parent_menu" name="Ventas" parent="eiru_report_main_menu" sequence="3"/>
+        <menuitem id="sale_report_parent_menu" name="Ventas" parent="eiru_report_main_menu" sequence="2"/>
 
             <!-- Historico de ventas -->
             <menuitem id="sale_order_menu_submenu" parent="sale_report_parent_menu" name="Historico de Ventas" action="sale_order_report_action" sequence="0"/>
@@ -55,7 +40,7 @@
             <menuitem id="productranking_report_menu_submenu" parent="sale_report_parent_menu" name="Ranking de productos mas vendidos" action="productranking_report_action" sequence="3"/>
 
 	    <!-- POS Submenu -->
-        <menuitem id="point_of_sale_report_parent_menu" name="Terminal de Ventas" parent="eiru_report_main_menu" sequence="4"/>
+        <menuitem id="point_of_sale_report_parent_menu" name="TPV" parent="eiru_report_main_menu" sequence="3"/>
 
             <!-- Analisis de ventas -->
             <menuitem id="point_of_sale_detail_report_menu_submenu" parent="point_of_sale_report_parent_menu" name="Analisis de Ventas" action="point_sale_detail_report_action" />
@@ -69,14 +54,8 @@
 	        <!-- Ranking de clientes -->
 	        <menuitem id="point_of_sale_customer_ranking_report_menu_submenu" parent="point_of_sale_report_parent_menu" name="Ranking de Clientes" action="point_sale_customer_ranking_report_action"/>
 
-            <!-- Analisis de pack de productos -->
-            <menuitem id="product_pack_report_menu_submenu" parent="point_of_sale_report_parent_menu" name="Analisis de Pack de Productos" action="product_pack_report_action"/>
-
-            <!-- Listado de produccion de pack utilidad -->
-            <menuitem id="mrp_utilidad_report_menu_submenu" parent="point_of_sale_report_parent_menu" name="Analisis de Utilidad de Pack de Producto" action="mrp_utilidad_report_action"/>
-
         <!-- Pos/Venta Submenu -->
-        <menuitem id="posventa_report_parent_menu" name="Ventas/Terminal de Venta" parent="eiru_report_main_menu" sequence="5"/>
+        <menuitem id="posventa_report_parent_menu" name="Ventas/Terminal de Venta" parent="eiru_report_main_menu" sequence="4"/>
 
             <!-- Analisis de ventas -->
             <menuitem id="point_of_sale_venta_menu_submenu" parent="posventa_report_parent_menu" name="Analisis de Ventas Generales" action="point_venta_report_action" sequence="0"/>
@@ -85,55 +64,81 @@
             <menuitem id="sale_pos_order_menu_submenu" parent="posventa_report_parent_menu" name="Historico de Ventas" action="sale_pos_order_report_action" sequence="1"/>
 
         <!-- Quinto Submenu -->
-        <menuitem id="purchase_report_parent_menu" name="Compras" parent="eiru_report_main_menu" sequence="6"/>
 
-	        <!-- Analisis de compras -->
-	        <menuitem id="purchase_detail_report_menu_submenu" parent="purchase_report_parent_menu" name="Analisis de compras" action="purchase_detail_report_action" />
+        <menuitem id="account_report_parent_menu" name="Finanzas" parent="eiru_report_main_menu" sequence="5"/>
 
-			<!-- Ranking de productos -->
-	        <menuitem id="product_ranking_report_menu_submenu" parent="purchase_report_parent_menu" name="Ranking de productos" action="product_ranking_report_action" />
+        	 <!-- Resumen Ingreso -->
+        	<menuitem id="resumen_ingreso_report_menu_submenu" parent="account_report_parent_menu" name="Resumen Ingresos" action="ingreso_report_action" sequence="0"/>
 
-            <!-- Ranking de proveedores -->
-            <menuitem id="suppliers_ranking_report_menu_submenu" parent="purchase_report_parent_menu" name="Ranking de proveedores a quien mas compras" action="suppliers_ranking_report_action" />
+        	<!-- Resumen Egreso -->
+        	<menuitem id="resumen_egreso_report_menu_submenu" parent="account_report_parent_menu" name="Resumen Egresos" action="egreso_report_action" sequence="1"/>
+
+        	<!-- Historico de facturas -->
+        	<menuitem id="invoice_report_menu_submenu" parent="account_report_parent_menu" name="Historico de Facturas" action="invoice_report_action" sequence="2"/>
+
+            <!-- Historico de Movimiento de Bancos-->
+            <menuitem id="bank_movements_report_menu_submenu" parent="account_report_parent_menu" name="Historico de Movimiento de Banco" action="bank_movements_report_action" sequence="3"/>
+
+            <!-- Historico de Movimiento de Bancos-->
+            <!-- <menuitem id="bank_gral_report_menu_submenu" parent="account_report_parent_menu" name="Listado de Movimiento Generales de Banco" action="bank_gral_report_action" sequence="4"/> -->
+
+        	<!-- Historico de pagos -->
+        	<menuitem id="voucher_report_menu_submenu" parent="account_report_parent_menu" name="Historico de Pagos" action="voucher_report_action" sequence="5"/>
+
+        	<!-- Listado de cuentas a cobrar-->
+            <menuitem id="account_pending_menu_submenu" parent="account_report_parent_menu" name="Cuentas a Cobrar" action="account_report_action" sequence="6"/>
+
+        	<!-- Listado de cuentas a pagar-->
+        	<menuitem id="account_report_menu_submenu" parent="account_report_parent_menu" name="Cuentas a Pagar" action="account_pending_report_action" sequence="7"/>
 
         <!-- Sexto Submenu -->
-        <menuitem id="crm_report_parent_menu" name="CRM" parent="eiru_report_main_menu" sequence="7"/>
 
-	        <!-- CRM -->
-	        <menuitem id="crm_report_menu_submenu" parent="crm_report_parent_menu" name="Historico CRM" action="crm_report_action" />
+        <menuitem id="stock_report_parent_menu" name="Stock" parent="eiru_report_main_menu" sequence="6"/>
 
-	        <!-- Historico de llamadas -->
-	        <menuitem id="crm_call_report_menu_submenu" parent="crm_report_parent_menu" name="Historico de llamadas" action="crm_call_report_action" />
+            <!-- Analisis de stock -->
+            <!-- <menuitem id="stock_location_report_menu_submenu" parent="stock_report_parent_menu" name="Analisis de Stock" action="stock_report_action" /> -->
 
-	        <!-- Historico de mensajes -->
-	        <menuitem id="crm_messages_report_menu_submenu" parent="crm_report_parent_menu" name="Historico de mensajes" action="crm_messages_report_action" />
+            <!-- Analisis de stock -->
+            <menuitem id="stock_report_menu_submenu" parent="stock_report_parent_menu" name="Analisis de Stock por Ubicacion" action="stock_location_report_action" />
+
+            <!-- Analisis de stock -->
+            <!-- <menuitem id="stock_original_report_menu_submenu" parent="stock_report_parent_menu" name="Analisis de Stock Original" action="stock_original_report_action" /> -->
 
-	        <!-- Proyectos -->
-	        <menuitem id="project_report_menu_submenu" parent="crm_report_parent_menu" name="Proyectos" action="project_report_action" />
+            <!--Analisis de movimientos de stock -->
+            <menuitem id="stock_move_report_menu_submenu" parent="stock_report_parent_menu" name="Analisis de movimientos de stock" action="stock_move_report_action"/>
+
+            <!-- Analisis de pack de productos -->
+            <menuitem id="product_pack_report_menu_submenu" parent="stock_report_parent_menu" name="Analisis de Pack de Productos" action="product_pack_report_action"/>
+
+            <!-- Listado de produccion de pack utilidad -->
+            <menuitem id="mrp_utilidad_report_menu_submenu" parent="stock_report_parent_menu" name="Analisis de Utilidad de Pack de Producto" action="mrp_utilidad_report_action"/>
 
 	    <!-- Septimo Submenu -->
-        <menuitem id="mrp_report_parent_menu" name="Produccion" parent="eiru_report_main_menu" sequence="8"/>
+        <menuitem id="mrp_report_parent_menu" name="Fabricacion" parent="eiru_report_main_menu" sequence="7"/>
 
 	        <!-- Informe de trabajos -->
 	        <menuitem id="work_report_menu_submenu" parent="mrp_report_parent_menu" name="Informes de trabajos" action="work_report_action" />
 
 	        <!--Listado de produccion -->
-	        <menuitem id="mrp_report_menu_submenu" parent="mrp_report_parent_menu" name="Listado de produccion" action="mrp_report_action"/>
+	        <menuitem id="mrp_report_menu_submenu" parent="mrp_report_parent_menu" name="Listado de Fabricacion" action="mrp_report_action"/>
 
             <!--Listado de productos más producidos -->
             <menuitem id="rankingmrp_report_menu_submenu" parent="mrp_report_parent_menu" name="Ranking de productos mas producidos" action="mrp_ranking_report_action"/>
 
 	    <!-- Octavo Submenu -->
-        <menuitem id="stock_report_parent_menu" name="Stock" parent="eiru_report_main_menu" sequence="9"/>
+        <menuitem id="crm_report_parent_menu" name="CRM" parent="eiru_report_main_menu" sequence="8"/>
 
-	        <!-- Analisis de stock -->
-	        <!-- <menuitem id="stock_report_menu_submenu" parent="stock_report_parent_menu" name="Analisis de Stock por Ubicacion" action="stock_location_report_action" /> -->
+            <!-- CRM -->
+            <menuitem id="crm_report_menu_submenu" parent="crm_report_parent_menu" name="Historico CRM" action="crm_report_action" />
 
-            <!-- Analisis de stock -->
-            <menuitem id="stock_location_report_menu_submenu" parent="stock_report_parent_menu" name="Analisis de Stock" action="stock_report_action" />
+            <!-- Proyectos -->
+            <menuitem id="project_report_menu_submenu" parent="crm_report_parent_menu" name="Proyectos" action="project_report_action" />
+
+            <!-- Historico de Tareas -->
+            <menuitem id="crm_task_report_menu_submenu" parent="crm_report_parent_menu" name="Historico de Tareas" action="crm_task_report_action" />
 
-	        <!--Analisis de movimientos de stock -->
-	        <menuitem id="stock_move_report_menu_submenu" parent="stock_report_parent_menu" name="Analisis de movimientos de stock" action="stock_move_report_action"/>
+            <!-- Historico de mensajes -->
+            <menuitem id="crm_messages_report_menu_submenu" parent="crm_report_parent_menu" name="Historico de mensajes" action="crm_messages_report_action" />
 
     </data>
 </openerp>