@@ -1 +1 @@ | |||||
__version__ = "4.5.0" | |||||
__version__ = "4.5.1" |
@@ -3,7 +3,7 @@ app_title = "Frappe Framework" | |||||
app_publisher = "Web Notes Technologies Pvt. Ltd." | app_publisher = "Web Notes Technologies Pvt. Ltd." | ||||
app_description = "Full Stack Web Application Framework in Python" | app_description = "Full Stack Web Application Framework in Python" | ||||
app_icon = "assets/frappe/images/frappe.svg" | app_icon = "assets/frappe/images/frappe.svg" | ||||
app_version = "4.5.0" | |||||
app_version = "4.5.1" | |||||
app_color = "#3498db" | app_color = "#3498db" | ||||
app_email = "support@frappe.io" | app_email = "support@frappe.io" | ||||
@@ -224,19 +224,21 @@ frappe.ui.form.ControlInput = frappe.ui.form.Control.extend({ | |||||
} else { | } else { | ||||
// inline | // inline | ||||
var value = me.get_value(); | var value = me.get_value(); | ||||
if(me.parse) { | |||||
value = me.parse(value); | |||||
var parsed = me.parse ? me.parse(value) : value; | |||||
var set_input = function(before, after) { | |||||
if(before !== after) { | |||||
me.set_input(after); | |||||
} else { | |||||
me.set_mandatory && me.set_mandatory(before); | |||||
} | |||||
} | } | ||||
if(me.validate) { | if(me.validate) { | ||||
me.validate(value, function(value1) { | |||||
if(value !== value1) { | |||||
me.set_input(value1) | |||||
} else { | |||||
me.set_mandatory && me.set_mandatory(value); | |||||
} | |||||
me.validate(parsed, function(validated) { | |||||
set_input(value, validated); | |||||
}); | }); | ||||
} else { | } else { | ||||
me.set_mandatory && me.set_mandatory(value); | |||||
set_input(value, parsed); | |||||
} | } | ||||
} | } | ||||
}); | }); | ||||
@@ -375,14 +377,17 @@ frappe.ui.form.ControlInt = frappe.ui.form.ControlData.extend({ | |||||
return false; | return false; | ||||
}) | }) | ||||
}, | }, | ||||
parse: function(value) { | |||||
return cint(value, null); | |||||
}, | |||||
validate: function(value, callback) { | validate: function(value, callback) { | ||||
return callback(cint(value, null)); | |||||
return callback(value); | |||||
} | } | ||||
}); | }); | ||||
frappe.ui.form.ControlFloat = frappe.ui.form.ControlInt.extend({ | frappe.ui.form.ControlFloat = frappe.ui.form.ControlInt.extend({ | ||||
validate: function(value, callback) { | |||||
return callback(isNaN(parseFloat(value)) ? null : flt(value)); | |||||
parse: function(value) { | |||||
return isNaN(parseFloat(value)) ? null : flt(value); | |||||
}, | }, | ||||
format_for_input: function(value) { | format_for_input: function(value) { | ||||
var number_format; | var number_format; | ||||
@@ -9,7 +9,7 @@ frappe.provide("frappe.datetime"); | |||||
$.extend(frappe.datetime, { | $.extend(frappe.datetime, { | ||||
str_to_obj: function(d) { | str_to_obj: function(d) { | ||||
return moment(d)._d; | |||||
return moment(d, "YYYY-MM-DD HH:mm:ss")._d; | |||||
}, | }, | ||||
obj_to_str: function(d) { | obj_to_str: function(d) { | ||||
@@ -365,12 +365,12 @@ frappe.ui.Filter = Class.extend({ | |||||
if(this.field.df.fieldname==="docstatus") { | if(this.field.df.fieldname==="docstatus") { | ||||
value = {0:"Draft", 1:"Submitted", 2:"Cancelled"}[value] || value; | value = {0:"Draft", 1:"Submitted", 2:"Cancelled"}[value] || value; | ||||
} | |||||
if(this.field.df.original_type==="Check") { | |||||
} else if(this.field.df.original_type==="Check") { | |||||
value = {0:"No", 1:"Yes"}[cint(value)]; | value = {0:"No", 1:"Yes"}[cint(value)]; | ||||
} else if (in_list(["Date", "Datetime"], this.field.df.fieldtype)) { | } else if (in_list(["Date", "Datetime"], this.field.df.fieldtype)) { | ||||
value = frappe.datetime.str_to_user(value); | value = frappe.datetime.str_to_user(value); | ||||
} else { | |||||
value = this.field.get_value(); | |||||
} | } | ||||
this.$btn_group.find(".toggle-filter") | this.$btn_group.find(".toggle-filter") | ||||
@@ -1,4 +1,15 @@ | |||||
@import url(https://fonts.googleapis.com/css?family=Noto+Sans:400,700); | |||||
@font-face { | |||||
font-family: 'Noto Sans'; | |||||
font-style: normal; | |||||
font-weight: 400; | |||||
src: local('Noto Sans'), local('NotoSans'), url({{ frappe.get_url("/assets/frappe/css/font/notosans-400.ttf") }}) format('truetype'); | |||||
} | |||||
@font-face { | |||||
font-family: 'Noto Sans'; | |||||
font-style: normal; | |||||
font-weight: 700; | |||||
src: local('Noto Sans Bold'), local('NotoSans-Bold'), url({{ frappe.get_url("/assets/frappe/css/font/notosans-700.ttf")}}) format('truetype'); | |||||
} | |||||
@media screen { | @media screen { | ||||
.print-format-gutter { | .print-format-gutter { | ||||
@@ -47,6 +47,7 @@ def get_allowed_functions_for_jenv(): | |||||
# make available limited methods of frappe | # make available limited methods of frappe | ||||
"frappe": { | "frappe": { | ||||
"_": frappe._, | "_": frappe._, | ||||
"get_url": frappe.utils.get_url, | |||||
"format_value": frappe.format_value, | "format_value": frappe.format_value, | ||||
"format_date": frappe.utils.data.global_date_format, | "format_date": frappe.utils.data.global_date_format, | ||||
"form_dict": frappe.local.form_dict, | "form_dict": frappe.local.form_dict, | ||||
@@ -1,7 +1,7 @@ | |||||
from setuptools import setup, find_packages | from setuptools import setup, find_packages | ||||
import os | import os | ||||
version = "4.5.0" | |||||
version = "4.5.1" | |||||
with open("requirements.txt", "r") as f: | with open("requirements.txt", "r") as f: | ||||
install_requires = f.readlines() | install_requires = f.readlines() | ||||
@@ -1,6 +1,6 @@ | |||||
{ | { | ||||
"db_name": "test_frappe", | "db_name": "test_frappe", | ||||
"db_password": "test_frappe", | "db_password": "test_frappe", | ||||
"auto_email_id": "test@example.com", | |||||
"admin_password": "admin" | |||||
"admin_password": "admin", | |||||
"mute_emails": 1 | |||||
} | } |