Commit 128a6532 by Félicie

parameter used

parent 96f15a4f
...@@ -2,8 +2,22 @@ odoo.define('lacagette_custom_pos.DB', function(require) { ...@@ -2,8 +2,22 @@ odoo.define('lacagette_custom_pos.DB', function(require) {
"use strict"; "use strict";
var PosDB = require('point_of_sale.DB'); var PosDB = require('point_of_sale.DB');
var Model = require('web.DataModel');
var config_parameter = new Model('ir.config_parameter');
var reduce_pos_members_search = null;
PosDB.include({ PosDB.include({
init: function(parent, options){
this._super(parent,options);
config_parameter.call('get_param', ['lacagette_cpo.reduce_pos_members_search'])
.then(function(param){
if (param != undefined) {
reduce_pos_members_search = param;
console.log('init', reduce_pos_members_search);
}
})
},
_partner_search_string: function(partner){ _partner_search_string: function(partner){
var str = partner.name; var str = partner.name;
//Diacritric search //Diacritric search
...@@ -12,9 +26,13 @@ odoo.define('lacagette_custom_pos.DB', function(require) { ...@@ -12,9 +26,13 @@ odoo.define('lacagette_custom_pos.DB', function(require) {
} catch(e) { } catch(e) {
console.log(e) console.log(e)
} }
if(partner.barcode){
if (reduce_pos_members_search === 'True') {
if(partner.barcode){
str += '|' + partner.barcode; str += '|' + partner.barcode;
} }
}
if(partner.barcode_base){ if(partner.barcode_base){
str += '|' + partner.barcode_base; str += '|' + partner.barcode_base;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment