diff --git a/frappe/__init__.py b/frappe/__init__.py index 2ec5de9d7e..14d1197c13 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -14,7 +14,7 @@ import os, sys, importlib, inspect, json from .exceptions import * from .utils.jinja import get_jenv, get_template, render_template -__version__ = '8.3.0' +__version__ = '8.3.1' __title__ = "Frappe Framework" local = Local() diff --git a/frappe/patches/v8_1/update_format_options_in_auto_email_report.py b/frappe/patches/v8_1/update_format_options_in_auto_email_report.py index 04bc9c0581..56609780cb 100644 --- a/frappe/patches/v8_1/update_format_options_in_auto_email_report.py +++ b/frappe/patches/v8_1/update_format_options_in_auto_email_report.py @@ -11,6 +11,4 @@ def execute(): auto_email_list = frappe.get_all("Auto Email Report", filters={"format": "XLS"}) for auto_email in auto_email_list: - doc = frappe.get_doc("Auto Email Report", auto_email.name) - doc.format = "XLSX" - doc.save() + frappe.db.set_value("Auto Email Report", auto_email.name, "format", "XLSX") diff --git a/frappe/public/js/frappe/form/control.js b/frappe/public/js/frappe/form/control.js index 867ce274b6..898bdd7bf3 100755 --- a/frappe/public/js/frappe/form/control.js +++ b/frappe/public/js/frappe/form/control.js @@ -344,7 +344,8 @@ frappe.ui.form.ControlInput = frappe.ui.form.Control.extend({ set_disp_area: function() { let value = this.get_input_value(); - if(in_list(["Currency", "Int", "Float"], this.df.fieldtype) && (this.value === 0 || value === 0)) { + if(in_list(["Currency", "Int", "Float"], this.df.fieldtype) + && (this.value === 0 || value === 0)) { // to set the 0 value in readonly for currency, int, float field value = 0; } else { @@ -1215,39 +1216,31 @@ frappe.ui.form.ControlAttachImage = frappe.ui.form.ControlAttach.extend({ frappe.ui.form.ControlSelect = frappe.ui.form.ControlData.extend({ html_element: "select", make_input: function() { - var me = this; this._super(); this.set_options(); }, - set_input: function(value) { + set_formatted_input: function(value) { // refresh options first - (new ones??) - this.set_options(value || ""); + if(value==null) value = ''; + this.set_options(value); - var input_value = null; + // set in the input element + this._super(value); + + // check if the value to be set is selected + var input_value = ''; if(this.$input) { - var input_value = this.$input.val(); + input_value = this.$input.val(); } - // not a possible option, repair - if(this.doctype && this.docname) { - // model value is not an option, - // set the default option (displayed) - var model_value = frappe.model.get_value(this.doctype, this.docname, this.df.fieldname); - if(model_value == null && (input_value || "") != (model_value || "")) { - this.set_model_value(input_value); - } else { - this.last_value = value; - } - } else { - if(value !== input_value) { - this.set_value(input_value); - } + if(value && input_value && value !== input_value) { + // trying to set a non-existant value + // model value must be same as whatever the input is + this.set_model_value(input_value); } - - this._super(value); - }, set_options: function(value) { + // reset options, if something new is set var options = this.df.options || []; if(typeof this.df.options==="string") { options = this.df.options.split("\n");