Sfoglia il codice sorgente

[ADD] Alerta widget sin datos

adrielso 7 anni fa
parent
commit
678a01099f

+ 4 - 1
static/src/js/widgets/expired_account_counters.js

@@ -187,8 +187,11 @@ function expired_account_counters (widget) {
 
         showCustomers: function (e) {
             var self = this;
-            if (self.moveLine <=0)
+            if (self.moveLine <=0) {
+                model.web.notification.do_warn("Atención","Sin datos");
                 return
+            }
+
 
             var moneda = self.resCurrecy.shift();
             var newmoveLine = self.moveLine;

+ 3 - 1
static/src/js/widgets/expired_account_counters_now.js

@@ -183,8 +183,10 @@ function expired_account_counters_now (widget) {
         },
         showCustomers: function (e) {
             var self = this;
-            if (self.moveLine.length <= 0)
+            if (self.moveLine.length <= 0) {
+                model.web.notification.do_warn("Atención","Sin datos");
                 return
+            }
 
             var moneda = self.resCurrecy.shift();
             var newmoveLine=[];

+ 4 - 0
static/src/js/widgets/invoice_today_counters.js

@@ -84,6 +84,10 @@ function invoice_today_counters (widget) {
         },
         showCustomers: function (e) {
             var self= this;
+            if (self.accountInvoice.length === 0) {
+                model.web.notification.do_warn("Atención","Sin datos");
+                return
+            }
             var hoy =moment().format('YYYY-MM-DD');
 
 

+ 4 - 0
static/src/js/widgets/missing_product.js

@@ -88,6 +88,10 @@ function missing_product (widget) {
         },
         showCustomers: function (e) {
             var self = this;
+            if (self.productProduct.length === 0 ) {
+                model.web.notification.do_warn("Atención","Sin datos");
+                return
+            }
             this.do_action({
                 name:"Listado de productos faltan-tes",
                 type: 'ir.actions.act_window',

+ 4 - 0
static/src/js/widgets/monthly_expenses.js

@@ -168,6 +168,10 @@ function monthly_expenses(widget) {
         // Modal
         showCustomers: function (e) {
             var self = this;
+            if (self.accountVoucher.length === 0) {
+                model.web.notification.do_warn("Atención","Sin datos");
+                return
+            }
             var hoy =moment().format('YYYY-MM-DD');
             var desde =moment().format('YYYY-MM-01');
             var hasta =moment().add(1,'months').format('YYYY-MM-01');

+ 4 - 0
static/src/js/widgets/monthly_purchases.js

@@ -168,6 +168,10 @@ function monthly_purchases(widget) {
         // modal
         showCustomers: function (e) {
             var self = this;
+            if (self.accountVoucher.length === 0) {
+                model.web.notification.do_warn("Atención","Sin datos");
+                return
+            }
             var hoy =moment().format('YYYY-MM-DD');
             var desde =moment().format('YYYY-MM-01');
             var hasta =moment().add(1,'months').format('YYYY-MM-01');

+ 5 - 0
static/src/js/widgets/payments_today_counters.js

@@ -137,6 +137,11 @@ function payments_today_counters (widget) {
         },
         // modal
         showCustomers: function (e) {
+            var self = this;
+            if (self.accountVoucher.length === 0){
+                model.web.notification.do_warn("Atención","Sin datos");
+                return
+            }
             var hoy =moment().format('YYYY-MM-DD');
 
             this.do_action({

+ 4 - 0
static/src/js/widgets/ranking_sales_partner.js

@@ -198,6 +198,10 @@ function ranking_sales_partner (widget) {
         // llamar a la lista
         showCustomers: function (e) {
             var self = this;
+            if (self.ranking.length === 0 ) {
+                model.web.notification.do_warn("Atención","Sin datos");
+                return
+            }
             var hoy =moment().format('YYYY-MM-DD');
             var partner_id= _.map(self.ranking,function(map){
                 return map.id;

+ 5 - 0
static/src/js/widgets/ranking_sales_product.js

@@ -220,7 +220,12 @@ function ranking_sales_product (widget) {
 
         showCustomers: function (e) {
             var self = this;
+            if (self.ranking.length === 0){
+                model.web.notification.do_warn("Atención","Sin datos");
+                return
+            }
             var hoy =moment().format('YYYY-MM-DD');
+
             var product_id= _.map(self.ranking,function(map){
                 return map.id;
             })

+ 8 - 0
static/src/js/widgets/voucher_today_counters.js

@@ -138,6 +138,14 @@ function voucher_today_counters (widget) {
         },
         // modal
         showCustomers: function (e) {
+            var self = this;
+            if (self.accountVoucher.length === 0){
+                model.web.notification.do_warn("Atención","Sin datos");
+                return
+            }
+
+
+
             var hoy =moment().format('YYYY-MM-DD');
 
             this.do_action({