Browse Source

Listado de granja

sebas 4 years ago
commit
072391841b

+ 3 - 0
__init__.py

@@ -0,0 +1,3 @@
+# -*- coding: utf-8 -*-
+import controllers
+import models

BIN
__init__.pyc


+ 23 - 0
__openerp__.py

@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+{
+    'name': "Eiru Reports Farm",
+    'author': "Eiru",
+    'category': 'report',
+    'version': '0.1',
+    'depends': [
+        'base',
+        'farm',
+        'account',
+        'eiru_assets',
+        'eiru_reports',
+    ],
+    'qweb': [
+        'static/src/xml/*.xml',
+        'static/src/reports/*.xml'
+    ],
+    'data': [
+        'templates.xml',
+        'views/actions.xml',
+        'views/menus.xml',
+    ],
+}

+ 2 - 0
controllers.py

@@ -0,0 +1,2 @@
+# -*- coding: utf-8 -*-
+from openerp import http

BIN
controllers.pyc


+ 1 - 0
models.py

@@ -0,0 +1 @@
+# -*- coding: utf-8 -*-

BIN
models.pyc


BIN
static/description/icon.png


+ 10 - 0
static/src/css/custom.css

@@ -0,0 +1,10 @@
+.openerp_webclient_container {
+    height: 100% !important;
+    height: calc(100% - 45px) !important;
+    overflow: auto !important;
+  }
+
+.hover:hover{
+  cursor: grab;
+  cursor: -webkit-grab;
+}

+ 25 - 0
static/src/js/main.js

@@ -0,0 +1,25 @@
+openerp.eiru_reports_farm= function (instance) {
+    "use strict";
+
+    var reporting = instance.eiru_reports_farm;
+
+    reporting_base(instance,reporting);
+
+    try {
+        report_farm_animal(reporting);
+
+    } catch (e) {
+        // ignorar error
+    }
+
+
+    /*
+    ================================================================================
+        HISTORICO DE PRODUCCION
+    ================================================================================
+     */
+    instance.web.client_actions.add('eiru_reports_farm.farm_farm_action', 'instance.eiru_reports_farm.ReportFarmWidget');
+
+
+
+}

+ 22 - 0
static/src/js/reporting_base.js

@@ -0,0 +1,22 @@
+function reporting_base (instance, widget) {
+    "use strict";
+
+    widget.Base = instance.Widget.extend({
+
+        position: 0,
+
+        init: function (parent, position) {
+            this._super(parent);
+            this.position = position || this.position;
+        },
+        start: function () {
+            
+        },
+        getPosition: function () {
+            return this.position;
+        },
+        setPosition: function (position) {
+            this.position = position;
+        }
+    });
+}

+ 548 - 0
static/src/js/reports/report_farm_animal.js

