búsqueda en el TPV por referencia, autor, género y editorial.
backup files atacks again...
This commit is contained in:
parent
f6023acc5a
commit
22d71e80dc
7 changed files with 82 additions and 136 deletions
28
product_library/static/src/js/db.js
Normal file
28
product_library/static/src/js/db.js
Normal 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;
|
||||
|
||||
});
|
28
product_library/static/src/js/product_library.js
Normal file
28
product_library/static/src/js/product_library.js
Normal 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);
|
||||
}
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue