Address Query filter by address_type

I’m trying to make the follow query that raise and error.
How can I filter the address by type?

return {
    query: "frappe.contacts.doctype.address.address.address_query",
    filters: {link_doctype: "Customer", link_name: cur_frm.doc.cliente, address_type: "Plant"}

OperationalError: (1054, "Unknown column 'Plant' in 'where clause'")

1 Like

I know, quite old topic… but I was looking for the same issue.

This works for me:

frappe.ui.form.on(“Purchase Order”, {
setup: function (frm) {
frm.set_query(“branch_address”, function () {
return {filters: {
address_type: “Subsidiary”