@@ -0,0 +1,548 @@
+function report_farm_animal(reporting) {
+
+ "use strict";
+
+ var model = openerp;
+
+ reporting.ReportFarmWidget = reporting.Base.extend({
+   template: 'ReportFarm',
+   AccountVoucher: [],
+   content: [],
+   rowsData: [],
+   modules: ['farm'],
+   events: {
+     'click #toolbar > button': 'clickOnAction',
+     'click #generate': 'fetchGenerate',
+     'click-row.bs.table #table ': 'clickAnalysisDetail',
+     'change #current-date': 'ShowDateRange',
+     'change #current-store': 'updateUser',
+   },
+   init: function(parent) {
+     this._super(parent);
+   },
+   start: function() {
+     var table = this.$el.find('#table');
+     table.bootstrapTable({
+       data: self.rowsData
+     });
+     var date = new model.eiru_reports.ReportDatePickerWidget(self);
+     date.fecthFecha();
+     this.fetchInitial();
+   },
+
+   // Redirecionar
+   renderReport: function() {
+     var self = this;
+
+     var container = this.$el.closest('.oe_form_sheet.oe_form_sheet_width');
+     this.$el.closest('.report_view').remove();
+     container.find('.report_view').show({
+       effect: 'fade',
+       duration: 200,
+     });
+   },
+   // Verificar el modelo
+   checkModel: function(model) {
+     var self = this;
+     return _.filter(self.modules, function(item) {
+       return item.name === model
+     });
+   },
+   // Lanzar el mensaje
+   showMensaje: function(modelos) {
+     var self = this;
+     $("#dialog").dialog({
+       autoOpen: true,
+       resizable: false,
+       modal: true,
+       title: 'Atención',
+       width: 500,
+       open: function() {
+         $(this).html('Reporte in-disponible, contacte con el administrador del sistema ref : ' + modelos);
+       },
+       show: {
+         effect: "fade",
+         duration: 200
+       },
+       hide: {
+         effect: "fade",
+         duration: 200
+       },
+       buttons: {
+         Aceptar: function() {
+           $(this).dialog('close');
+           self.renderReport()
+         }
+       }
+     });
+     return
+   },
+
+   valorNull: function(dato) {
+     var valor = "";
+     if (dato) {
+       valor = dato;
+     }
+     return valor;
+   },
+
+   ShowDateRange: function() {
+     var self = this;
+     var date = self.$el.find('#current-date').val();
+     if (date == 'range') {
+       self.$el.find('.datepicker').css('display', 'block');
+     }
+     if (date != 'range') {
+       self.$el.find('.datepicker').css('display', 'none');
+     }
+   },
+
+
+   fetchInitial: function() {
+     var self = this;
+     self.fecthIrModuleModule().then(function(IrModuleModule) {
+       return IrModuleModule;
+     }).then(function(IrModuleModule) {
+       self.IrModuleModule = IrModuleModule;
+       return self.fetchResCompany();
+     }).then(function(ResCompany) {
+       self.ResCompany = ResCompany;
+       if (ResCompany.length > 1) {
+         self.$el.find('#current-company').append('<option value="9999999">Todas las empresas</option>');
+         _.each(ResCompany, function(item) {
+           self.$el.find('#current-company').append('<option value="' + item.id + '">' + item.name + '</option>');
+         });
+       } else {
+         self.$el.find('.company').css('display', 'none');
+       }
+
+       return self.fetchResStore();
+     }).then(function(ResStore) {
+       self.ResStore = ResStore;
+       if (ResStore.length > 1) {
+         self.$el.find('#current-store').append('<option value="9999999">Todas las sucursales</option>');
+         _.each(ResStore, function(item) {
+           self.$el.find('#current-store').append('<option value="' + item.id + '">' + item.name + '</option>');
+         });
+       } else {
+         self.$el.find('.store').css('display', 'none');
+       }
+       return self.fetchResUser();
+     }).then(function(ResUser) {
+       self.ResUser = ResUser;
+       if (ResUser.length > 1) {
+         self.$el.find('#current-user').append('<option value="9999999">Todos los usuarios</option>');
+         _.each(ResUser, function(item) {
+           self.$el.find('#current-user').append('<option value="' + item.id + '">' + item.name + '</option>');
+         });
+        } else {
+         self.$el.find('.user').css('display', 'none');
+         }
+       });
+       self.$el.find('#generate').css('display', 'inline');
+       return;
+     },
+
+   fetchGenerate: function() {
+     var self = this;
+     self.$el.find('.search-form').block({
+       message: null,
+       overlayCSS: {
+         backgroundColor: '#FAFAFA'
+       }
+     });
+     self.$el.find('.report-form').block({
+       message: null,
+       overlayCSS: {
+         backgroundColor: '#FAFAFA'
+       }
+     });
+
+     this.fetchFarm().then(function(ResFarm) {
+         return ResFarm;
+     }).then(function(ResFarm) {
+         self.ResFarm =ResFarm;
+         return self.BuildTable();
+     });
+   },
+
+   fecthIrModuleModule: function() {
+     var self = this;
+     var defer = $.Deferred();
+     var fields = ['name', 'id'];
+     var domain = [
+       ['state', '=', 'installed'],
+       ['name', 'in', self.modules]
+     ];
+     var IrModuleModule = new model.web.Model('ir.module.module');
+     IrModuleModule.query(fields).filter(domain).all().then(function(results) {
+       defer.resolve(results);
+     })
+     return defer;
+   },
+
+
+
+   /*=====================================================================
+       USER
+   =====================================================================*/
+   fetchResUser: function() {
+     var self = this;
+     var defer = $.Deferred();
+     var fields = ['id', 'name', 'store_id'];
+     var ResUser = new model.web.Model('res.users');
+     ResUser.query(fields).filter().all().then(function(results) {
+       defer.resolve(results);
+     });
+     return defer;
+   },
+
+   /*====================================================================
+       RES COMPANY
+   ====================================================================*/
+   fetchResCompany: function() {
+     var self = this;
+     var defer = $.Deferred();
+     var currency = new model.web.Model('res.company');
+     var field = ['id', 'name', 'currency_id', 'logo'];
+     currency.query(field).filter().all().then(function(results) {
+       defer.resolve(results);
+     });
+     return defer;
+   },
+
+   getResCompany: function(id) {
+     var self = this;
+     return _.filter(self.ResCompany, function(item) {
+       return item.id == id;
+     })
+   },
+
+   /*====================================================================
+         RES STORE
+     ====================================================================*/
+   fetchResStore: function() {
+     var self = this;
+     var defer = $.Deferred();
+     var field = ['id', 'name', 'company_id'];
+     var ResStore = new model.web.Model('res.store');
+     ResStore.query(field).all().then(function(results) {
+       defer.resolve(results);
+     });
+     return defer;
+   },
+
+
+   /*====================================================================
+       CRM
+   ====================================================================*/
+   fetchFarm: function() {
+     var self = this;
+     var defer = $.Deferred();
+     var company = self.$el.find('#current-company').val();
+     var store = self.$el.find('#current-store').val();
+     // var user = self.$el.find('#current-user').val();
+     // var state = self.$el.find('#current-state').val();
+     var date = self.$el.find('#current-date').val();
+     var desde = self.$el.find('#from').val();
+     var hasta = self.$el.find('#to').val();
+
+     var domain = [
+     ];
+     if (company && company != 9999999) {
+
+       domain.push(['company_id', '=', company]);
+     }
+
+     if (store && store != 9999999) {
+       var user_ids = _.map(_.filter(self.ResUser, function(item) {
+         return item.store_id[0] == store;
+       }), function(map) {
+         return map.id;
+       });
+       domain.push(['user_id', 'in', user_ids]);
+     }
+
+     // if (user && user != 9999999) {
+     //
+     //   domain.push(['user_id', '=', parseInt(user)]);
+     // }
+
+
+     if (date && date != 9999999) {
+
+       if (desde) {
+         var date = desde.split('/')
+         date = (date[2] + "-" + date[1] + "-" + date[0]);
+         domain.push(['arrival_date', '>=', date]);
+       }
+
+       if (hasta) {
+         var date = hasta.split('/')
+         date = (date[2] + "-" + date[1] + "-" + date[0]);
+         domain.push(['arrival_date', '<=', date]);
+       }
+
+       if (date == 'today') {
+         var today = moment().format('YYYY-MM-DD');
+         domain.push(['arrival_date', '=', today]);
+       }
+
+       if (date == 'yesterday') {
+         var yesterday = moment().add(-1, 'days').format('YYYY-MM-DD');
+         domain.push(['arrival_date', '=', yesterday]);
+       }
+
+       if (date == 'currentMonth') {
+         var currentMonth = moment().format('YYYY-MM');
+         domain.push(['arrival_date', 'like', currentMonth]);
+       }
+
+       if (date == 'lastMonth') {
+         var lastMonth = moment().add(-1, 'months').format('YYYY-MM');
+         domain.push(['arrival_date', 'like', lastMonth]);
+       }
+     }
+
+
+     var fields = [
+       'id',
+       'number',
+       'company_id',
+       'sex',
+       'arrival_date',
+       'birthdate',
+       'origin',
+       'current_weight',
+       'location_id',
+     ];
+     var ResFarm = new model.web.Model('farm.animal');
+     ResFarm.query(fields).filter(domain).all().then(function(results) {
+       defer.resolve(results);
+     });
+     return defer;
+   },
+
+
+   updateUser: function() {
+     var self = this;
+     var store = self.$el.find('#current-store').val();
+     if (store != 9999999) {
+       var user = self.$el.find('#current-user').empty();
+       self.$el.find('#current-user').append('<option value="9999999">Todos los usuarios</option>');
+       _.each(self.ResUser, function(item) {
+         if (parseFloat(store) == item.store_id[0]) {
+           self.$el.find('#current-user').append('<option value="' + item.id + '">' + item.name + '</option>');
+         }
+       });
+     } else {
+       var user = self.$el.find('#current-user').empty();
+       self.$el.find('#current-user').append('<option value="9999999">Todos los usuarios</option>');
+       _.each(self.ResUser, function(item) {
+         self.$el.find('#current-user').append('<option value="' + item.id + '">' + item.name + '</option>');
+       });
+     }
+   },
+
+   /*====================================================================
+       BUILD
+   ====================================================================*/
+   BuildTable: function() {
+     var self = this;
+     var data = [];
+     var CurrencyBase = self.ResCompany[0].currency_id;
+     var ResFarm = self.ResFarm;
+     _.each(ResFarm, function(item) {
+       if (item.sex == 'female') {
+         var sex = 'Femenino';
+       }
+       if (item.sex == 'male') {
+         var sex = 'Masculino';
+       }
+       if (item.sex == 'undetermined') {
+         var sex = 'Indeterminado';
+       }
+
+       if (item.origin == 'purchased') {
+         var origin = 'Comprado';
+       }
+       if (item.origin == 'raised') {
+         var origin = 'Criado';
+       }
+
+       data.push({
+         id: item.id,
+         number: item.number,
+         sex: sex,
+         arrival_date: moment(item.arrival_date).format("DD/MM/YYYY"),
+         date: moment(item.arrival_date).format("YYYY-MM-DD"),
+         origin: origin,
+         weight:  item.current_weight[1],
+         birthdate: moment(item.birthdate).format("DD/MM/YYYY"),
+         decimal_places: CurrencyBase.decimal_places,
+         thousands_separator: CurrencyBase.thousands_separator,
+         decimal_separator: CurrencyBase.decimal_separator,
+       });
+     });
+     self.content = data;
+     self.loadTable(data);
+
+     self.$el.find('.report-form').css('display', 'block');
+     self.$el.find('.search-form').unblock();
+     self.$el.find('.report-form').unblock();
+   },
+
+   loadTable: function(rowsTable) {
+     var self = this;
+     self.rowsData = rowsTable;
+     var table = this.$el.find('#table');
+     table.bootstrapTable('load', rowsTable);
+   },
+
+
+   clickOnAction: function(e) {
+     var self = this;
+     var action = this.$el.find(e.target).val();
+     var company = $('#current-company').val();
+     if (company && company != 9999999) {
+       var ResCompany = self.getResCompany(company).shift();
+     } else {
+       var ResCompany = self.ResCompany[0];
+     }
+     var getColumns = [];
+     var rows = [];
+     var table = this.$el.find("#table");
+     var column = table.bootstrapTable('getVisibleColumns');
+     var row = table.bootstrapTable('getData');
+
+     // var product_qty = QuantityFooter(row);
+     // var product_price = TotalFooter(row);
+
+    // row.push({
+    //     date_planned : 'Totales',
+    //     product_qty : product_qty,
+    //     product_price : product_price,
+    // });
+
+
+     if (action === 'pdf') {
+       var data = _.map(column, function(val) {
+         return val.field
+       });
+       _.each(_.map(column, function(val) {
+         return val
+       }), function(item) {
+         getColumns.push([{
+           title: item.title,
+           dataKey: item.field
+         }]);
+       });
+       var pdf_title = 'Listado de Animales';
+       var pdf_type = 'l';
+       var pdf_name = 'Listado de Animales_';
+       var pdf_columnStyles = {
+         number: {columnWidth: 18,halign: 'center'},
+         arrival_date: {columnWidth: 25,halign: 'center'},
+         origin: {columnWidth: 40,halign: 'left'},
+         sex: {columnWidth: 60,halign: 'left'},
+         birthdate: {columnWidth: 30,halign: 'right'},
+         weight: {columnWidth: 20,halign: 'right'},
+
+         // location: {columnWidth: 30,halign: 'left'},
+       };
+       var filter = self.getFilter();
+       var pdf = new model.eiru_reports.ReportPdfWidget(self);
+       pdf.drawPDF(
+         _.flatten(getColumns),
+         row,
+         ResCompany,
+         pdf_title,
+         pdf_type,
+         pdf_name,
+         pdf_columnStyles,
+         filter,
+       );
+     }
+   },
+
+   getFilter: function() {
+     var self = this;
+     var company = self.$el.find('#current-company').val();
+     var store = self.$el.find('#current-store').val();
+     // var user = self.$el.find('#current-user').val();
+     // var state = self.$el.find('#current-state').val();
+     var date = self.$el.find('#current-date').val();
+     var desde = self.$el.find('#from').val();
+     var hasta = self.$el.find('#to').val();
+
+     var filter = [];
+
+     if (company && company != 9999999) {
+       var ResCompany = _.filter(self.ResCompany, function(item) {
+         return item.id == company;
+       });
+       filter.push({
+         title: 'Empresa',
+         value: ResCompany[0].name,
+       });
+     }
+
+     if (store && store != 9999999) {
+       var ResStore = _.filter(self.ResStore, function(item) {
+         return item.id == store;
+       });
+       filter.push({
+         title: 'Sucursal',
+         value: ResStore[0].name,
+       });
+     }
+     // if (user && user != 9999999) {
+     //   var ResUser = _.filter(self.ResUser, function(item) {
+     //     return item.id == user;
+     //   })
+     //   filter.push({
+     //     title: 'Responsable',
+     //     value: ResUser[0].name,
+     //   });
+     // }
+
+     // if (state && state != 9999999) {
+     //   filter.push({
+     //     title: 'Estado',
+     //     value: $('#current-state option:selected').text(),
+     //   });
+     // }
+
+     if (date && date != 9999999) {
+       moment.locale('es', {
+         months: 'Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre'.split('_'),
+       });
+
+       if (date == 'range') {
+         filter.push({
+           title: 'Fecha',
+           value: desde + ' al ' + hasta,
+         });
+       } else {
+         if (date == 'today') {
+           var fecha = moment().format('DD/MM/YYYY');
+         }
+         if (date == 'yesterday') {
+           var fecha = moment().add(-1, 'days').format('DD/MM/YYYY');
+         }
+         if (date == 'currentMonth') {
+           var fecha = moment().format('MMMM/YYYY');
+         }
+         if (date == 'lastMonth') {
+           var fecha = moment().add(-1, 'months').format('MMMM/YYYY');
+         }
+         filter.push({
+           title: 'Fecha',
+           value: fecha,
+         });
+       }
+     }
+     return filter;
+   },
+ });
+}

