How to add multiple filters in frappe.db.get_list

my code (client script)
list = frappe.db.get_list('Vehicle Transaction', filters={'vehicle': frm.name, 't_type': 'debit'}, fields=['total_amount'])

the error is

TypeError: DatabaseQuery.execute() got an unexpected keyword argument 't_type'

Try this:

const data = await frappe.db.get_list("Vehicle Transaction", {
  filters: { vehicle: frm.doc.name, t_type: "debit" },
  fields: ["total_amount"],
});
1 Like

Thanks. However, the problem is solved by working around it. Instead of filtering out t_type, I added it in fields and filtered it by code afterward.