Skip to content

Commit

Permalink
fix: Company address filter in quotation
Browse files Browse the repository at this point in the history
(cherry picked from commit 2fc04f6)
  • Loading branch information
deepeshgarg007 authored and mergify[bot] committed Jun 14, 2022
1 parent c5bda9c commit d375939
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions erpnext/selling/doctype/quotation/quotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@ frappe.ui.form.on('Quotation', {

frm.set_df_property('packed_items', 'cannot_add_rows', true);
frm.set_df_property('packed_items', 'cannot_delete_rows', true);

frm.set_query('company_address', function(doc) {
if(!doc.company) {
frappe.throw(__('Please set Company'));
}

return {
query: 'frappe.contacts.doctype.address.address.address_query',
filters: {
link_doctype: 'Company',
link_name: doc.company
}
};
});
},

refresh: function(frm) {
Expand Down

0 comments on commit d375939

Please sign in to comment.