Browse Source

[FIX] Corrección en la sintaxis cambiar ( = por in)

Adrielso 7 years ago
parent
commit
fe72ade22f

+ 0 - 40
static/src/js/widgets/customer_counter.js

@@ -1,40 +0,0 @@
-function customer_counter (widget) {
-    "use strict";
-
-    widget.CustomerCounterWidget = widget.Base.extend({
-        template: 'CustomerCounterTmpl',
-        events: {
-            'click a': 'showCustomers'
-        },
-        customers: [],
-        fields: ['name'],
-        domain: [['customer', '=', true], ['active', '=', true]],
-        init: function (parent) {
-            this._super(parent, { width: 3, height: 2 });
-        },
-        start: function () {
-            var self = this;
-            this.getCustomers().then(function (customers) {
-                self.customers = customers;
-                self.renderWidget();
-            });
-        },
-        getCustomers: function () {
-            var Customer = new instance.web.Model('res.partner');
-            return Customer.query(this.fields).filter(this.domain).order_by(['id']).all();
-        },
-        renderWidget: function () {
-            console.log(this.customers);
-        },
-        showCustomers: function (e) {
-            this.do_action({
-                type: 'ir.actions.act_window',
-                res_model: "res.partner",
-                views: [[false, 'list']],
-                target: 'new',
-                domain: [['customer', '=', true]],
-                context: {},
-            });
-        }
-    });
-}

+ 2 - 2
static/src/js/widgets/expired_account_counters.js

@@ -68,7 +68,7 @@ function expired_account_counters (widget) {
                 return map.unreconciled_aml_ids
             }));
             var field =['id', 'partner_id', 'amount_residual', 'credit', 'debit', 'date_maturity'];
-            var domain=[['credit', '<=', 0],['id', '=', move_id],['date_maturity', '<', hoy]];
+            var domain=[['credit', '<=', 0],['id', 'in', move_id],['date_maturity', '<', hoy]];
             var moveLine = new model.web.Model('account.move.line');
 
             moveLine.query(field).filter(domain).all().then(function(results){
@@ -122,7 +122,7 @@ function expired_account_counters (widget) {
                 res_model: "res.partner",
                 views: [[false, 'list']],
                 target: 'new',
-                domain: [['unreconciled_aml_ids', '=', move_id]],
+                domain: [['unreconciled_aml_ids', 'in', move_id]],
                 context: {},
             }));
         }

+ 2 - 2
static/src/js/widgets/expired_account_counters_now.js

@@ -69,7 +69,7 @@ function expired_account_counters_now (widget) {
                 return map.unreconciled_aml_ids
             }));
             var field = ['id', 'partner_id', 'amount_residual', 'credit', 'debit', 'date_maturity'];
-            var domain = [['credit', '<=', 0], ['id', '=', move_id], ['date_maturity', '=', hoy]];
+            var domain = [['credit', '<=', 0], ['id', 'in', move_id], ['date_maturity', '=', hoy]];
             var moveLine = new model.web.Model('account.move.line');
 
             moveLine.query(field).filter(domain).all().then(function (results) {
@@ -123,7 +123,7 @@ function expired_account_counters_now (widget) {
                 res_model: "res.partner",
                 views: [[false, 'list']],
                 target: 'new',
-                domain: [['unreconciled_aml_ids', '=', move_id]],
+                domain: [['unreconciled_aml_ids', 'in', move_id]],
                 context: {},
             });
         }

+ 2 - 2
static/src/js/widgets/invoice_today_counters.js

