feat: add Company Contact Person in selling transactions (backport #44362) (#44397)

* feat: add Company Contact Person in selling transactions (#44362)

(cherry picked from commit f6776c7d6b)

* chore: resolve conflicts

---------

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
This commit is contained in:
mergify[bot]
2024-11-27 17:09:09 +01:00
committed by GitHub
parent 627a50e7bc
commit 78ab44ce1a
7 changed files with 62 additions and 10 deletions

View File

@@ -64,6 +64,17 @@ $.extend(erpnext.queries, {
}
},
company_contact_query: function (doc) {
if (!doc.company) {
frappe.throw(__("Please set {0}", [__(frappe.meta.get_label(doc.doctype, "company", doc.name))]));
}
return {
query: "frappe.contacts.doctype.contact.contact.contact_query",
filters: { link_doctype: "Company", link_name: doc.company },
};
},
address_query: function (doc) {
if (frappe.dynamic_link) {
if (!doc[frappe.dynamic_link.fieldname]) {