fix: javascript: execution blocked by undefined route options (#33405)
Some implementations of DocField.get_route_options_for_new_doc() returned no value instead of an empty object in some cases, which caused a JavaScript error.
This commit is contained in:
parent
d054f37602
commit
3c393bfdc5
@ -20,7 +20,7 @@ frappe.ui.form.on("Project", {
|
||||
onload: function (frm) {
|
||||
const so = frm.get_docfield("sales_order");
|
||||
so.get_route_options_for_new_doc = () => {
|
||||
if (frm.is_new()) return;
|
||||
if (frm.is_new()) return {};
|
||||
return {
|
||||
"customer": frm.doc.customer,
|
||||
"project_name": frm.doc.name
|
||||
|
@ -272,7 +272,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
|
||||
|
||||
let quality_inspection_field = this.frm.get_docfield("items", "quality_inspection");
|
||||
quality_inspection_field.get_route_options_for_new_doc = function(row) {
|
||||
if(me.frm.is_new()) return;
|
||||
if(me.frm.is_new()) return {};
|
||||
return {
|
||||
"inspection_type": inspection_type,
|
||||
"reference_type": me.frm.doc.doctype,
|
||||
|
@ -133,7 +133,7 @@ frappe.ui.form.on('Stock Entry', {
|
||||
|
||||
let quality_inspection_field = frm.get_docfield("items", "quality_inspection");
|
||||
quality_inspection_field.get_route_options_for_new_doc = function(row) {
|
||||
if (frm.is_new()) return;
|
||||
if (frm.is_new()) return {};
|
||||
return {
|
||||
"inspection_type": "Incoming",
|
||||
"reference_type": frm.doc.doctype,
|
||||
|
Loading…
x
Reference in New Issue
Block a user