+ 630 - 0
static/src/js/reports/report_mrp_bom_analysis.js

@@ -0,0 +1,630 @@
+function report_mrp_bom_analysis (reporting){
+    "use strict";
+
+    var model = openerp;
+
+    reporting.ReportMrpAnalysisWidget = reporting.Base.extend({
+        template: 'ReportMrpAnalysis',
+        ResMrp: [],
+        mrpLines: [],
+        productProduct:[],
+        modules: ['mrp','eiru_mrp_cost'],
+        ResCurrency:[],
+        rowsData :[],
+        content :[],
+        rowOrigin:[],
+        ResCompany:[],
+        events: {
+          'click #toolbar > button': 'clickOnAction',
+          'click #generate': 'fetchGenerate',
+          'click-row.bs.table #table ': 'clickAnalysisDetail',
+          'change #current-company' : 'updateSelections',
+          'change #current-date': 'ShowDateRange',
+          'change #current-store': 'updateUser',
+        },
+        init : function(parent){
+          this._super(parent);
+        },
+        start: function () {
+            var self = this;
+            var table = this.$el.find('#table');
+            table.bootstrapTable({data : self.rowsData});
+            var date = new model.eiru_reports.ReportDatePickerWidget(self);
+            date.fecthFecha();
+            this.fetchInitial();
+        },
+        // ckickAnalysisDetail: function(e, row, $element, field){
+            // if (field == 'name'){
+            //     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_product]],
+            //         context : {},
+            //         flags : {'form': {'action_buttons': false, 'options': {'mode': 'view'}}},
+            //         res_id : row.id_product,
+            //     });
+            // }
+        //     if (field == 'name'){
+        //         this.do_action({
+        //             name : "Producción",
+        //             type : 'ir.actions.act_window',
+        //             res_model : "mrp.production",
+        //             views : [[false,'form']],
+        //             target : 'new',
+        //             domain : [['id','=', row.id]],
+        //             context : {},
+        //             flags : {'form': {'action_buttons': false, 'options': {'mode': 'view'}}},
+        //             res_id : row.id,
+        //         });
+        //     }
+        //     e.stopImmediatePropagation();
+        // },
+        // Redirecionar
+        renderReport: function() {
+          var self = this;
+
+          var container = this.$el.closest('.oe_form_sheet.oe_form_sheet_width');
+          this.$el.closest('.report_view').remove();
+          container.find('.report_view').show({
+            effect: 'fade',
+            duration: 200,
+          });
+        },
+
+        // Verificar el modelo
+        checkModel: function(model) {
+          var self = this;
+          return _.filter(self.modules, function(item) {
+            return item.name === model
+          });
+        },
+        // Lanzar el mensaje
+        showMensaje: function(modelos) {
+          var self = this;
+          $("#dialog").dialog({
+            autoOpen: true,
+            resizable: false,
+            modal: true,
+            title: 'Atención',
+            width: 500,
+            open: function() {
+              $(this).html('Reporte in-disponible, contacte con el administrador del sistema ref : ' + modelos);
+            },
+            show: {
+              effect: "fade",
+              duration: 200
+            },
+            hide: {
+              effect: "fade",
+              duration: 200
+            },
+            buttons: {
+              Aceptar: function() {
+                $(this).dialog('close');
+                self.renderReport()
+              }
+            }
+          });
+          return
+        },
+
+        valorNull: function(dato) {
+          var valor = "";
+          if (dato) {
+            valor = dato;
+          }
+          return valor;
+        },
+
+         // Fecha
+         ShowDateRange: function() {
+           var self = this;
+           var date = self.$el.find('#current-date').val();
+           if (date == 'range') {
+             self.$el.find('.datepicker').css('display', 'block');
+           }
+           if (date != 'range') {
+             self.$el.find('.datepicker').css('display', 'none');
+           }
+         },
+
+        // Cansultar
+        fetchInitial: function () {
+            var self = this;
+            self.fecthIrModuleModule().then(function(IrModuleModule) {
+              return IrModuleModule;
+            }).then(function(IrModuleModule) {
+              self.IrModuleModule = IrModuleModule;
+              return self.fetchResCompany();
+            }).then(function(ResCompany) {
+              self.ResCompany = ResCompany;
+              if (ResCompany.length > 1) {
+                self.$el.find('#current-company').append('<option value="9999999">Todas las empresas</option>');
+                _.each(ResCompany, function(item) {
+                  self.$el.find('#current-company').append('<option value="' + item.id + '">' + item.name + '</option>');
+                });
+              } else {
+                self.$el.find('.company').css('display', 'none');
+              }
+              self.fecthCheckType();
+              return self.fetchResStore();
+            }).then(function(ResStore) {
+              self.ResStore = ResStore;
+              if (ResStore.length > 1) {
+                self.$el.find('#current-store').append('<option value="9999999">Todas las sucursales</option>');
+                _.each(ResStore, function(item) {
+                  self.$el.find('#current-store').append('<option value="' + item.id + '">' + item.name + '</option>');
+                });
+              } else {
+                self.$el.find('.store').css('display', 'none');
+              }
+              return self.fetchResUser();
+            }).then(function(ResUser) {
+              self.ResUser = ResUser;
+              if (ResUser.length > 1) {
+                self.$el.find('#current-user').append('<option value="9999999">Todos los usuarios</option>');
+                _.each(ResUser, function(item) {
+                  self.$el.find('#current-user').append('<option value="' + item.id + '">' + item.name + '</option>');
+                });
+               } else {
+                self.$el.find('.user').css('display', 'none');
+                }
+              });
+              self.$el.find('#generate').css('display', 'inline');
+              return;
+            },
+
+            fetchGenerate: function() {
+              var self = this;
+              self.$el.find('.search-form').block({
+                message: null,
+                overlayCSS: {
+                  backgroundColor: '#FAFAFA'
+                }
+              });
+              self.$el.find('.report-form').block({
+                message: null,
+                overlayCSS: {
+                  backgroundColor: '#FAFAFA'
+                }
+              });
+
+              this.fetchMrp().then(function(ResMrp) {
+                  return ResMrp;
+              }).then(function(ResMrp) {
+                  self.ResMrp =ResMrp;
+                  return self.fetchMrpLine();
+              }).then(function (mrpLines) {
+                  self.mrpLines = mrpLines;
+                  return self.fetchProductProduct();
+              }).then(function(ProductProduct){
+                  self.ProductProduct = ProductProduct;
+                  return self.BuildTable();
+              });
+            },
+
+            fecthIrModuleModule: function() {
+              var self = this;
+              var defer = $.Deferred();
+              var fields = ['name', 'id'];
+              var domain = [
+                ['state', '=', 'installed'],
+                ['name', 'in', self.modules]
+              ];
+              var IrModuleModule = new model.web.Model('ir.module.module');
+              IrModuleModule.query(fields).filter(domain).all().then(function(results) {
+                defer.resolve(results);
+              })
+              return defer;
+            },
+
+
+
+        /*=====================================================================
+            Check type
+        =====================================================================*/
+        fecthCheckType: function() {
+          var self = this;
+          var modules = self.checkModel('eiru_mrp_cost');
+          if (modules.length == 0) {
+            self.$el.find('.type').css('display', 'none');
+          }
+        },
+
+        /*=====================================================================
+            USER
+        =====================================================================*/
+        fetchResUser: function() {
+          var self = this;
+          var defer = $.Deferred();
+          var fields = ['id', 'name', 'store_id'];
+          var ResUser = new model.web.Model('res.users');
+          ResUser.query(fields).filter().all().then(function(results) {
+            defer.resolve(results);
+          });
+          return defer;
+        },
+
+        /*====================================================================
+            RES COMPANY
+        ====================================================================*/
+        fetchResCompany: function() {
+          var self = this;
+          var defer = $.Deferred();
+          var currency = new model.web.Model('res.company');
+          var field = ['id', 'name', 'currency_id', 'logo'];
+          currency.query(field).filter().all().then(function(results) {
+            defer.resolve(results);
+          });
+          return defer;
+        },
+
+        getResCompany: function(id) {
+          var self = this;
+          return _.filter(self.ResCompany, function(item) {
+            return item.id == id;
+          })
+        },
+
+        fetchResStore: function(){
+            var self = this;
+            var defer = $.Deferred();
+            var field=['id', 'name'];
+            var ResStore = new model.web.Model('res.store');
+            ResStore.query(field).all().then(function(results){
+                defer.resolve(results);
+            });
+            return defer;
+        },
+
+        // Invoice (FACTURAS)
+        fetchMrp: function () {
+            var self = this;
+            var defer = $.Deferred();
+            var company = self.$el.find('#current-company').val();
+            var store = self.$el.find('#current-store').val();
+            var user = self.$el.find('#current-user').val();
+            var state = self.$el.find('#current-state').val();
+            var date = self.$el.find('#current-date').val();
+            var desde = self.$el.find('#from').val();
+            var hasta = self.$el.find('#to').val();
+
+            // var filter ="[['state', 'in',['progress','done']]]";
+            var domain = [
+            ];
+            if (company && company != 9999999) {
+
+              domain.push(['company_id', '=', company]);
+            }
+
+            if (store && store != 9999999) {
+              var user_ids = _.map(_.filter(self.ResUser, function(item) {
+                return item.store_id[0] == store;
+              }), function(map) {
+                return map.id;
+              });
+              domain.push(['user_id', 'in', user_ids]);
+            }
+
+            if (user && user != 9999999) {
+
+              domain.push(['user_id', '=', parseInt(user)]);
+            }
+
+            if (state != 9999999) {
+              domain.push(['state', '=', state]);
+            }
+
+            if (date && date != 9999999) {
+
+              if (desde) {
+                var date = desde.split('/')
+                date = (date[2] + "-" + date[1] + "-" + date[0]);
+                domain.push(['date_planned', '>=', date]);
+              }
+
+              if (hasta) {
+                var date = hasta.split('/')
+                date = (date[2] + "-" + date[1] + "-" + date[0]);
+                domain.push(['date_planned', '<=', date]);
+              }
+
+              if (date == 'today') {
+                var today = moment().format('YYYY-MM-DD');
+                domain.push(['date_planned', '=', today]);
+              }
+
+              if (date == 'yesterday') {
+                var yesterday = moment().add(-1, 'days').format('YYYY-MM-DD');
+                domain.push(['date_planned', '=', yesterday]);
+              }
+
+              if (date == 'currentMonth') {
+                var currentMonth = moment().format('YYYY-MM');
+                domain.push(['date_planned', 'like', currentMonth]);
+              }
+
+              if (date == 'lastMonth') {
+                var lastMonth = moment().add(-1, 'months').format('YYYY-MM');
+                domain.push(['date_planned', 'like', lastMonth]);
+              }
+            }
+
+            var field =['id', 'name', 'company_id', 'product_id', 'state', 'prod_price_unit', 'product_qty', 'product_price', 'move_lines2','date_planned','user_id'];
+            var defer = $.Deferred();
+            var ResMrp = new model.web.Model('mrp.production');
+            ResMrp.query(field).filter(domain).all().then(function (results) {
+                defer.resolve(results);
+            });
+            return defer;
+        },
+
+        // Invoice line (Linea de Factura)
+        fetchMrpLine: function () {
+            var self = this;
+            var defer = $.Deferred();
+            var linesIds = _.flatten(_.map(self.ResMrp, function (item) {
+                return item.move_lines2;
+            }));
+            var mrpLines = new model.web.Model('stock.move');
+            mrpLines.query(['id', 'product_id', 'product_qty', 'price_unit',  'name', 'origin','raw_material_production_id','production_id']).filter([['id', 'in', linesIds]]).all().then(function (results) {
+                defer.resolve(results)
+            });
+            return defer;
+        },
+
+
+
+        // Product Product
+        fetchProductProduct: function(){
+            var self = this;
+            var defer = $.Deferred();
+            var product_ids = _.flatten(_.map(self.mrpLines, function (item) {
+                return item.product_id[0];
+            }));
+            var domain = [['id','in',product_ids]];
+            var ProductProduct = new model.web.Model('product.product');
+            ProductProduct.query(['id','name','name_template', 'standard_price','type','attribute_value_ids', 'lst_price','ean13','categ_id','attribute_str']).filter(domain).all().then(function (results) {
+                defer.resolve(results)
+            });
+            return defer;
+        },
+
+
+        // Obtener la Detalles de la Factura
+        getInvoice: function (id_line){
+            var self = this;
+            return _.find(this.ResMrp, function (inv) {
+                return _.contains(inv.move_lines2, id_line);
+            });
+        },
+
+
+
+        // Obtener las lineas de las Facturas
+        getProductProduct: function(pro_id){
+            var self = this;
+            return _.find(self.ProductProduct, function(item){
+                return _.contains(pro_id, item.id);
+            });
+        },
+
+
+        BuildTable: function(){
+            var self = this;
+            var data=[];
+            var item;
+            var mrp=[];
+            var product;
+
+            for (var i = 0; i < this.mrpLines.length; i++) {
+                item = this.mrpLines[i];
+                mrp = this.getInvoice(item.id);
+
+
+                // _.each(ResMrp, function(item) {
+                    if (mrp.state == 'confirmed') {
+                      var state = 'Confirmado';
+                    }
+                    if (mrp.state == 'planned') {
+                      var state = 'Planeado';
+                    }
+                    if (mrp.state == 'progress') {
+                      var state = 'En progreso';
+                    }
+                    if (mrp.state == 'done') {
+                      var state = 'Realizado';
+                    }
+                    if (mrp.state == 'cancel') {
+                      var state = 'Cancelado';
+                    }
+                        product =this.getProductProduct(item.product_id);
+
+                        if (product != undefined){
+                            // var store_id = self.getAccountJournal(mrp.journal_id[0]);
+                            // if(store_id.length > 0){
+                                data.push({
+                                    id : mrp.id,
+                                    name : (mrp.name),
+                                    product_id : item.product_id[0],
+                                    product_name : item.product_id[1],
+                                    product_qty : accounting.formatNumber((item.product_qty),2, ".", ","),
+                                    price_unit : accounting.formatNumber((item.price_unit),0, ".", ","),
+                                    price_tot : accounting.formatNumber((item.product_qty * (item.price_unit)),2, ".", ","),
+                                    quantity_tot : (item.product_qty),
+                                    price_tot_tot : ((item.product_qty* (item.price_unit))),
+                                    date_planned :moment(mrp.date_planned).format("DD/MM/YYYY"),
+                                    date_invoice : (mrp.date_planned),
+                                    user_id : self.valorNull(mrp.user_id[0]),
+                                    user : mrp.user_id[1],
+                                    state: state,
+                                });
+                            // }
+                        }
+
+          }
+          self.content = data;
+          self.loadTable(data);
+
+          self.$el.find('.report-form').css('display', 'block');
+          self.$el.find('.search-form').unblock();
+          self.$el.find('.report-form').unblock();
+        },
+
+        loadTable: function(rowsTable) {
+          var self = this;
+          self.rowsData = rowsTable;
+          var table = this.$el.find('#table');
+          table.bootstrapTable('load', rowsTable);
+        },
+
+
+        clickOnAction: function(e) {
+          var self = this;
+          var action = this.$el.find(e.target).val();
+          var company = $('#current-company').val();
+          if (company && company != 9999999) {
+            var ResCompany = self.getResCompany(company).shift();
+          } else {
+            var ResCompany = self.ResCompany[0];
+          }
+          var getColumns = [];
+          var rows = [];
+          var table = this.$el.find("#table");
+          var column = table.bootstrapTable('getVisibleColumns');
+          var row = table.bootstrapTable('getData');
+
+          var product_qty = QuantityFooter(row);
+          var price_tot = TotalFooter(row);
+
+         row.push({
+             date_planned : 'Totales',
+             product_qty : product_qty,
+             price_tot : price_tot,
+         });
+
+
+          if (action === 'pdf') {
+            var data = _.map(column, function(val) {
+              return val.field
+            });
+            _.each(_.map(column, function(val) {
+              return val
+            }), function(item) {
+              getColumns.push([{
+                title: item.title,
+                dataKey: item.field
+              }]);
+            });
+            var pdf_title = 'Análisis de Producción';
+            var pdf_type = 'l';
+            var pdf_name = 'Análisis de Producción_';
+            var pdf_columnStyles = {
+              date_planned: {columnWidth: 18,halign: 'center'},
+              name: {columnWidth: 25,halign: 'center'},
+              product: {columnWidth: 60,halign: 'left'},
+              prod_price_unit: {columnWidth: 18,halign: 'right'},
+              product_qty: {columnWidth: 18,halign: 'center'},
+              price_tot : {columnWidth: 20,halign: 'right'},
+              user: {columnWidth: 30,halign: 'left'},
+              state: {columnWidth: 16,halign: 'center'},
+            };
+            var filter = self.getFilter();
+            var pdf = new model.eiru_reports.ReportPdfWidget(self);
+            pdf.drawPDF(
+              _.flatten(getColumns),
+              row,
+              ResCompany,
+              pdf_title,
+              pdf_type,
+              pdf_name,
+              pdf_columnStyles,
+              filter,
+            );
+          }
+        },
+
+        getFilter: function() {
+          var self = this;
+          var company = self.$el.find('#current-company').val();
+          var store = self.$el.find('#current-store').val();
+          var user = self.$el.find('#current-user').val();
+          var state = self.$el.find('#current-state').val();
+          var date = self.$el.find('#current-date').val();
+          var desde = self.$el.find('#from').val();
+          var hasta = self.$el.find('#to').val();
+
+          var filter = [];
+
+          if (company && company != 9999999) {
+            var ResCompany = _.filter(self.ResCompany, function(item) {
+              return item.id == company;
+            });
+            filter.push({
+              title: 'Empresa',
+              value: ResCompany[0].name,
+            });
+          }
+
+          if (store && store != 9999999) {
+            var ResStore = _.filter(self.ResStore, function(item) {
+              return item.id == store;
+            });
+            filter.push({
+              title: 'Sucursal',
+              value: ResStore[0].name,
+            });
+          }
+          if (user && user != 9999999) {
+            var ResUser = _.filter(self.ResUser, function(item) {
+              return item.id == user;
+            })
+            filter.push({
+              title: 'Responsable',
+              value: ResUser[0].name,
+            });
+          }
+
+          if (state && state != 9999999) {
+            filter.push({
+              title: 'Estado',
+              value: $('#current-state option:selected').text(),
+            });
+          }
+
+          if (date && date != 9999999) {
+            moment.locale('es', {
+              months: 'Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre'.split('_'),
+            });
+
+            if (date == 'range') {
+              filter.push({
+                title: 'Fecha',
+                value: desde + ' al ' + hasta,
+              });
+            } else {
+              if (date == 'today') {
+                var fecha = moment().format('DD/MM/YYYY');
+              }
+              if (date == 'yesterday') {
+                var fecha = moment().add(-1, 'days').format('DD/MM/YYYY');
+              }
+              if (date == 'currentMonth') {
+                var fecha = moment().format('MMMM/YYYY');
+              }
+              if (date == 'lastMonth') {
+                var fecha = moment().add(-1, 'months').format('MMMM/YYYY');
+              }
+              filter.push({
+                title: 'Fecha',
+                value: fecha,
+              });
+            }
+          }
+          return filter;
+        },
+      });
+     }

