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 % |
+----------------+
return (
get_year_start(add_to_date(today, years=-1)),
get_year_ending(add_to_date(today, years=-1)),
)
case "yesterday":
return (add_to_date(today, days=-1),) * 2
case "today":
return (today, today)
case "tomorrow":
return (add_to_date(today, days=1),) * 2
case "this week":
return (get_first_day_of_week(today), get_last_day_of_week(today))
case "this month":
return (get_first_day(today), get_last_day(today))
case "this quarter":
return (get_quarter_start(today), get_quarter_ending(today))
case "this year":
return (get_year_start(today), get_year_ending(today))
case "next week":
return (
The problem would seem to be in client side code somewhere here
// add_fetches
import Awesomplete from "awesomplete";
frappe.ui.form.recent_link_validations = {};
frappe.ui.form.ControlLink = class ControlLink extends frappe.ui.form.ControlData {
static trigger_change_on_input_event = false;
make_input() {
var me = this;
$(`<div class="link-field ui-front" style="position: relative;">
<input type="text" class="input-with-feedback form-control">
<span class="link-btn">
<a class="btn-open no-decoration" title="${__("Open Link")}">
${frappe.utils.icon("arrow-right", "xs")}
</a>
</span>
</div>`).prependTo(this.input_area);
this.$input_area = $(this.input_area);
this.$input = this.$input_area.find("input");
this.$link = this.$input_area.find(".link-btn");
this.$link_open = this.$link.find(".btn-open");
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