Custom link field throws "nowdate is not defined"

In my “Sales Order Item” DocType I created a custom field.

Type is “Link”
Name is “batch_no” (same as in “Delivery Note Item” because I want it to be forwarded there then)
In the options I put “Batch” to link to the Batch DocType.

So I’m creating a Sales Order and add an Item but when clicking on Batch No there isn’t any completion or linking or anything. In the console the error Uncaught ReferenceError: nowdate is not defined pops up.

I’m using the most recent version of ERPNext 7.0.29.

// EDIT:
In “erpnext/selling/sales_common.js” is the line 'posting_date': me.frm.doc.posting_date || nowdate(),
here nowdate() is not defined. When editing this line to frappe.datetime.nowdate() everything works.
But I don’t want to edit erpnext source code, I have my own app. Is there a way to overwrite this part of the code? Or to import frappe.datetime globally from my app? Or should I make a pull request with my edits?

Thanks for reporting. Best way to fix this is to send a pull-request!

Seems like it already got fixed here.


This topic was automatically closed after 24 hours. New replies are no longer allowed.