+ 155 - 0
static/src/reports/report_farm_animal.xml

@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<template xml:space="preserve">
+  <t t-name="ReportFarm">
+    <div class="report_view">
+      <div class="reporting_page_header">
+        <h1 class="report_title">Listado de Animales</h1>
+      </div>
+
+      <div class="container search-form" style="border-bottom:1px solid #eee; width:90%;">
+        <div class="row">
+          <div class="col-lg-3 company filter-style">
+            <label>Empresa</label>
+            <select id="current-company" class="form-control form-control-sm"></select>
+          </div>
+          <div class="col-lg-3 store filter-style">
+            <label>Sucursal</label>
+            <select id="current-store" class="form-control form-control-sm"></select>
+          </div>
+
+          <!-- <div class="col-lg-3 user filter-style">
+            <label>Responsable</label>
+            <select id="current-user" class="form-control form-control-sm"></select>
+          </div> -->
+
+
+          <div class="col-lg-3 filter-style">
+            <label>Fecha Ingreso</label>
+            <select id="current-date" class="form-control form-control-sm">
+              <option value="9999999">Todas las fechas</option>
+              <option value="today">Hoy</option>
+              <option value="yesterday">Ayer</option>
+              <option value="currentMonth">Mes Actual</option>
+              <option value="lastMonth">Mes Pasado</option>
+              <option value="range">Busqueda Avanzada</option>
+            </select>
+          </div>
+        </div>
+
+        <div class="row" >
+          <div class="datepicker" style="display:none;">
+            <div class="col-lg-3 filter-style col-md-offset-3">
+              <div class="input-group">
+                <span class="input-group-addon" id="basic-addon1">Desde</span>
+                <input type="text" id="from" class="form-control" aria-describedby="basic-addon1"/>
+              </div>
+            </div>
+            <div class="col-lg-3 filter-style">
+              <div class="input-group">
+                <span class="input-group-addon" id="basic-addon1">Hasta</span>
+                <input type="text" id="to" class="form-control" aria-describedby="basic-addon1"/>
+              </div>
+            </div>
+          </div>
+        </div>
+
+        <div class="row">
+          <div class="text-center" style="padding-top:20px;">
+            <button id="generate" class="myButton" aria-label="Left Align" style="color:#fff;display:none;">
+              Generar
+            </button>
+          </div>
+          <br/>
+        </div>
+      </div>
+
+      <div class="report-form" style="display:none;">
+        <!-- <div class="chart-container center-block" style="padding-top:20px; height:300px; width:90%; padding-bottom:20px;">
+          <canvas id="reporting-chart" class="reporting-chart"></canvas>
+        </div> -->
+        <div id="toolbar">
+          <button class="oe_button oe_form_button myButton" value="pdf">Imprimir Informe</button>
+        </div>
+        <div class="container" style="width:100%">
+            <table id="table"
+                data-pagination="true"
+                data-toggle="table"
+                data-toolbar="#toolbar"
+                data-show-columns="true"
+                data-classes="table table-condensed table-no-bordered"
+                data-row-style="rowStyle"
+                data-search="true"
+                data-show-export="true"
+                data-show-toggle="true"
+                data-pagination-detail-h-align="left"
+                data-show-footer="true"
+                data-footer-style="footerStyle"
+                data-buttons-class="oe_button oe_form_button myButton"
+                data-show-pagination-switch="true"
+                data-page-size="10"
+                data-search-on-enter-key="true"
+                data-undefined-text=" ">
+            <thead style="background:none;">
+              <tr>
+                <!-- <th data-field="date_planned" data-sortable="true" data-align="left">Fecha</th> -->
+                <th data-field="number" data-sortable="true" data-align="left">Animal Nro</th>
+                <th data-field="arrival_date" data-align="left">Fecha de llegada</th>
+                <th data-field="origin" data-sortable="true" data-align="left">Origen</th>
+                <th data-field="sex" data-sortable="true" data-align="left">Sexo</th>
+                <th data-field="birthdate" data-sortable="true" data-align="center">Fec.Nac.</th>
+                <th data-field="weight" data-sortable="true" data-align="center">Peso Actual</th>
+                <!-- <th data-field="location" data-sortable="true" data-align="left">Ubicación</th> -->
+              </tr>
+            </thead>
+          </table>
+        </div>
+      </div>
+      <script>
+
+      <!--
+          QUANTITY
+      -->
+      <!-- function QuantityFooter(rowsTable) {
+          var total =  _.reduce(_.map(rowsTable,function(item){
+              return item.quantity_no_format;
+          }), function(memo, num){
+              return memo + num;
+          },0);
+          return accounting.formatNumber(total,2,'.',',');
+      } -->
+
+
+      <!--
+          TAX
+      -->
+      <!-- function TotalFooter(rowsTable) {
+          var decimal_places = 0;
+          var thousands_separator = '.';
+          var decimal_separator = ',';
+          if(rowsTable.length > 0){
+              decimal_places = rowsTable[0].decimal_places;
+              thousands_separator = rowsTable[0].thousands_separator;
+              decimal_separator = rowsTable[0].decimal_separator;
+          }
+          var total =  _.reduce(_.map(rowsTable,function(item){
+              return item.total_no_format;
+          }), function(memo, num){
+              return memo + num;
+          },0);
+          return accounting.formatNumber(total,decimal_places,thousands_separator,decimal_separator);
+      } -->
+
+      <!--
+          FOOTER STYLE
+      -->
+      function footerStyle(row, index) {
+          return {
+              css: {
+                "font-weight": "bold"
+              }
+          };
+      };
+  </script>
+    </div>
+  </t>
+</template>

