[text-editor] dont keep refreshing value and better message for mandatory missing

This commit is contained in:
Rushabh Mehta 2017-07-05 14:18:11 +05:30
parent 5b2d7cb12c
commit 1b3fab9daf
2 changed files with 2 additions and 3 deletions

View file

@ -423,12 +423,11 @@ class BaseDocument(object):
return "{}: {}: {}".format(_("Error"), _("Data missing in table"), _(df.label))
elif self.parentfield:
return "{}: {} {} #{}: {}: {}".format(_("Error"), frappe.bold(_(self.doctype)),
_("Row"), self.idx, _("Value missing for"), _(df.label))
else:
return "{}: {}: {}".format(_("Error"), _("Value missing for"), _(df.label))
return _("Error: Value missing for {0}: {1}").format(_(df.parent), _(df.label))
missing = []

View file

@ -1761,10 +1761,10 @@ frappe.ui.form.ControlTextEditor = frappe.ui.form.ControlCode.extend({
});
},
onChange: function(value) {
me._last_change_on = new Date();
me.parse_validate_and_set_in_model(value);
},
onKeydown: function(e) {
this._last_change_on = new Date();
var key = frappe.ui.keys.get_key(e);
// prevent 'New DocType (Ctrl + B)' shortcut in editor
if(['ctrl+b', 'meta+b'].indexOf(key) !== -1) {