Sfoglia il codice sorgente

fix: datetime field form validation fix

version-14
shariquerik 4 anni fa
parent
commit
bfc7c6b10c
1 ha cambiato i file con 7 aggiunte e 1 eliminazioni
  1. +7
    -1
      frappe/public/js/frappe/form/controls/base_control.js

+ 7
- 1
frappe/public/js/frappe/form/controls/base_control.js Vedi File

@@ -160,7 +160,13 @@ frappe.ui.form.Control = class BaseControl {
validate_and_set_in_model(value, e) {
var me = this;
let force_value_set = (this.doc && this.doc.__run_link_triggers);
let is_value_same = (this.get_model_value() === value);
let model_value = this.get_model_value();

if (this.df && this.df.fieldtype == 'Datetime') {
model_value = frappe.datetime.get_datetime_as_string(model_value);
}

let is_value_same = (model_value === value);

if (this.inside_change_event || (!force_value_set && is_value_same)) {
return Promise.resolve();


Caricamento…
Annulla
Salva