+ 180 - 0
static/src/reports/report_mrp_bom_analysis.xml

@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<template xml:space="preserve">
+    <t t-name="ReportMrpAnalysis">
+        <div class="report_view">
+            <div class="reporting_page_header">
+                <h1 class="report_title"> Análisis de Producción</h1>
+            </div>
+            <div class="container search-form" style="border-bottom:1px solid #eee; width:95%;">
+                <div class="row">
+                    <div class="col-lg-3 company filter-style">
+                        <label>Empresa</label>
+                        <select id="current-company" class="form-control form-control-sm"></select>
+                    </div>
+                    <!-- <div class="col-lg-3 store filter-style">
+                        <label>Sucursal</label>
+                        <select id="current-store" class="form-control form-control-sm">
+                        </select>
+                    </div> -->
+
+                    <div class="col-lg-3 state filter-style">
+                      <label>Estado</label>
+                      <select id="current-state" class="form-control form-control-sm">
+                        <option value="9999999">Todos los estados</option>
+                        <option value="confirmed">Confirmado</option>
+                        <option value="planned">Planeado</option>
+                        <option value="progress">En progreso</option>
+                        <option value="done">Realizado</option>
+                        <option value="cancel">Cancelado</option>
+                      </select>
+                    </div>
+
+                    <div class="col-lg-3 filter-style">
+                        <label>Fechas</label>
+                        <select id="current-date" class="form-control form-control-sm">
+                            <option value="9999999">Sin fechas</option>
+                            <option value="today">Hoy</option>
+                            <option value="yesterday">Ayer</option>
+                            <option value="currentMonth">Mes Actual</option>
+                            <option value="lastMonth">Mes Pasado</option>
+                            <option value="range">Busqueda Avanzada</option>
+                        </select>
+                    </div>
+                </div>
+                <div class="row" >
+                    <div class="datepicker" style="display:none;">
+                        <div class="col-lg-3 filter-style col-md-offset-3">
+                            <div class="input-group">
+                                <span class="input-group-addon" id="basic-addon1">Desde</span>
+                                <input type="text" id="from" class="form-control" aria-describedby="basic-addon1"/>
+                            </div>
+                        </div>
+                        <div class="col-lg-3 filter-style">
+                            <div class="input-group">
+                                <span class="input-group-addon" id="basic-addon1">Hasta</span>
+                                <input type="text" id="to" class="form-control" aria-describedby="basic-addon1"/>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+                <div class="row">
+                    <div class="text-center" style="padding-top:20px;">
+                        <button id="generate" class="myButton" aria-label="Left Align" style="color:#fff;display:none;">
+                            Generar
+                        </button>
+                    </div>
+                    <br/>
+                </div>
+            </div>
+
+            <div class="report-form" style="display:none;">
+                <div id="toolbar">
+                    <button class="myButton print-report" value="pdf">Imprimir Informe</button>
+                </div>
+                <div class="container" style="width:95%;">
+                    <table id="table"
+                        data-pagination="true"
+                        data-toggle="table"
+                        data-toolbar="#toolbar"
+                        data-show-columns="true"
+                        data-classes="table table-condensed"
+                        data-search="true"
+                        data-show-export="true"
+                        data-show-toggle="true"
+                        data-pagination-detail-h-align="left"
+                        data-show-footer="true"
+                        data-pagination-v-align="top"
+                        data-footer-style="footerStyle"
+                        data-buttons-class="oe_button myButton"
+                        data-show-pagination-switch="true"
+                        data-page-size="10"
+                        data-search-on-enter-key="true"
+                        data-undefined-text=" "
+                        >
+                        <thead style="background:none;">
+                            <tr>
+                                <th data-field="name"
+                                    data-align="center"
+                                    data-footer-formatter="Totales"
+                                    >Referencia</th>
+                                <th data-field="date_planned"
+                                    data-align="center"
+                                    >Fecha</th>
+                                <th data-field="product_name"
+                                    data-align="left"
+                                    data-width="200px"
+                                    >Producto</th>
+                                <th data-field="price_unit"
+                                    data-align="right"
+                                    data-width="150"
+                                    >Precio Unitario</th>
+                                <th data-field="product_qty"
+                                    data-align="right"
+                                    data-footer-formatter="QuantityFooter"
+                                    data-width="100px"
+                                    >Cantidad</th>
+                                <th data-field="price_tot"
+                                    data-align="right"
+                                    data-footer-formatter="TotalFooter"
+                                    data-width="150"
+                                    >Sub Total</th>
+                                <th data-field="state"
+                                    data-align="left"
+                                    data-width="150"
+                                    >Estado</th>
+                            </tr>
+                        </thead>
+                    </table>
+                </div>
+            </div>
+
+
+            <script> -->
+
+                <!--
+                    QUANTITY
+                -->
+                function QuantityFooter(rowsTable) {
+                    var total =  _.reduce(_.map(rowsTable,function(item){
+                        return item.quantity_tot;
+                    }), function(memo, num){
+                        return memo + num;
+                    },0);
+                    return accounting.formatNumber(total,2,'.',',');
+                }
+
+
+
+                <!--
+                    TOTAL
+                -->
+                function TotalFooter(rowsTable) {
+                    var decimal_places = 0;
+                    var thousands_separator = '.';
+                    var decimal_separator = ',';
+                    if(rowsTable.length > 0){
+                        decimal_places = rowsTable[0].decimal_places;
+                        thousands_separator = rowsTable[0].thousands_separator;
+                        decimal_separator = rowsTable[0].decimal_separator;
+                    }
+                    var total =  _.reduce(_.map(rowsTable,function(item){
+                        return item.price_tot_tot;
+                    }), function(memo, num){
+                        return memo + num;
+                    },0);
+                    return accounting.formatNumber(total,decimal_places,thousands_separator,decimal_separator);
+                }
+                <!--
+                    FOOTER STYLE
+                -->
+                function footerStyle(row, index) {
+                    return {
+                        css: {
+                          "font-weight": "bold"
+                        }
+                    };
+                };
+            </script>
+        </div>
+    </t>
+</template>

