[minor] Hide add new row button if cannot_add_rows is enabled in df (#5091)

This commit is contained in:
rohitwaghchaure 2018-02-28 17:08:46 +05:30 committed by Rushabh Mehta
parent cacc0b8cb2
commit 3a90ba61e9

View file

@ -234,7 +234,7 @@ frappe.ui.form.Grid = Class.extend({
this.wrapper.find(".grid-footer").toggle(true);
// show, hide buttons to add rows
if(this.cannot_add_rows) {
if(this.cannot_add_rows || (this.df && this.df.cannot_add_rows)) {
// add 'hide' to buttons
this.wrapper.find(".grid-add-row, .grid-add-multiple-rows")
.addClass('hide');