Ver a proveniência

Merge pull request #2230 from shreyasp/bulk_update_validation

[Minor] Added validation to bulk update in case user does not specify value field
version-14
Nabin Hait há 8 anos
committed by GitHub
ascendente
cometimento
4f7a737024
1 ficheiros alterados com 18 adições e 13 eliminações
  1. +18
    -13
      frappe/desk/doctype/bulk_update/bulk_update.js

+ 18
- 13
frappe/desk/doctype/bulk_update/bulk_update.js Ver ficheiro

@@ -4,19 +4,24 @@
frappe.ui.form.on('Bulk Update', {
refresh: function(frm) {
frm.page.set_primary_action(__('Update'), function() {
frappe.call({
method: 'frappe.desk.doctype.bulk_update.bulk_update.update',
args: {
doctype: frm.doc.document_type,
field: frm.doc.field,
value: frm.doc.update_value,
condition: frm.doc.condition,
limit: frm.doc.limit
},
callback: function() {
frappe.hide_progress();
}
});
if(!frm.doc.update_value){
frappe.throw(__('Field "value" is mandatory. Please specify value to be updated'));
}
else{
frappe.call({
method: 'frappe.desk.doctype.bulk_update.bulk_update.update',
args: {
doctype: frm.doc.document_type,
field: frm.doc.field,
value: frm.doc.update_value,
condition: frm.doc.condition,
limit: frm.doc.limit
},
callback: function() {
frappe.hide_progress();
}
});
}
});
},
document_type: function(frm) {


Carregando…
Cancelar
Guardar