[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) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
This commit is contained in:
Pedram (PEBR)
2023-09-08 08:29:56 +00:00
parent 626483b5e3
commit f2f078e0e7
@@ -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) {