diff options
| author | Anh Thao Pham (pta) <pta@odoo.com> | 2021-03-25 08:03:00 +0000 |
|---|---|---|
| committer | Anh Thao Pham (pta) <pta@odoo.com> | 2021-03-25 16:24:18 +0000 |
| commit | 8318ec332ddc3180cf6e3adcad015de31ae2f808 (patch) | |
| tree | d46cee4e12c1029345d5a780b2696aaa33a936d0 /addons/point_of_sale/static/src | |
| parent | 81d42c3e0aa6556f222793ce6885dd3ee98c732b (diff) | |
[FIX] point_of_sale: fix customer search when a field contains line break
- Install contacts & point_of_sale
- Go to Contacts and import a contact from an Excel file with the following data:
/!\ The street field should contain a line break /!\
Name | Phone | Street
-------------------------
Test | 123456 | Multiline
Street
- Open a POS session
- Go to Customer selection page
- Search for "123456"
The imported res.partner will not be found by his phone.
A partner search in POS is working with a regex search on a string containing all partners.
This string is supposed to contain 1 line for each partner and a line is formatted as followed:
id:name|barcode|address|phone|mobile|email|vat
However, in this case, partner's address contains a line break, resulting on a line like this:
id:name|barcode|address (part before line break)
address (part after line break)|phone|mobile|email|vat
This partner is defined in 2 lines and all data from the second line cannot be matched with regex.
opw-2477994
closes odoo/odoo#68360
X-original-commit: 3de16a7a4616c73cfabd64aa010801f687cf14af
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
Diffstat (limited to 'addons/point_of_sale/static/src')
| -rw-r--r-- | addons/point_of_sale/static/src/js/db.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/point_of_sale/static/src/js/db.js b/addons/point_of_sale/static/src/js/db.js index fd868d8535b..ca0afd28a83 100644 --- a/addons/point_of_sale/static/src/js/db.js +++ b/addons/point_of_sale/static/src/js/db.js @@ -236,7 +236,7 @@ var PosDB = core.Class.extend({ if(partner.vat){ str += '|' + partner.vat; } - str = '' + partner.id + ':' + str.replace(':','') + '\n'; + str = '' + partner.id + ':' + str.replace(':', '').replace(/\n/g, ' ') + '\n'; return str; }, add_partners: function(partners){ |
