búsqueda en el TPV por referencia, autor, género y editorial.

backup files atacks again...
This commit is contained in:
santiky 2021-08-09 19:43:59 +02:00
parent f6023acc5a
commit 22d71e80dc
Signed by: snt
GPG key ID: A9FD34930EADBE71
7 changed files with 82 additions and 136 deletions

View file

@ -0,0 +1,28 @@
odoo.define('product_library', function (require) {
"use strict";
var db = require("point_of_sale.DB");
db.include({
_product_search_string: function(product){
var str = product.name;
if(product.default_code){
str += '|' + product.default_code;
}
if(product.autor){
str += '|' + product.autor;
}
if(product.genero){
str += '|' + product.genero;
}
if(product.editorial){
str += '|' + product.editorial;
}
str = '' + product.id + ':' + str.replace(':','') + '\n';
return str;
},
});
return db;
});

View file

@ -0,0 +1,28 @@
odoo.define('product_library.product_library', function (require) {
"use strict";
var models = require('point_of_sale.models');
var screens = require('point_of_sale.screens');
var core = require('web.core');
var gui = require('point_of_sale.gui');
var _t = core._t;
/* ********************************************************
Overload models.PosModel
******************************************************** */
var _super_posmodel = models.PosModel.prototype;
models.PosModel = models.PosModel.extend({
initialize: function (session, attributes) {
this.member_categories = [];
var product_model = _.find(this.models, function(model){ return model.model === 'product.product'; });
product_model.fields.push('default_code');
product_model.fields.push('autor');
product_model.fields.push('editorial');
product_model.fields.push('genero');
return _super_posmodel.initialize.apply(this, arguments);
}
});
});