Bug in URL for Payment Terms

Hello,

When editing a Payment Term Template and then click a right arrow to edit a Payment Term, a 404 error is shown if the Term has a URL reserved character in its name.

For example, I have set the name of a payment term to be “Advance USD 100%”, so, when I click the right arrow, this is the actual URL:

https://erp.example.com/desk#Form/Payment%20Term/Advance%20USD%20100%

The correct should be:

https://erp.example.com/desk#Form/Payment%20Term/Advance%20USD%20100%25

Regards
Jaime

Hello,

Please tell us what version of ERPNext you are using. And also please include a screenshot so we can try to reproduce the bug.

This is the Payment Terms list:

Then I click on “Anticipado USD 100%” (Advance USD 100%):

Above picture shows the right case, where the percent sign is translated as %25 entity.

Well, now let’s go to payment terms templates list:

Let’s click on “Fuera de Chile (equipos)” to see this screen:

Finally, press the right arrow to edit the payment term “Anticipado USD 100%”:

Error 404 is shown. Please take a look at the URL. The “%” sign is not encoded.

The version is ERPNext: v11.1.19 (master)

Regards
Jaime

Yes that seems to be an encoding issue - I can confirm it can be reproduced in v11 English version the UTF-8 encoding is no longer applied.

frappe@ubuntu1804lts:~/frappe-bench$ env | grep LANG
LANG=en_US.UTF-8

I am not informed what or whether Frappe has reserved keywords, characters or meta-characters in names and so on but I don’t believe ‘%’ or ‘,’ are prohibited?

http://192.168.0.237/desk#Form/Payment%20Term/test%20percent%20%25

MariaDB [1bd3e0294da19198]> select name from `tabPayment Term`;
+----------------+
| name           |
+----------------+
| test percent % |
+----------------+

The problem would seem to be in client side code somewhere here

edit: These for example shed light on the python 2 & 3 encoding case - I admit I have not fully digested mastered and exercised the lesson here