Hello,
I am trying to add Account multiselect filter in trial balance. I added filter in js file.
{
"fieldname":"account",
"label": __("Account"),
"fieldtype": "MultiSelectList",
"options": "Account",
get_data: function(txt) {
return frappe.db.get_link_options('Account', txt, {
company: frappe.query_report.get_filter_value("company")
});
}
}
And added filter code to trial_balance.py file
if filters.account:
lft, rgt = frappe.db.get_value("Account", filters.account, ["lft", "rgt"])
additional_conditions += """ and account in (select name from `tabAccount`
where lft >= %s and rgt <= %s)""" % (
lft,
rgt,
)
gives me an error after selecting account “TypeError: expected string or bytes-like object”
How to solve this error and effect this filter in the report?