changeset ff9c68696959 in modules/stock_package_shipping_dpd:default
details:
https://hg.tryton.org/modules/stock_package_shipping_dpd?cmd=changeset&node=ff9c68696959
description:
Do not truncate phone number
If the number is too long, we must not fill it.
issue11237
diffstat:
stock.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diffs (14 lines):
diff -r d53e184f945a -r ff9c68696959 stock.py
--- a/stock.py Sat Feb 26 11:18:15 2022 +0100
+++ b/stock.py Sat Feb 26 11:19:43 2022 +0100
@@ -223,8 +223,8 @@
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