diff --git a/carrier.py b/carrier.py index 445fff6428..b2192ce817 100644 --- a/carrier.py +++ b/carrier.py @@ -1,5 +1,7 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. +import locale + from zeep.exceptions import Fault from trytond.model import ModelSQL, ModelView, MatchMixin, fields @@ -40,6 +42,7 @@ class CredentialDPD(ModelSQL, ModelView, MatchMixin): auth_client = get_client(self.server, LOGIN_SERVICE) lang = (self.company.party.lang.code if self.company.party.lang else 'en') + lang = locale.normalize(lang)[:5] try: result = auth_client.service.getAuth( delisId=self.user_id, password=self.password, diff --git a/stock.py b/stock.py index b7ded5ced4..0913795f18 100644 --- a/stock.py +++ b/stock.py @@ -1,6 +1,7 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. +import locale from io import BytesIO from lxml import etree from zeep.exceptions import Fault @@ -102,6 +103,7 @@ class CreateDPDShipping(Wizard): while count < 2: lang = (credential.company.party.lang.code if credential.company.party.lang else 'en') + lang = locale.normalize(lang)[:5] authentication = { 'delisId': credential.user_id, 'authToken': credential.token,