mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 17:04:47 +00:00
* feat: add Company Contact Person in selling transactions (#44362)
(cherry picked from commit f6776c7d6b)
* chore: resolve merge conflicts
---------
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
This commit is contained in:
@@ -56,6 +56,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]) {
|
||||
|
||||
@@ -49,6 +49,7 @@ erpnext.sales_common = {
|
||||
);
|
||||
|
||||
me.frm.set_query("contact_person", erpnext.queries.contact_query);
|
||||
me.frm.set_query("company_contact_person", erpnext.queries.company_contact_query);
|
||||
me.frm.set_query("customer_address", erpnext.queries.address_query);
|
||||
me.frm.set_query("shipping_address_name", erpnext.queries.address_query);
|
||||
me.frm.set_query("dispatch_address_name", erpnext.queries.dispatch_address_query);
|
||||
|
||||
Reference in New Issue
Block a user