fix: Default values were not triggering change event (backport #12975) (#12976)

(cherry picked from commit 669fead799)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot] 2021-04-23 20:37:05 +05:30 committed by GitHub
parent ef5a7ef10a
commit ec8bf035ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -159,7 +159,10 @@ frappe.ui.form.Control = Class.extend({
},
validate_and_set_in_model: function(value, e) {
var me = this;
if (this.inside_change_event || this.get_model_value() === value) {
let force_value_set = (this.doc && this.doc.__run_link_triggers);
let is_value_same = (this.get_model_value() === value);
if (this.inside_change_event || (!force_value_set && is_value_same)) {
return Promise.resolve();
}