From 918c46bbf7c7f9c520a64a971237b1457365dfeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 26 Feb 2022 11:19:43 +0100 Subject: [PATCH] Do not truncate phone number If the number is too long, we must not fill it. issue11237 --- stock.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stock.py b/stock.py index 5bf469053a..1ff74551ec 100644 --- a/stock.py +++ b/stock.py @@ -223,8 +223,8 @@ class CreateDPDShipping(Wizard): shipping_party['name2'] = party.full_name[:35] phone = party.contact_mechanism_get({'phone', 'mobile'}) - if phone: - shipping_party['phone'] = phone.value[:30] + if phone and len(phone.value) <= 30: + shipping_party['phone'] = phone.value email = party.contact_mechanism_get('email') if email and len(email.value) <= 50: shipping_party['email'] = email.value