Explorar el Código

Merge branch 'develop'

version-14
Rushabh Mehta hace 9 años
padre
commit
a08cbd6e1b
Se han modificado 20 ficheros con 116 adiciones y 43 borrados
  1. +5
    -2
      frappe/__init__.py
  2. +3
    -3
      frappe/commands/utils.py
  3. +5
    -0
      frappe/core/page/data_import_tool/data_import_tool.py
  4. +9
    -1
      frappe/installer.py
  5. +1
    -1
      frappe/model/rename_doc.py
  6. +2
    -2
      frappe/public/css/desk.css
  7. +7
    -5
      frappe/public/css/docs.css
  8. +7
    -5
      frappe/public/css/navbar.css
  9. +23
    -4
      frappe/public/css/sidebar.css
  10. +2
    -2
      frappe/public/css/website.css
  11. +0
    -1
      frappe/public/js/frappe/form/templates/form_sidebar.html
  12. +1
    -0
      frappe/public/js/frappe/list/list_sidebar.html
  13. +1
    -1
      frappe/public/js/frappe/ui/toolbar/navbar.html
  14. +1
    -1
      frappe/public/js/frappe/views/reports/query_report.js
  15. +4
    -0
      frappe/public/less/common.less
  16. +2
    -1
      frappe/public/less/desk.less
  17. +8
    -4
      frappe/public/less/navbar.less
  18. +27
    -4
      frappe/public/less/sidebar.less
  19. +2
    -2
      frappe/public/less/website.less
  20. +6
    -4
      socketio.js

+ 5
- 2
frappe/__init__.py Ver fichero

@@ -7,13 +7,13 @@ globals attached to frappe module
from __future__ import unicode_literals

from werkzeug.local import Local, release_local
import os, importlib, inspect, json
import os, sys, importlib, inspect, json

# public
from .exceptions import *
from .utils.jinja import get_jenv, get_template, render_template

__version__ = "7.0.9"
__version__ = "7.0.10"

local = Local()

@@ -755,6 +755,9 @@ def get_hooks(hook=None, default=None, app_name=None):
# if app is not installed while restoring
# ignore it
pass
print 'Could not find app "{0}"'.format(app_name)
if not request:
sys.exit(1)
raise
for key in dir(app_hooks):
if not key.startswith("_"):


+ 3
- 3
frappe/commands/utils.py Ver fichero

@@ -128,7 +128,7 @@ def add_to_email_queue(context, email_path):
with frappe.init_site(site):
frappe.connect()
for email in os.listdir(email_path):
with open(os.path.join(email_path, email)) as email_data:
with open(os.path.join(email_path, email)) as email_data:
kwargs = json.load(email_data)
kwargs['delayed'] = True
frappe.sendmail(**kwargs)
@@ -152,10 +152,10 @@ def export_doc(context, doctype, docname):

@click.command('export-json')
@click.argument('doctype')
@click.argument('name')
@click.argument('path')
@click.option('--name', help='Export only one document')
@pass_context
def export_json(context, doctype, name, path):
def export_json(context, doctype, path, name=None):
"Export doclist as json to the given path, use '-' as name for Singles."
from frappe.core.page.data_import_tool import data_import_tool
for site in context.sites:


+ 5
- 0
frappe/core/page/data_import_tool/data_import_tool.py Ver fichero

@@ -63,6 +63,11 @@ def export_json(doctype, path, filters=None, name=None):
for doc in frappe.get_all(doctype, fields=["name"], filters=filters, limit_page_length=0, order_by="creation asc"):
out.append(frappe.get_doc(doctype, doc.name).as_dict())
post_process(out)

dirname = os.path.dirname(path)
if not os.path.exists(dirname):
path = os.path.join('..', path)

with open(path, "w") as outfile:
outfile.write(frappe.as_json(out))



+ 9
- 1
frappe/installer.py Ver fichero

@@ -180,7 +180,7 @@ def remove_app(app_name, dry_run=False):
for module_name in frappe.get_module_list(app_name):
for doctype in frappe.get_list("DocType", filters={"module": module_name},
fields=["name", "issingle"]):
print "removing {0}...".format(doctype.name)
print "removing DocType {0}...".format(doctype.name)
# drop table

if not dry_run:
@@ -189,7 +189,15 @@ def remove_app(app_name, dry_run=False):
if not doctype.issingle:
drop_doctypes.append(doctype.name)

for page in frappe.get_list("Page", filters={"module": module_name}):
print "removing Page {0}...".format(page.name)
# drop table

if not dry_run:
frappe.delete_doc("Page", page.name)

print "removing Module {0}...".format(module_name)

if not dry_run:
frappe.delete_doc("Module Def", module_name)



+ 1
- 1
frappe/model/rename_doc.py Ver fichero

@@ -89,7 +89,7 @@ def rename_parent_and_child(doctype, old, new, meta):

