changeset f8dcec13ebe9 in modules/country:default
details: https://hg.tryton.org/modules/country?cmd=changeset&node=f8dcec13ebe9
description:
        Add remove_forbidden_chars in tools

        issue10684
        review371581002
diffstat:

 scripts/import_countries.py |  7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diffs (17 lines):

diff -r 59d55a97f35a -r f8dcec13ebe9 scripts/import_countries.py
--- a/scripts/import_countries.py       Fri Aug 06 09:46:32 2021 +0200
+++ b/scripts/import_countries.py       Mon Sep 13 23:43:03 2021 +0200
@@ -37,11 +37,8 @@
 
 
 def _remove_forbidden_chars(name):
-    from trytond.model.fields import Char
-    for c in Char.forbidden_chars:
-        if c in name:
-            name.replace(c, ' ')
-    return name.strip()
+    from trytond.tools import remove_forbidden_chars
+    return remove_forbidden_chars(name)
 
 
 def get_countries():

Reply via email to