Hi,
I’m getting this error when running below scripts. I have triued to enqueue but with the same error.
JS
frappe.ui.form.on(‘Agent Statement’, {
refresh: function(frm) {
},
match: function(frm) {
frappe.call({
method: “enqueue_match”,
args: {self: frm},
callback(r) {
if(r.message) {
//
}
}
});
}
});
Python
from future import unicode_literals
import frappe
from frappe.model.document import Documentclass AgentStatement(Document):
pass@frappe.whitelist()
def match_invoices(self):
found = 0
total = 0for invoice in self.invoices:
inv = frappe.db.sql(“”“SELECT parent fromtabOnline Payment Request Invoices
where reference_number = %s”“”, invoice.invoice_no, as_dict=1)
total = total + 1if inv: invoice.requested = 1 invoice.request_reference = i.parent found = found + 1
return found
@frappe.whitelist()
def enqueue_match(self):
frappe.enqueue(“atndesk.collections.doctype.agent_statement.agent_statement.match_invoice”)
frappe.msgprint(_(“Queued for updating latest price in all Bill of Materials. It may take a few minutes.”))
Please help.