Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
仰若水
frappe
Commits
af091ffd
Commit
af091ffd
authored
7 years ago
by
Saurabh
Browse files
Options
Download
Plain Diff
Merge branch 'hotfix'
parents
7a4787bb
3079f1c5
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
frappe/__init__.py
+1
-1
frappe/__init__.py
frappe/core/doctype/docfield/docfield.json
+1289
-1289
frappe/core/doctype/docfield/docfield.json
frappe/core/doctype/file/file.json
+2
-2
frappe/core/doctype/file/file.json
frappe/model/db_schema.py
+31
-26
frappe/model/db_schema.py
frappe/public/js/frappe/model/model.js
+1
-1
frappe/public/js/frappe/model/model.js
frappe/utils/jinja.py
+16
-10
frappe/utils/jinja.py
with
1340 additions
and
1329 deletions
+1340
-1329
frappe/__init__.py
View file @
af091ffd
...
...
@@ -14,7 +14,7 @@ import os, sys, importlib, inspect, json
from
.exceptions
import
*
from
.utils.jinja
import
get_jenv
,
get_template
,
render_template
,
get_email_from_template
__version__
=
'10.1.3
3
'
__version__
=
'10.1.3
4
'
__title__
=
"Frappe Framework"
local
=
Local
()
...
...
This diff is collapsed.
Click to expand it.
frappe/core/doctype/docfield/docfield.json
View file @
af091ffd
This diff is collapsed.
Click to expand it.
frappe/core/doctype/file/file.json
View file @
af091ffd
...
...
@@ -239,7 +239,7 @@
"in_list_view"
:
1
,
"in_standard_filter"
:
0
,
"label"
:
"File Size"
,
"length"
:
0
,
"length"
:
2
0
,
"no_copy"
:
0
,
"permlevel"
:
0
,
"print_hide"
:
0
,
...
...
@@ -683,7 +683,7 @@
"istable"
:
0
,
"max_attachments"
:
0
,
"menu_index"
:
0
,
"modified"
:
"2018-0
1-15 03:41:23.876072
"
,
"modified"
:
"2018-0
5-24 05:22:50.819899
"
,
"modified_by"
:
"Administrator"
,
"module"
:
"Core"
,
"name"
:
"File"
,
...
...
This diff is collapsed.
Click to expand it.
frappe/model/db_schema.py
View file @
af091ffd
...
...
@@ -24,31 +24,32 @@ varchar_len = '140'
standard_varchar_columns
=
(
'name'
,
'owner'
,
'modified_by'
,
'parent'
,
'parentfield'
,
'parenttype'
)
type_map
=
{
'Currency'
:
(
'decimal'
,
'18,6'
)
,
'Int'
:
(
'int'
,
'11'
)
,
'Float'
:
(
'decimal'
,
'18,6'
)
,
'Percent'
:
(
'decimal'
,
'18,6'
)
,
'Check'
:
(
'int'
,
'1'
)
,
'Small Text'
:
(
'text'
,
''
)
,
'Long Text'
:
(
'longtext'
,
''
)
,
'Code'
:
(
'longtext'
,
''
)
,
'Text Editor'
:
(
'longtext'
,
''
)
,
'Date'
:
(
'date'
,
''
)
,
'Datetime'
:
(
'datetime'
,
'6'
)
,
'Time'
:
(
'time'
,
'6'
)
,
'Text'
:
(
'text'
,
''
)
,
'Data'
:
(
'varchar'
,
varchar_len
)
,
'Link'
:
(
'varchar'
,
varchar_len
)
,
'Dynamic Link'
:
(
'varchar'
,
varchar_len
)
,
'Password'
:
(
'varchar'
,
varchar_len
)
,
'Select'
:
(
'varchar'
,
varchar_len
)
,
'Read Only'
:
(
'varchar'
,
varchar_len
)
,
'Attach'
:
(
'text'
,
''
)
,
'Attach Image'
:
(
'text'
,
''
)
,
'Signature'
:
(
'longtext'
,
''
)
,
'Color'
:
(
'varchar'
,
varchar_len
)
,
'Barcode'
:
(
'longtext'
,
''
)
,
'Geolocation'
:
(
'longtext'
,
''
)
'Currency'
:
(
'decimal'
,
'18,6'
),
'Int'
:
(
'int'
,
'11'
),
'Long Int'
:
(
'bigint'
,
'20'
),
# convert int to bigint if length is more than 11
'Float'
:
(
'decimal'
,
'18,6'
),
'Percent'
:
(
'decimal'
,
'18,6'
),
'Check'
:
(
'int'
,
'1'
),
'Small Text'
:
(
'text'
,
''
),
'Long Text'
:
(
'longtext'
,
''
),
'Code'
:
(
'longtext'
,
''
),
'Text Editor'
:
(
'longtext'
,
''
),
'Date'
:
(
'date'
,
''
),
'Datetime'
:
(
'datetime'
,
'6'
),
'Time'
:
(
'time'
,
'6'
),
'Text'
:
(
'text'
,
''
),
'Data'
:
(
'varchar'
,
varchar_len
),
'Link'
:
(
'varchar'
,
varchar_len
),
'Dynamic Link'
:
(
'varchar'
,
varchar_len
),
'Password'
:
(
'varchar'
,
varchar_len
),
'Select'
:
(
'varchar'
,
varchar_len
),
'Read Only'
:
(
'varchar'
,
varchar_len
),
'Attach'
:
(
'text'
,
''
),
'Attach Image'
:
(
'text'
,
''
),
'Signature'
:
(
'longtext'
,
''
),
'Color'
:
(
'varchar'
,
varchar_len
),
'Barcode'
:
(
'longtext'
,
''
),
'Geolocation'
:
(
'longtext'
,
''
)
}
default_columns
=
[
'name'
,
'creation'
,
'modified'
,
'modified_by'
,
'owner'
,
...
...
@@ -198,7 +199,7 @@ class DbTable:
if
k
not
in
column_list
:
d
=
self
.
columns
[
k
].
get_definition
()
if
d
:
ret
.
append
(
'`'
+
k
+
'` '
+
d
)
ret
.
append
(
'`'
+
k
+
'` '
+
d
)
column_list
.
append
(
k
)
return
ret
...
...
@@ -598,6 +599,10 @@ def remove_all_foreign_keys():
def
get_definition
(
fieldtype
,
precision
=
None
,
length
=
None
):
d
=
type_map
.
get
(
fieldtype
)
# convert int to long int if the length of the int is greater than 11
if
fieldtype
==
"Int"
and
length
>
11
:
d
=
type_map
.
get
(
"Long Int"
)
if
not
d
:
return
...
...
This diff is collapsed.
Click to expand it.
frappe/public/js/frappe/model/model.js
View file @
af091ffd
...
...
@@ -15,7 +15,7 @@ $.extend(frappe.model, {
std_fields
:
[
{
fieldname
:
'
name
'
,
fieldtype
:
'
Link
'
,
label
:
__
(
'
ID
'
)},
{
fieldname
:
'
owner
'
,
fieldtype
:
'
Data
'
,
label
:
__
(
'
Created By
'
)},
{
fieldname
:
'
owner
'
,
fieldtype
:
'
Link
'
,
label
:
__
(
'
Created By
'
)
,
options
:
'
User
'
},
{
fieldname
:
'
idx
'
,
fieldtype
:
'
Int
'
,
label
:
__
(
'
Index
'
)},
{
fieldname
:
'
creation
'
,
fieldtype
:
'
Date
'
,
label
:
__
(
'
Created On
'
)},
{
fieldname
:
'
modified
'
,
fieldtype
:
'
Date
'
,
label
:
__
(
'
Last Updated On
'
)},
...
...
This diff is collapsed.
Click to expand it.
frappe/utils/jinja.py
View file @
af091ffd
...
...
@@ -156,12 +156,9 @@ def get_allowed_functions_for_jenv():
"escape"
:
frappe
.
db
.
escape
,
}
if
getattr
(
frappe
.
local
,
"site"
,
None
):
# load jenv methods from hooks.py
for
app
in
frappe
.
get_installed_apps
():
for
jenv_method
in
frappe
.
get_hooks
(
app_name
=
app
).
get
(
'jenv'
,
{
"methods"
:
[]})[
"methods"
]:
method_name
,
method_definition
=
jenv_method
.
split
(
":"
)
out
[
method_name
]
=
frappe
.
get_attr
(
method_definition
)
# load jenv methods from hooks.py
for
method_name
,
method_definition
in
get_jenv_customization
(
"methods"
):
out
[
method_name
]
=
frappe
.
get_attr
(
method_definition
)
return
out
...
...
@@ -211,7 +208,16 @@ def set_filters(jenv):
if
frappe
.
flags
.
in_setup_help
:
return
# load jenv_filters from hooks.py
for
app
in
frappe
.
get_installed_apps
():
for
jenv_filter
in
frappe
.
get_hooks
(
app_name
=
app
).
get
(
'jenv'
,
{
"filters"
:
[]})[
"filters"
]:
filter_name
,
filter_function
=
jenv_filter
.
split
(
":"
)
jenv
.
filters
[
filter_name
]
=
frappe
.
get_attr
(
filter_function
)
for
filter_name
,
filter_function
in
get_jenv_customization
(
"filters"
):
jenv
.
filters
[
filter_name
]
=
frappe
.
get_attr
(
filter_function
)
def
get_jenv_customization
(
customizable_type
):
import
frappe
if
getattr
(
frappe
.
local
,
"site"
,
None
):
for
app
in
frappe
.
get_installed_apps
():
for
jenv_customizable
,
jenv_customizable_definition
in
frappe
.
get_hooks
(
app_name
=
app
).
get
(
"jenv"
,
{}).
items
():
if
customizable_type
==
jenv_customizable
:
for
data
in
jenv_customizable_definition
:
split_data
=
data
.
split
(
":"
)
yield
split_data
[
0
],
split_data
[
1
]
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help