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