From f2f078e0e763945e2e743ebe61baeb75f6a32680 Mon Sep 17 00:00:00 2001 From: "Pedram (PEBR)" Date: Thu, 24 Aug 2023 12:24:11 +0000 Subject: [PATCH] [FIX] point_of_sale: set default language for new customers Previously, when creating a new customer from the POS interface, if the default language was not changed in the form, an empty string would be sent to the backend. This resulted in the new customer not having a language set. This commit establishes the default language selection as the user's selected language when creating a new customer within the POS system. opw-3466525 closes odoo/odoo#134613 X-original-commit: 82e4dc110fdd9f3a8b58e473474eb13709ddc7a4 Signed-off-by: Joseph Caburnay (jcb) Signed-off-by: Pedram Bi Ria (pebr) --- .../static/src/app/screens/partner_list/partner_list.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/point_of_sale/static/src/app/screens/partner_list/partner_list.js b/addons/point_of_sale/static/src/app/screens/partner_list/partner_list.js index 30df6d746b4..6475d324953 100644 --- a/addons/point_of_sale/static/src/app/screens/partner_list/partner_list.js +++ b/addons/point_of_sale/static/src/app/screens/partner_list/partner_list.js @@ -5,6 +5,7 @@ import { registry } from "@web/core/registry"; import { debounce } from "@web/core/utils/timing"; import { useService } from "@web/core/utils/hooks"; import { useAsyncLockedMethod } from "@point_of_sale/app/utils/hooks"; +import { session } from "@web/session"; import { PartnerLine } from "@point_of_sale/app/screens/partner_list/partner_line/partner_line"; import { PartnerDetailsEdit } from "@point_of_sale/app/screens/partner_list/partner_editor/partner_editor"; @@ -159,9 +160,9 @@ export class PartnerListScreen extends Component { this.activateEditMode(); } createPartner() { - // initialize the edit screen with default details about country & state + // initialize the edit screen with default details about country, state, and lang const { country_id, state_id } = this.pos.company; - this.state.editModeProps.partner = { country_id, state_id }; + this.state.editModeProps.partner = { country_id, state_id, lang: session.user_context.lang }; this.activateEditMode(); } async saveChanges(processedChanges) {