Merge pull request #12962 from frappe/mergify/bp/version-13-pre-release/pr-12959

Co-authored-by: Suraj Shetty <surajshetty3416@gmail.com>
This commit is contained in:
Suraj Shetty 2021-04-22 16:29:29 +05:30 committed by GitHub
commit 6e8f76b591
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View file

@ -143,6 +143,7 @@
"Cypress": true,
"cy": true,
"it": true,
"describe": true,
"expect": true,
"context": true,
"before": true,

View file

@ -159,9 +159,10 @@ frappe.ui.form.Control = Class.extend({
},
validate_and_set_in_model: function(value, e) {
var me = this;
if(this.inside_change_event) {
if (this.inside_change_event || this.get_model_value() === value) {
return Promise.resolve();
}
this.inside_change_event = true;
var set = function(value) {
me.inside_change_event = false;

View file

@ -66,6 +66,10 @@ frappe.ui.form.ControlTableMultiSelect = frappe.ui.form.ControlLink.extend({
this._rows_list = this.rows.map(row => row[link_field.fieldname]);
return this.rows;
},
get_model_value() {
let value = this._super();
return value ? value.filter(d => !d.__islocal) : value;
},
validate(value) {
const rows = (value || []).slice();