Commit bbde8038 by Damien Moulard

Merge branch '2175-serch-coop-number' into 'dev_cooperatic'

2175 search coop number

See merge request !30
parents b414b37c 20ded4b7
......@@ -7,6 +7,8 @@
'description': """
Recherche par num. de coop\n
(la recherche inclut le code barre ou non,\n
le réglage se fait avec la clé lacagette_custom_pos.reduce_pos_members_search)\n
Après une recherche, le champ perd le focus\n
Utilisation du pavé numérique du clavier sur le panier\n
Personnalisation de la popup d'erreur "codebarre non reconnu" :\n
......
<?xml version="1.0"?>
<odoo noupdate="0">
<record id="reduce_pos_members_search" model="ir.config_parameter">
<field name="key">lacagette_custom_pos.reduce_pos_members_search</field>
<field name="value">False</field>
</record>
</odoo>
......@@ -2,8 +2,21 @@ odoo.define('lacagette_custom_pos.DB', function(require) {
"use strict";
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({
init: function(parent, options){
this._super(parent,options);
config_parameter.call('get_param', ['lacagette_custom_pos.reduce_pos_members_search'])
.then(function(param){
if (param != undefined) {
reduce_pos_members_search = param;
}
})
},
_partner_search_string: function(partner){
var str = partner.name;
//Diacritric search
......@@ -12,9 +25,13 @@ odoo.define('lacagette_custom_pos.DB', function(require) {
} catch(e) {
console.log(e)
}
if(partner.barcode){
if (reduce_pos_members_search === 'False') {
if(partner.barcode){
str += '|' + partner.barcode;
}
}
}
if(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