summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic/basic_controller.js
diff options
context:
space:
mode:
authorGert Pellin <gpe@odoo.com>2019-11-14 12:48:04 +0000
committerfw-bot <otis@odoo.com>2019-11-14 18:11:55 +0000
commitca57ecf44622c4c75c5decd3f215e56591799f35 (patch)
treee61d660ded24fe782ff8ebc9de9d0ba44a5d023e /addons/web/static/src/js/views/basic/basic_controller.js
parent3214dd56f15aa358e116735de90dd488bef4de30 (diff)
[FIX] point_of_sale: fix order naming translations
Before this fix translations of the order names missed a crusial space that is needed to get information out of it in the front-end. * Load Spanish-PE translation. * Change localization preference for a user (either admin or demo) to Spanish. * Login to Odoo POS using the user with spanish localization. * Go to POS, select BAR POS, select a table and place a draft order with at least 1 order line (do not proceed to payment) * Go back to table mgmt view and click again to the previous selected table and the error appears. This issue happens in any translation where pos_reference for a draft order is not separated with white space as it happens in English. I mean in english the pos_reference is something like "Order 00003-001-0002" but in spanish it is "Pedido00003-001-0002" (no whitespace), so https://github.com/odoo/odoo/blob/13.0/addons/pos_restaurant/models/pos_order.py#L143 assumes that there will always be a whitespace which is not true for some odoo translations like spanish one. This fix adds a variable to the translation string making it more clear the space is part of the string. To make sure the code will also work on languages with the words in another order `order['pos_reference'].split(' ')[1]` is replaced by `search(r"\d{5}-\d{3}-\d{4}", order['pos_reference']).group(0)`, we know the uid will always be formatted as nnnnn-nnn-nnnn solves #40036 closes odoo/odoo#40302 X-original-commit: c32126da5ac55a03637d82cf520b8655be8546e6 Signed-off-by: Gert Pellin - GPE <switch87@users.noreply.github.com>
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_controller.js')
0 files changed, 0 insertions, 0 deletions