fix: pass translated label to change button type (#35564)

fix: change button type for translated labels

Co-authored-by: Marica <maricadsouza221197@gmail.com>
This commit is contained in:
Raffael Meyer 2023-06-07 18:19:02 +02:00 committed by GitHub
parent a9a47a51e4
commit e1f3b7cbc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 12 deletions

View File

@ -41,7 +41,7 @@ frappe.ui.form.on("Bank Clearance", {
frm.trigger("get_payment_entries") frm.trigger("get_payment_entries")
); );
frm.change_custom_button_type('Get Payment Entries', null, 'primary'); frm.change_custom_button_type(__('Get Payment Entries'), null, 'primary');
}, },
update_clearance_date: function(frm) { update_clearance_date: function(frm) {
@ -53,8 +53,8 @@ frappe.ui.form.on("Bank Clearance", {
frm.refresh_fields(); frm.refresh_fields();
if (!frm.doc.payment_entries.length) { if (!frm.doc.payment_entries.length) {
frm.change_custom_button_type('Get Payment Entries', null, 'primary'); frm.change_custom_button_type(__('Get Payment Entries'), null, 'primary');
frm.change_custom_button_type('Update Clearance Date', null, 'default'); frm.change_custom_button_type(__('Update Clearance Date'), null, 'default');
} }
} }
}); });
@ -72,8 +72,8 @@ frappe.ui.form.on("Bank Clearance", {
frm.trigger("update_clearance_date") frm.trigger("update_clearance_date")
); );
frm.change_custom_button_type('Get Payment Entries', null, 'default'); frm.change_custom_button_type(__('Get Payment Entries'), null, 'default');
frm.change_custom_button_type('Update Clearance Date', null, 'primary'); frm.change_custom_button_type(__('Update Clearance Date'), null, 'primary');
} }
} }
}); });

View File

@ -81,7 +81,7 @@ frappe.ui.form.on("Bank Reconciliation Tool", {
frm.add_custom_button(__('Get Unreconciled Entries'), function() { frm.add_custom_button(__('Get Unreconciled Entries'), function() {
frm.trigger("make_reconciliation_tool"); frm.trigger("make_reconciliation_tool");
}); });
frm.change_custom_button_type('Get Unreconciled Entries', null, 'primary'); frm.change_custom_button_type(__('Get Unreconciled Entries'), null, 'primary');
}, },

View File

@ -65,22 +65,22 @@ erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationCo
this.frm.add_custom_button(__('Get Unreconciled Entries'), () => this.frm.add_custom_button(__('Get Unreconciled Entries'), () =>
this.frm.trigger("get_unreconciled_entries") this.frm.trigger("get_unreconciled_entries")
); );
this.frm.change_custom_button_type('Get Unreconciled Entries', null, 'primary'); this.frm.change_custom_button_type(__('Get Unreconciled Entries'), null, 'primary');
} }
if (this.frm.doc.invoices.length && this.frm.doc.payments.length) { if (this.frm.doc.invoices.length && this.frm.doc.payments.length) {
this.frm.add_custom_button(__('Allocate'), () => this.frm.add_custom_button(__('Allocate'), () =>
this.frm.trigger("allocate") this.frm.trigger("allocate")
); );
this.frm.change_custom_button_type('Allocate', null, 'primary'); this.frm.change_custom_button_type(__('Allocate'), null, 'primary');
this.frm.change_custom_button_type('Get Unreconciled Entries', null, 'default'); this.frm.change_custom_button_type(__('Get Unreconciled Entries'), null, 'default');
} }
if (this.frm.doc.allocation.length) { if (this.frm.doc.allocation.length) {
this.frm.add_custom_button(__('Reconcile'), () => this.frm.add_custom_button(__('Reconcile'), () =>
this.frm.trigger("reconcile") this.frm.trigger("reconcile")
); );
this.frm.change_custom_button_type('Reconcile', null, 'primary'); this.frm.change_custom_button_type(__('Reconcile'), null, 'primary');
this.frm.change_custom_button_type('Get Unreconciled Entries', null, 'default'); this.frm.change_custom_button_type(__('Get Unreconciled Entries'), null, 'default');
this.frm.change_custom_button_type('Allocate', null, 'default'); this.frm.change_custom_button_type(__('Allocate'), null, 'default');
} }
// check for any running reconciliation jobs // check for any running reconciliation jobs