fix: data pulling based on quotation_to and party_name
This commit is contained in:
@@ -103,7 +103,7 @@ erpnext.utils.get_address_display = function(frm, address_field, display_field,
|
|||||||
erpnext.utils.set_taxes = function(frm, address_field, display_field, is_your_company_address) {
|
erpnext.utils.set_taxes = function(frm, address_field, display_field, is_your_company_address) {
|
||||||
if(frappe.meta.get_docfield(frm.doc.doctype, "taxes") && !is_your_company_address) {
|
if(frappe.meta.get_docfield(frm.doc.doctype, "taxes") && !is_your_company_address) {
|
||||||
if(!erpnext.utils.validate_mandatory(frm, "Lead/Customer/Supplier",
|
if(!erpnext.utils.validate_mandatory(frm, "Lead/Customer/Supplier",
|
||||||
frm.doc.customer || frm.doc.supplier || frm.doc.lead, address_field)) {
|
frm.doc.customer || frm.doc.supplier || frm.doc.lead || frm.doc.party_name , address_field)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,6 +125,9 @@ erpnext.utils.set_taxes = function(frm, address_field, display_field, is_your_co
|
|||||||
} else if (frm.doc.supplier) {
|
} else if (frm.doc.supplier) {
|
||||||
party_type = 'Supplier';
|
party_type = 'Supplier';
|
||||||
party = frm.doc.supplier;
|
party = frm.doc.supplier;
|
||||||
|
} else if (frm.doc.quotation_to){
|
||||||
|
party_type = frm.doc.quotation_to;
|
||||||
|
party = frm.doc.party_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
frappe.call({
|
frappe.call({
|
||||||
|
|||||||
@@ -127,14 +127,24 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({
|
|||||||
|
|
||||||
// to overwrite the customer_filter trigger from queries.js
|
// to overwrite the customer_filter trigger from queries.js
|
||||||
this.frm.toggle_reqd("party_name", this.frm.doc.quotation_to);
|
this.frm.toggle_reqd("party_name", this.frm.doc.quotation_to);
|
||||||
this.frm.set_query('customer_address', erpnext.queries.address_query);
|
this.frm.set_query('customer_address', this.address_query);
|
||||||
this.frm.set_query('shipping_address_name', erpnext.queries.address_query);
|
this.frm.set_query('shipping_address_name', this.address_query);
|
||||||
},
|
},
|
||||||
|
|
||||||
tc_name: function() {
|
tc_name: function() {
|
||||||
this.get_terms();
|
this.get_terms();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
address_query: function(doc) {
|
||||||
|
return {
|
||||||
|
query: 'frappe.contacts.doctype.address.address.address_query',
|
||||||
|
filters: {
|
||||||
|
link_doctype: frappe.dynamic_link.doctype,
|
||||||
|
link_name: doc.party_name
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
validate_company_and_party: function(party_field) {
|
validate_company_and_party: function(party_field) {
|
||||||
if(!this.frm.doc.quotation_to) {
|
if(!this.frm.doc.quotation_to) {
|
||||||
frappe.msgprint(__("Please select a value for {0} quotation_to {1}", [this.frm.doc.doctype, this.frm.doc.name]));
|
frappe.msgprint(__("Please select a value for {0} quotation_to {1}", [this.frm.doc.doctype, this.frm.doc.name]));
|
||||||
|
|||||||
@@ -441,7 +441,7 @@
|
|||||||
"collapsible": 1,
|
"collapsible": 1,
|
||||||
"collapsible_depends_on": "",
|
"collapsible_depends_on": "",
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "eval:(doc.customer || doc.lead)",
|
"depends_on": "eval:doc.party_name",
|
||||||
"fetch_if_empty": 0,
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "contact_section",
|
"fieldname": "contact_section",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
@@ -542,7 +542,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "eval:doc.customer",
|
"depends_on": "eval:doc.quotaion_to=='Customer' && doc.party_name",
|
||||||
"fetch_if_empty": 0,
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "contact_person",
|
"fieldname": "contact_person",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
@@ -3224,7 +3224,7 @@
|
|||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 1,
|
"max_attachments": 1,
|
||||||
"menu_index": 0,
|
"menu_index": 0,
|
||||||
"modified": "2019-04-25 15:26:21.983298",
|
"modified": "2019-05-02 14:10:43.355616",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Selling",
|
"module": "Selling",
|
||||||
"name": "Quotation",
|
"name": "Quotation",
|
||||||
|
|||||||
Reference in New Issue
Block a user