Merge pull request #23174 from bhavesh95863/patch-9

fix: account & cost center filter by company
This commit is contained in:
rohitwaghchaure 2020-08-28 10:42:51 +05:30 committed by GitHub
commit 70b606d468
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,22 @@
frappe.ui.form.on('Shipping Rule', {
refresh: function(frm) {
frm.set_query("cost_center", function() {
return {
filters: {
company: frm.doc.company
}
}
})
frm.set_query("account", function() {
return {
filters: {
company: frm.doc.company
}
}
})
frm.trigger('toggle_reqd');
},
calculate_based_on: function(frm) {
@ -12,4 +28,4 @@ frappe.ui.form.on('Shipping Rule', {
frm.toggle_reqd("shipping_amount", frm.doc.calculate_based_on === 'Fixed');
frm.toggle_reqd("conditions", frm.doc.calculate_based_on !== 'Fixed');
}
});
});