Hello,
I’m trying to make an Ajax call using frappe on the Report View when editing a field to update the child doctype of Item, which is the Item Tax.
Url: …/#List/Item/Report/
As I added a checkbox filed on Item “is_applied_tax”. The checkbox field once checked should update the Item Tax to set the tax. I written the custom javascript for set_control_value() in report_view.js.
I seem to have an issue with making an Ajax call using frappe.call() for the Iفem Tax doctype. It keeps giving me a permission error.
How to solve this ? Any guide would be appreciated.
I was trying to set the value in the callback:
frappe.call({
method: 'frappe.client.get_list',
args: {
'doctype': 'Item Tax',
'filters': [
['parent', "=", docname]
],
'fields': ["*"]
},
callback: function (r) {
console.log(r)
console.log("Updated Value is:", value)
// var item_tax_template_value = "ضريبة 15%";
// //Check if tax is enabled for the item or else set as no tax
// if (value == 0) {
// item_tax_template_value = "لا يوجد ضريبة";
// }
// frappe.db.set_value("Item Tax", r.name, "item_tax_template", item_tax_template_value);
}
});