def validate_rename(doctype, new, meta, merge, force, ignore_permissions):
# using for update so that it gets locked and someone else cannot edit it while this rename is going on!
exists = frappe.db.sql("select name from `tab{doctype}` where name=%s for update".format(doctype=frappe.db.escape(doctype)), new)
exists = frappe.db.sql("select name from `tab{doctype}` where name=%s COLLATE utf8mb4_unicode_ci for update".format(doctype=frappe.db.escape(doctype)), new)
exists = exists[0][0] if exists else None

if merge and not exists:


+ 2
- 2
frappe/public/css/desk.css Ver fichero

@@ -405,10 +405,10 @@ fieldset[disabled] .form-control {
.ui-menu .ui-menu-item {
font-size: 12px;
}
.ui-menu .ui-menu-item a,
.ui-menu .ui-menu-item div {
.ui-menu .ui-menu-item .ui-menu-item-wrapper {
padding: 9px 11.8px !important;
text-decoration: none;
margin: 0;
}
@media (min-width: 768px) {
.video-modal {


+ 7
- 5
frappe/public/css/docs.css Ver fichero

@@ -57,16 +57,18 @@
}
#search-modal .modal-header {
background: #fff;
display: table;
width: 100%;
}
#search-modal .modal-header form,
#search-modal .modal-header button {
display: table-cell;
#search-modal .modal-header form {
vertical-align: middle;
}
#search-modal .modal-header button {
height: 30px;
line-height: 0;
position: absolute;
right: 0;
top: 0;
z-index: 9;
padding: 9px;
}
.dropdown-navbar-new-comments > a {
border: 0;


+ 7
- 5
frappe/public/css/navbar.css Ver fichero

@@ -57,16 +57,18 @@
}
#search-modal .modal-header {
background: #fff;
display: table;
width: 100%;
}
#search-modal .modal-header form,
#search-modal .modal-header button {
display: table-cell;
#search-modal .modal-header form {
vertical-align: middle;
}
#search-modal .modal-header button {
height: 30px;
line-height: 0;
position: absolute;
right: 0;
top: 0;
z-index: 9;
padding: 9px;
}
.dropdown-navbar-new-comments > a {
border: 0;


+ 23
- 4
frappe/public/css/sidebar.css Ver fichero

@@ -219,7 +219,6 @@ body[data-route^="Module"] .main-menu .form-sidebar {
box-shadow: 5px 0 25px 0px rgba(0, 0, 0, 0.3);
height: 100%;
width: 40%;
padding: 25px;
display: block !important;
transition: transform 200ms ease-in-out;
}
@@ -227,11 +226,31 @@ body[data-route^="Module"] .main-menu .form-sidebar {
transform: translateX(0);
overflow-y: auto;
}
.layout-side-section .overlay-sidebar .divider {
height: 1px;
background-color: #d8dfe5;
opacity: 0.7;
}
.layout-side-section .overlay-sidebar li:not(.divider):not(.tagit-new):not(.module-sidebar-item) {
padding: 10px 15px;
}
.layout-side-section .overlay-sidebar .modified-by,
.layout-side-section .overlay-sidebar .created-by {
margin: 0;
}
.layout-side-section .overlay-sidebar .badge {
top: 9px;
right: 15px;
}
.layout-side-section .overlay-sidebar .reports-dropdown {
margin: 10px 0;
margin-top: 10px;
margin-bottom: -10px;
}
.layout-side-section .overlay-sidebar .reports-dropdown li:not(.divider) {
padding: 10px 0;
padding: 12.5px 0 !important;
}
.layout-side-section .overlay-sidebar .reports-dropdown li.divider {
height: 0;
}
}
@media (max-width: 767px) {
@@ -260,7 +279,7 @@ body[data-route^="Module"] .main-menu .form-sidebar {
padding-right: 0;
}
.layout-side-section .module-sidebar-nav .module-link {
padding-left: 25px;
padding: 15px 15px 15px 25px;
}
}
.sidebar-left .list-sidebar .stat-label,


+ 2
- 2
frappe/public/css/website.css Ver fichero

