fix: docfield of sales_order is not fetching route options for new doc (#21123)

Using the wrong method to get `so` as docfield.
frappe.meta changes will not effect the `sales_order` in `frm`.
This commit is contained in:
Andy Zhu 2020-03-31 18:13:00 +13:00 committed by GitHub
parent 3fa03df1e3
commit 5c54adec28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,7 +18,7 @@ frappe.ui.form.on("Project", {
};
},
onload: function (frm) {
var so = frappe.meta.get_docfield("Project", "sales_order");
var so = frm.get_docfield("Project", "sales_order");
so.get_route_options_for_new_doc = function (field) {
if (frm.is_new()) return;
return {
@ -135,4 +135,4 @@ function open_form(frm, doctype, child_doctype, parentfield) {
frappe.ui.form.make_quick_entry(doctype, null, null, new_doc);
});
}
}