+ 5 - 0
static/src/xml/eiru_reporting.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<template xml:space="preserve">
+
+</template>

+ 5 - 0
static/src/xml/eiru_reporting_base.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<template xml:space="preserve">
+    
+</template>

+ 19 - 0
templates.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+  <data>
+    <template id="eiru_reports_farm_assets" inherit_id="eiru_assets.assets">
+      <xpath expr="." position="inside">
+        <link rel="stylesheet" href="/eiru_reports_farm/static/src/css/custom.css"/>
+
+        <!-- configuration < main > -->
+        <script type="text/javascript" src="/eiru_reports_farm/static/src/js/main.js"/>
+        <script type="text/javascript" src="/eiru_reports_farm/static/src/js/reporting_base.js"/>
+
+        <!-- Listado de animales -->
+
+        <script type="text/javascript" src="/eiru_reports_farm/static/src/js/reports/report_farm_animal.js"/>
+
+      </xpath>
+    </template>
+  </data>
+</openerp>

+ 13 - 0
views/actions.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+	<data>
+
+		<record id="farm_farm_action" model="ir.actions.client">
+			<field name="name">Listado de animales</field>
+			<field name="tag">eiru_reports_farm.farm_farm_action</field>
+		</record>
+
+
+
+	</data>
+</openerp>

+ 13 - 0
views/menus.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+  <data>
+    <!-- main menu -->
+    <menuitem id="farm_parent_menu" name="Informes" parent="farm.menu_farm" sequence="300"/>
+
+    <!-- sub menu -->
+
+    <menuitem id="farm_animal_history_menu" parent="farm_parent_menu" name="Listado de animales" action="farm_farm_action" sequence="3"/>
+
+
+  </data>
+</openerp>