@@ -40,7 +40,7 @@ function invoice_today_counters (widget) {
             var defer = $.Deferred();
             var hoy =moment().format('YYYY-MM-DD');
             var fields = ['id', 'residual'];
-            var domain = [['type', '=', 'out_invoice'], ['state', '=', ['open','paid']], ['date_invoice', '=', hoy]];
+            var domain = [['type', '=', 'out_invoice'], ['state', 'in', ['open','paid']], ['date_invoice', '=', hoy]];
             var accountInvoice = new model.web.Model('account.invoice');
 
             accountInvoice.query(fields).filter(domain).all().then(function (results){
@@ -73,7 +73,7 @@ function invoice_today_counters (widget) {
                 res_model: "account.invoice",
                 views: [[false, 'list']],
                 target: 'new',
-                domain: [['type', '=', 'out_invoice'], ['state', '=', ['open','paid']], ['date_invoice', '=', hoy]],
+                domain: [['type', '=', 'out_invoice'], ['state', 'in', ['open','paid']], ['date_invoice', '=', hoy]],
                 context: {},
             });
         }

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

@@ -71,8 +71,8 @@ function monthly_expenses(widget) {
             var self = this;
             var defer = $.Deferred();
             var number = _.map(voucher,function(map){return map.reference});
-            var fields = ['id','number','date','origin'];
-            var domain = [['type', '=', 'in_invoice'],['origin', '=', false ],['number', '=', number]];
+            var fields = ['id','number','date_invoice','origin'];
+            var domain = [['type', '=', 'in_invoice'],['origin', '=', false ],['number', 'in', number]];
             var accountInvoice= new model.web.Model('account.invoice');
             accountInvoice.query(fields).filter(domain).all().then(function(results){
                 defer.resolve(results);
@@ -84,7 +84,7 @@ function monthly_expenses(widget) {
             var defer = $.Deferred();
             var currency_Rate = new model.web.Model('res.currency.rate');
             var fields = ['id', 'name', 'currency_id', 'rate', 'create_date'];
-            var domain = [['currency_id', '=', [166 , 20, 7, 3]]];
+            var domain = [['currency_id', 'in', [166 , 20, 7, 3]]];
             currency_Rate.query(fields).filter(domain).all().then(function (results) {
                 defer.resolve(results);
             });
@@ -166,7 +166,7 @@ function monthly_expenses(widget) {
                 res_model: "account.voucher",
                 views: [[false, 'list']],
                 target: 'new',
-                domain: [['type', '=', 'payment'],['state', '=', 'posted'],['date', '>=',desde],['date','<',hasta],['reference','=',number]],
+                domain: [['type', '=', 'payment'],['state', '=', 'posted'],['date', '>=',desde],['date','<',hasta],['reference','in',number]],
                 context: {},
             });
         }

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

@@ -69,8 +69,8 @@ function monthly_purchases(widget) {
             var self = this;
             var defer = $.Deferred();
             var number = _.map(voucher,function(map){return map.reference});
-            var fields = ['id','number','date','origin'];
-            var domain = [['type', '=', 'in_invoice'],['origin', '!=', false ],['number', '=', number]];
+            var fields = ['id','number','date_invoice','origin'];
+            var domain = [['type', '=', 'in_invoice'],['origin', '!=', false ],['number', 'in', number]];
             var accountInvoice= new model.web.Model('account.invoice');
             accountInvoice.query(fields).filter(domain).all().then(function(results){
                 defer.resolve(results);
@@ -81,7 +81,7 @@ function monthly_purchases(widget) {
             var defer = $.Deferred();
             var currency_Rate = new model.web.Model('res.currency.rate');
             var fields = ['id', 'name', 'currency_id', 'rate', 'create_date'];
-            var domain = [['currency_id', '=', [166 , 20, 7, 3]]];
+            var domain = [['currency_id', 'in', [166 , 20, 7, 3]]];
             currency_Rate.query(fields).filter(domain).all().then(function (results) {
                 defer.resolve(results);
             });
@@ -166,7 +166,7 @@ function monthly_purchases(widget) {
                 res_model: "account.voucher",
                 views: [[false, 'list']],
                 target: 'new',
-                domain: [['type', '=', 'payment'],['state', '=', 'posted'],['date', '>=',desde],['date','<',hasta],['reference','=',number]],
+                domain: [['type', '=', 'payment'],['state', '=', 'posted'],['date', '>=',desde],['date','<',hasta],['reference','in',number]],
                 context: {},
             });
         }

+ 1 - 1
static/src/js/widgets/payments_today_counters.js

@@ -77,7 +77,7 @@ function payments_today_counters (widget) {
             var defer = $.Deferred();
             var currency_Rate = new model.web.Model('res.currency.rate');
             var fields = ['id', 'name', 'currency_id', 'rate', 'create_date'];
-            var domain = [['currency_id', '=', [166 , 20, 7, 3]]];
+            var domain = [['currency_id', 'in', [166 , 20, 7, 3]]];
 
             currency_Rate.query(fields).filter(domain).all().then(function (results) {
                 defer.resolve(results);

+ 3 - 3
static/src/js/widgets/ranking_sales_partner.js

@@ -48,7 +48,7 @@ function ranking_sales_partner (widget) {
             var hasta =moment().add(1,'months').format('YYYY-MM-01');
             var defer = $.Deferred();
             var fields = ['id', 'invoice_line', 'date_invoice','partner_id'];
-            var domain = [['type', '=', 'out_invoice'], ['date_invoice', '>=', desde], ['date_invoice', '<', hasta], ['state', '=', ['open','paid']]];
+            var domain = [['type', '=', 'out_invoice'], ['date_invoice', '>=', desde], ['date_invoice', '<', hasta], ['state', 'in', ['open','paid']]];
             var invoice = new model.web.Model('account.invoice');
             invoice.query(fields).filter(domain).all().then(function (results) {
                 defer.resolve(results);
@@ -63,7 +63,7 @@ function ranking_sales_partner (widget) {
                 return map.partner_id[0];
             });
             var fields =['id', 'name'];
-            var domain =[['id', '=', partner_id],['active', '=', true],['customer','=',true]];
+            var domain =[['id', 'in', partner_id],['active', '=', true],['customer','=',true]];
             var resPartner = new model.web.Model('res.partner');
             resPartner.query(fields).filter(domain).all().then(function(results){
                 defer.resolve(results);
@@ -167,7 +167,7 @@ function ranking_sales_partner (widget) {
                 res_model: "res.partner",
                 views: [[false, 'list']],
                 target: 'new',
-                domain: [['id', '=', partner_id]],
+                domain: [['id', 'in', partner_id]],
                 context: {},
             });
         }

+ 4 - 4
static/src/js/widgets/ranking_sales_product.js

@@ -53,7 +53,7 @@ function ranking_sales_product (widget) {
             var hasta =moment().add(1,'months').format('YYYY-MM-01');
             var defer = $.Deferred();
             var fields = ['id', 'invoice_line', 'date_invoice'];
-            var domain = [['type', '=', 'out_invoice'], ['date_invoice', '>=', desde], ['date_invoice', '<', hasta], ['state', '=', ['open','paid']]];
+            var domain = [['type', '=', 'out_invoice'], ['date_invoice', '>=', desde], ['date_invoice', '<', hasta], ['state', 'in', ['open','paid']]];
             var invoice = new model.web.Model('account.invoice');
             invoice.query(fields).filter(domain).all().then(function (results) {
                 defer.resolve(results);
@@ -69,7 +69,7 @@ function ranking_sales_product (widget) {
                 return item.invoice_line
             }));
             var fields =['id', 'product_id', 'quantity'];
-            var domain = [['id','=', invoice_line]];
+            var domain = [['id','in', invoice_line]];
             var invoiceLine = new model.web.Model('account.invoice.line');
             invoiceLine.query(fields).filter(domain).all().then(function (results) {
                 defer.resolve(results);
@@ -84,7 +84,7 @@ function ranking_sales_product (widget) {
                 return item.product_id[0]
             }));
             var fields = ['id', 'name_template', 'type'];
-            var domain =[['id', '=', product_id]];
+            var domain =[['id', 'in', product_id]];
             var product= new model.web.Model('product.product');
 
             product.query(fields).filter(domain).all().then(function (results) {
@@ -199,7 +199,7 @@ function ranking_sales_product (widget) {
                 res_model: "product.product",
                 views: [[false, 'list']],
                 target: 'new',
-                domain: [['id', '=', product_id],['type','=', 'product']],
+                domain: [['id', 'in', product_id],['type','=', 'product']],
                 context: {},
             });
         }

+ 0 - 50
static/src/js/widgets/sales_in_the_week.js

@@ -1,50 +0,0 @@
-function sales_in_the_week (widget) {
-    "use strict";
-
-    widget.SalesInTheWeekWidget = widget.Base.extend({
-        template: 'SalesInTheWeekTmpl',
-        data: [],
-        init: function (parent) {
-            this._super(parent, {
-                width: 6,
-                height: 4
-            });
-        },
-        start: function () {
-            var chart = new Chart(this.$el.find('#sales-in-the-week'), {
-                type: 'line',
-                data: {
-                    labels: ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"],
-                    datasets: [
-                        {
-                            fill: false,
-                            lineTension: 0,
-                            backgroundColor: "#7c7bad",
-                            pointBorderColor: "#7c7bad",
-                            pointHoverRadius: 5,
-                            pointHoverBackgroundColor: "#7c7bad",
-                            pointHoverBorderColor: "rgba(220,220,220,1)",
-                            pointHoverBorderWidth: 2,
-                            pointRadius: 1,
-                            pointHitRadius: 10,
-                            data: [65, 59, 80, 81, 56, 55, 40],
-                        }
-                    ]
-                },
-                options: {
-                    maintainAspectRatio: false,
-                    layout: {
-                        padding: 20
-                    },
-                    legend: {
-                        display: false
-                    }
-                }
-            });
-        },
-        getSales: function () {
-            var Sale = new instance.web.Model('sale.order');
-            return Sale.query(['name']).order_by(['id']).all();
-        }
-    });
-}

+ 0 - 63
static/src/js/widgets/sales_in_warehouse_by_brand.js

@@ -1,63 +0,0 @@
-function sales_in_warehouse_by_brand (widget) {
-    "use strict";
-
-    widget.SalesInWarehouseByBrandWidget = widget.Base.extend({
-        template: 'SalesInWarehouseByBrandTmpl',
-        data: [],
-        init: function (parent) {
-            this._super(parent, {
-                width: 6,
-                height: 6
-            });
-        },
-        start: function () {
-            var chart = new Chart(this.$el.find('#sales-in-warehouse-by-brand'), {
-                type: 'radar',
-                data: {
-                    labels: ["Marca 1", "Marca 2", "Marca 3", "Marca 4", "Marca 5", "Marca 6", "Marca 7"],
-                    datasets: [
-                        {
-                            label: "Almacén 1",
-                            backgroundColor: "rgba(179,181,198,0.2)",
-                            borderColor: "rgba(179,181,198,1)",
-                            pointBackgroundColor: "rgba(179,181,198,1)",
-                            pointBorderColor: "#fff",
-                            pointHoverBackgroundColor: "#fff",
-                            pointHoverBorderColor: "rgba(179,181,198,1)",
-                            data: [65, 59, 90, 81, 56, 55, 40]
-                        },
-                        {
-                            label: "Almacén 2",
-                            backgroundColor: "rgba(255,99,132,0.2)",
-                            borderColor: "rgba(255,99,132,1)",
-                            pointBackgroundColor: "rgba(255,99,132,1)",
-                            pointBorderColor: "#fff",
-                            pointHoverBackgroundColor: "#fff",
-                            pointHoverBorderColor: "rgba(255,99,132,1)",
-                            data: [28, 48, 40, 19, 96, 27, 100]
-                        },
-                        {
-                            label: "Almacén 3",
-                            backgroundColor: "rgba(120,99,132,0.2)",
-                            borderColor: "rgba(120,99,132,1)",
-                            pointBackgroundColor: "rgba(120,99,132,1)",
-                            pointBorderColor: "#fff",
-                            pointHoverBackgroundColor: "#fff",
-                            pointHoverBorderColor: "rgba(120,99,132,1)",
-                            data: [30, 22, 85, 36, 44, 5, 63]
-                        }
-                    ]
-                },
-                options: {
-                    maintainAspectRatio: false,
-                    layout: {
-                        padding: 20
-                    },
-                    legend: {
-                        display: true
-                    }
-                }
-            });
-        }
-    });
-}

+ 0 - 37
static/src/js/widgets/top_sales_product.js

@@ -1,37 +0,0 @@
-function top_sales_product (widget) {
-    "use strict";
-
-    widget.TopSalesProductWidget = widget.Base.extend({
-        template: 'TopSalesProductTmpl',
-        data: [],
-        init: function (parent) {
-            this._super(parent, {
-                width: 4,
-                height: 6
-            });
-        },
-        start: function () {
-            var chart = new Chart(this.$el.find('#top-sales-product'), {
-                type: 'horizontalBar',
-                data: {
-                    labels: ["Product 1", "Product 2", "Product 3", "Product 4", "Product 5", "Product 6", "Product 7", "Product 8", "Product 9", "Product 10"],
-                    datasets: [
-                        {
-                            backgroundColor: ['#7c7bad', '#7c7bad', '#7c7bad', '#7c7bad', '#7c7bad', '#7c7bad', '#7c7bad', '#7c7bad', '#7c7bad', '#7c7bad'],
-                            data: [200, 175, 150, 132, 88, 54, 42, 22, 10, 5]
-                        }
-                    ]
-                },
-                options: {
-                    maintainAspectRatio: false,
-                    layout: {
-                        padding: 20
-                    },
-                    legend: {
-                        display: false
-                    }
-                }
-            });
-        }
-    });
-}

+ 1 - 1
static/src/js/widgets/voucher_today_counters.js

@@ -77,7 +77,7 @@ function voucher_today_counters (widget) {
             var defer = $.Deferred();
             var currency_Rate = new model.web.Model('res.currency.rate');
             var fields = ['id', 'name', 'currency_id', 'rate', 'create_date'];
-            var domain = [['currency_id', '=', [166 , 20, 7, 3]]];
+            var domain = [['currency_id', 'in', [166 , 20, 7, 3]]];
 
             currency_Rate.query(fields).filter(domain).all().then(function (results) {
                 defer.resolve(results);

+ 0 - 20
static/src/xml/widgets/customers_counter.xml

@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<template xml:space="preserve">
-    <t t-name="CustomerCounterTmpl">
-        <div>
-            <div class="grid-stack-item-content dashboard">
-                <h2 class="widget-title">
-                    <span class="glyphicon glyphicon-user" aria-hidden="true"></span>
-                    Clientes
-                </h2>
-                <div class="widget-content">
-                    <a href="#">3.000</a>
-                </div>
-                <div class="widget-footer">
-                    <a href="#">+1%</a> desde la última semana
-                </div>
-            </div>
-        </div>
-    </t>
-</template>

+ 0 - 15
static/src/xml/widgets/sales_in_the_week.xml

@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<template xml:space="preserve">
-    <t t-name="SalesInTheWeekTmpl">
-        <t t-call="WidgetBaseTmpl">
-            <h2 class="widget-title">
-                <i class="fa fa-line-chart"></i>
-                Ventas en la semana
-            </h2>
-            <div class="widget-content">
-                <canvas id="sales-in-the-week"></canvas>
-            </div>
-        </t>
-    </t>
-</template>

+ 0 - 15
static/src/xml/widgets/sales_in_warehouse_by_brand.xml

@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<template xml:space="preserve">
-    <t t-name="SalesInWarehouseByBrandTmpl">
-        <t t-call="WidgetBaseTmpl">
-            <h2 class="widget-title">
-                <i class="fa fa-tachometer"></i>
-                Ventas en los almacenes por marca
-            </h2>
-            <div class="widget-content">
-                <canvas id="sales-in-warehouse-by-brand"></canvas>
-            </div>
-        </t>
-    </t>
-</template>

+ 0 - 15
static/src/xml/widgets/top_sales_product.xml

@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<template xml:space="preserve">
-    <t t-name="TopSalesProductTmpl">
-        <t t-call="WidgetBaseTmpl">
-            <h2 class="widget-title">
-                <i class="fa fa-bar-chart"></i>
-                Top 10 productos más vendidos
-            </h2>
-            <div class="widget-content">
-                <canvas id="top-sales-product"></canvas>
-            </div>
-        </t>
-    </t>
-</template>