@@ -694,8 +694,8 @@ fieldset {
background-color: #fafbfc;
position: absolute;
height: 100%;
width: 4000px;
left: -2000px;
width: 100vw;
left: calc((100vw - 100%)/ -2);
z-index: -1;
}
.blog-comment-row {


+ 0
- 1
frappe/public/js/frappe/form/templates/form_sidebar.html Ver fichero

@@ -36,7 +36,6 @@
<ul class="list-unstyled sidebar-menu form-attachments">
<li class="divider"></li>
<li class="h6 attachments-label">{%= __("Attachments") %}</li>
<li class="divider"></li>
<li><a class="strong add-attachment">{%= __("Attach File") %}
<i class="octicon octicon-plus" style="margin-left: 2px;"></i></li></a>
</ul>


+ 1
- 0
frappe/public/js/frappe/list/list_sidebar.html Ver fichero

@@ -13,6 +13,7 @@
</ul>
</div>
</li>
<li class="divider"></li>
<li class="hide tree-link"><a href="#Tree/{%= doctype %}">{%= __("Tree") %}</a></li>
<li class="hide calendar-link"><a href="#Calendar/{%= doctype %}">{%= __("Calendar") %}</a></li>
<li class="hide gantt-link"><a href="#Gantt/{%= doctype %}">{%= __("Gantt") %}</a></li>


+ 1
- 1
frappe/public/js/frappe/ui/toolbar/navbar.html Ver fichero

@@ -61,9 +61,9 @@
<div class="input-group" style="width: 100%">
<input id="modal-search" type="text" class="form-control"
placeholder="{%= __("Search or type a command") %}" aria-haspopup="true">
<button type="reset" class="close"><i class="octicon octicon-x"></i></button>
</div>
</form>
<button type="button" class="close" data-dismiss="modal"><i class="octicon octicon-x"></i></button>
</div>
</div>
</div>


+ 1
- 1
frappe/public/js/frappe/views/reports/query_report.js Ver fichero

@@ -201,7 +201,7 @@ frappe.views.QueryReport = Class.extend({
formData.append("blob", blob);

var xhr = new XMLHttpRequest();
xhr.open("POST", '/api/method/frappe.www.print.report_to_pdf');
xhr.open("POST", '/api/method/frappe.utils.print_format.report_to_pdf');
xhr.setRequestHeader("X-Frappe-CSRF-Token", frappe.csrf_token);
xhr.responseType = "arraybuffer";



+ 4
- 0
frappe/public/less/common.less Ver fichero

@@ -7,6 +7,10 @@
// font-family: "Open Sans", "Helvetica", Arial, "sans-serif";
// }

html {
// overflow-x: hidden;
}

body {
font-family: -apple-system, BlinkMacSystemFont,
"Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell",


+ 2
- 1
frappe/public/less/desk.less Ver fichero

@@ -221,9 +221,10 @@ textarea.form-control {

.ui-menu .ui-menu-item {
font-size: @text-medium;
a, div {
.ui-menu-item-wrapper{
padding: 9px 11.8px !important;
text-decoration: none;
margin: 0;
}
}



+ 8
- 4
frappe/public/less/navbar.less Ver fichero

@@ -69,15 +69,19 @@
}
.modal-header {
background: #fff;
display: table;
width: 100%;

form, button {
display: table-cell;
form {
vertical-align: middle;
}

button {
height: 30px;
line-height: 0;
position: absolute;
right: 0;
top: 0;
z-index: 9;
padding: 9px;
}
}
}


+ 27
- 4
frappe/public/less/sidebar.less Ver fichero

@@ -288,7 +288,6 @@ body[data-route^="Module"] .main-menu {
box-shadow: 5px 0 25px 0px rgba(0,0,0,0.3);
height: 100%;
width: 40%;
padding: 25px;
display: block !important;
transition: transform 200ms ease-in-out;

@@ -297,11 +296,35 @@ body[data-route^="Module"] .main-menu {
overflow-y: auto;
}

.divider {
height: 1px;
background-color: #d8dfe5;
opacity: 0.7;
}

li:not(.divider):not(.tagit-new):not(.module-sidebar-item) {
padding: 10px 15px;
}

.modified-by, .created-by {
margin: 0;
}

.badge {
top: 9px;
right: 15px;
}

.reports-dropdown {
margin: 10px 0;
margin-top: 10px;
margin-bottom: -10px;

li:not(.divider) {
padding: 10px 0;
padding: 12.5px 0 !important;
}

li.divider {
height: 0;
}
}
}
@@ -334,7 +357,7 @@ body[data-route^="Module"] .main-menu {
padding-right: 0;

.module-link {
padding-left: 25px;
padding: 15px 15px 15px 25px;
}
}
}


+ 2
- 2
frappe/public/less/website.less Ver fichero

@@ -405,8 +405,8 @@ fieldset {
background-color: @light-bg;
position: absolute;
height: 100%;
width: 4000px;
left: -2000px;
width: 100vw;
left: ~"calc((100vw - 100%)/ -2)";
z-index: -1;
}



+ 6
- 4
socketio.js Ver fichero

@@ -171,12 +171,14 @@ function get_task_room(socket, task_id) {
}

function get_site_name(socket) {
if (conf.default_site) {
return conf.default_site;
}
else if (socket.request.headers['x-frappe-site-name']) {
if (socket.request.headers['x-frappe-site-name']) {
return get_hostname(socket.request.headers['x-frappe-site-name']);
}
else if (['localhost', '127.0.0.1'].indexOf(socket.request.headers.host) !== -1
&& conf.default_site) {
// from currentsite.txt since host is localhost
return conf.default_site;
}
else if (socket.request.headers.origin) {
return get_hostname(socket.request.headers.origin);
}


Cargando…
Cancelar
Guardar