Selaa lähdekoodia

Merge branch 'develop'

version-14
Rushabh Mehta 9 vuotta sitten
vanhempi
commit
e779e7aef9
69 muutettua tiedostoa jossa 11966 lisäystä ja 11151 poistoa
  1. +6
    -3
      frappe/__init__.py
  2. +1
    -1
      frappe/__version__.py
  3. +11
    -7
      frappe/core/page/modules_setup/modules_setup.py
  4. +15
    -5
      frappe/desk/doctype/desktop_icon/desktop_icon.py
  5. +2
    -2
      frappe/desk/page/modules/modules_sidebar_item.html
  6. +1
    -1
      frappe/hooks.py
  7. +3
    -0
      frappe/model/base_document.py
  8. +4
    -0
      frappe/model/document.py
  9. +3
    -8
      frappe/public/css/desk.css
  10. +6
    -0
      frappe/public/js/frappe/form/control.js
  11. +31
    -12
      frappe/public/js/frappe/form/grid.js
  12. +3
    -3
      frappe/public/js/frappe/form/grid_body.html
  13. +8
    -3
      frappe/public/js/frappe/form/link_selector.js
  14. +3
    -8
      frappe/public/less/desk.less
  15. +191
    -176
      frappe/translations/ar.csv
  16. +191
    -176
      frappe/translations/bg.csv
  17. +191
    -176
      frappe/translations/bn.csv
  18. +191
    -176
      frappe/translations/bs.csv
  19. +191
    -176
      frappe/translations/ca.csv
  20. +191
    -176
      frappe/translations/cs.csv
  21. +153
    -157
      frappe/translations/da-DK.csv
  22. +191
    -176
      frappe/translations/da.csv
  23. +191
    -176
      frappe/translations/de.csv
  24. +191
    -176
      frappe/translations/el.csv
  25. +1685
    -1689
      frappe/translations/es-PE.csv
  26. +228
    -213
      frappe/translations/es.csv
  27. +193
    -178
      frappe/translations/et.csv
  28. +191
    -176
      frappe/translations/fa.csv
  29. +191
    -176
      frappe/translations/fi.csv
  30. +210
    -195
      frappe/translations/fr.csv
  31. +191
    -176
      frappe/translations/gu.csv
  32. +191
    -176
      frappe/translations/he.csv
  33. +191
    -176
      frappe/translations/hi.csv
  34. +191
    -176
      frappe/translations/hr.csv
  35. +191
    -176
      frappe/translations/hu.csv
  36. +191
    -176
      frappe/translations/id.csv
  37. +191
    -176
      frappe/translations/it.csv
  38. +191
    -177
      frappe/translations/ja.csv
  39. +190
    -175
      frappe/translations/km.csv
  40. +191
    -176
      frappe/translations/kn.csv
  41. +191
    -176
      frappe/translations/ko.csv
  42. +191
    -176
      frappe/translations/lv.csv
  43. +191
    -176
      frappe/translations/mk.csv
  44. +191
    -176
      frappe/translations/ml.csv
  45. +191
    -176
      frappe/translations/mr.csv
  46. +191
    -176
      frappe/translations/ms.csv
  47. +191
    -176
      frappe/translations/my.csv
  48. +193
    -178
      frappe/translations/nl.csv
  49. +191
    -176
      frappe/translations/no.csv
  50. +192
    -177
      frappe/translations/pl.csv
  51. +191
    -176
      frappe/translations/pt-BR.csv
  52. +191
    -176
      frappe/translations/pt.csv
  53. +191
    -176
      frappe/translations/ro.csv
  54. +191
    -176
      frappe/translations/ru.csv
  55. +191
    -176
      frappe/translations/sk.csv
  56. +192
    -177
      frappe/translations/sl.csv
  57. +191
    -176
      frappe/translations/sq.csv
  58. +191
    -176
      frappe/translations/sr.csv
  59. +191
    -176
      frappe/translations/sv.csv
  60. +191
    -176
      frappe/translations/ta.csv
  61. +191
    -176
      frappe/translations/te.csv
  62. +191
    -176
      frappe/translations/th.csv
  63. +195
    -179
      frappe/translations/tr.csv
  64. +191
    -176
      frappe/translations/uk.csv
  65. +189
    -175
      frappe/translations/ur.csv
  66. +191
    -176
      frappe/translations/vi.csv
  67. +191
    -176
      frappe/translations/zh-cn.csv
  68. +226
    -211
      frappe/translations/zh-tw.csv
  69. +1
    -1
      setup.py

+ 6
- 3
frappe/__init__.py Näytä tiedosto

@@ -48,9 +48,9 @@ def _(msg, lang=None):

# msg should always be unicode
msg = cstr(msg)
return get_full_dict(local.lang).get(msg) or msg
def get_lang_dict(fortype, name=None):
"""Returns the translated language dict for the given type and name.

@@ -836,7 +836,10 @@ def copy_doc(doc, ignore_no_copy=True):
if hasattr(d, df.fieldname):
d.set(df.fieldname, None)

fields_to_clear = ['name', 'owner', 'creation', 'modified', 'modified_by', 'docstatus']
fields_to_clear = ['name', 'owner', 'creation', 'modified', 'modified_by']

if not local.flags.in_test:
fields_to_clear.append("docstatus")

if not isinstance(doc, dict):
d = doc.as_dict()


+ 1
- 1
frappe/__version__.py Näytä tiedosto

@@ -1,2 +1,2 @@
from __future__ import unicode_literals
__version__ = "6.27.2"
__version__ = "6.27.3"

+ 11
- 7
frappe/core/page/modules_setup/modules_setup.py Näytä tiedosto

@@ -48,17 +48,21 @@ def get_user_icons(user):

icons = []
for icon in get_desktop_icons(user):
add = True
if icon.hidden_in_standard:
continue
add = False

if not icon.custom:
if icon.type=="page" and icon.link not in allowed_pages:
continue
if icon.module_name=='Learn':
pass

elif icon.type=="page" and icon.link not in allowed_pages:
add = False

elif icon.type=="module" and icon.module_name not in user_perms.allow_modules:
continue
add = False

icons.append(icon)
if add:
icons.append(icon)

return icons



+ 15
- 5
frappe/desk/doctype/desktop_icon/desktop_icon.py Näytä tiedosto

@@ -97,7 +97,15 @@ def add_user_icon(label, link, type, _doctype):
frappe.session.user)[0][0] or \
frappe.db.sql('select count(*) from `tabDesktop Icon` where standard=1')[0][0]

color = random.choice(palette)
module = frappe.db.get_value('DocType', _doctype, 'module')
module_icon = frappe.get_value('Desktop Icon', {'standard':1, 'module_name':module},
['icon', 'color', 'reverse'], as_dict=True)

if not module_icon:
module_icon = frappe._dict()
opts = random.choice(palette)
module_icon.color = opts[0]
module_icon.reverse = 0 if (len(opts) > 1) else 1

try:
frappe.get_doc({
@@ -107,8 +115,9 @@ def add_user_icon(label, link, type, _doctype):
'link': link,
'type': type,
'_doctype': _doctype,
'color': color[0],
'reverse': 0 if (len(color) > 1) else 1,
'icon': module_icon.icon,
'color': module_icon.color,
'reverse': module_icon.reverse,
'idx': idx + 1,
'custom': 1,
'standard': 0
@@ -128,8 +137,9 @@ def set_order(new_order):
if isinstance(new_order, basestring):
new_order = json.loads(new_order)
for i, module_name in enumerate(new_order):
icon = get_user_copy(module_name, frappe.session.user)
icon.db_set('idx', i)
if module_name not in ('Explore',):
icon = get_user_copy(module_name, frappe.session.user)
icon.db_set('idx', i)

clear_desktop_icons_cache()



+ 2
- 2
frappe/desk/page/modules/modules_sidebar_item.html Näytä tiedosto

@@ -1,7 +1,7 @@
<li data-label="{{ item.label }}" class="strong module-sidebar-item">
<li class="strong module-sidebar-item">
<a class="module-link" data-name="{{ item.module_name }}"
href="#modules/{{ item.module_name }}">
<i class="icon icon-chevron-right pull-right"
style="display: none;"></i>
<span>{{ item.label }}</span></a>
<span>{{ item._label }}</span></a>
</li>

+ 1
- 1
frappe/hooks.py Näytä tiedosto

@@ -5,7 +5,7 @@ app_publisher = "Frappe Technologies"
app_description = "Full stack web framework with Python, Javascript, MariaDB, Redis, Node"

app_icon = "octicon octicon-circuit-board"
app_version = "6.27.2"
app_version = "6.27.3"
app_color = "orange"
source_link = "https://github.com/frappe/frappe"
app_license = "MIT"


+ 3
- 0
frappe/model/base_document.py Näytä tiedosto

@@ -201,6 +201,9 @@ class BaseDocument(object):
# unique empty field should be set to None
d[fieldname] = None

if isinstance(d[fieldname], list) and df.fieldtype != 'Table':
frappe.throw(_('Value for {0} cannot be a list').format(_(df.label)))

return d

def init_valid_columns(self):


+ 4
- 0
frappe/model/document.py Näytä tiedosto

@@ -211,6 +211,10 @@ class Document(BaseDocument):
self.run_post_save_methods()
self.flags.in_insert = False

# delete __islocal
if hasattr(self, "__islocal"):
delattr(self, "__islocal")

return self

def save(self, ignore_permissions=None):


+ 3
- 8
frappe/public/css/desk.css Näytä tiedosto

@@ -317,14 +317,9 @@ a.form-link {
textarea.form-control {
height: 120px;
}
ul.linked-with-list {
list-style: none;
margin: 0 0 20px 0;
padding: 0 0 0 0;
}
ul.linked-with-list li {
padding: 5px 0px;
border-bottom: 1px solid #d1d8dd;
.link-select-row {
padding: 5px;
border-bottom: 1px solid #EBEFF2;
}
/* jquery ui */
.ui-datepicker .ui-datepicker-header {


+ 6
- 0
frappe/public/js/frappe/form/control.js Näytä tiedosto

@@ -1302,6 +1302,12 @@ frappe.ui.form.ControlDynamicLink = frappe.ui.form.ControlLink.extend({
if(this.df.get_options) {
return this.df.get_options();
}
if (this.docname==null && cur_dialog!=null){ //for dialog box
return cur_dialog.get_value(this.df.options)
}
if (cur_frm==null){//for list page
return $("input[data-fieldname*="+this.df.options+"]").val()
}
var options = frappe.model.get_value(this.df.parent, this.docname, this.df.options);
// if(!options) {
// msgprint(__("Please set {0} first",


+ 31
- 12
frappe/public/js/frappe/form/grid.js Näytä tiedosto

@@ -17,6 +17,7 @@ frappe.ui.form.Grid = Class.extend({
this.fieldinfo = {};
this.doctype = this.df.options;
this.template = null;
this.multiple_set = false;
if(this.frm.meta.__form_grid_templates
&& this.frm.meta.__form_grid_templates[this.df.fieldname]) {
this.template = this.frm.meta.__form_grid_templates[this.df.fieldname];
@@ -99,7 +100,21 @@ frappe.ui.form.Grid = Class.extend({

if(this.is_editable()) {
this.wrapper.find(".grid-footer").toggle(true);
this.wrapper.find(".grid-add-row, .grid-add-multiple-rows").toggle(!this.cannot_add_rows);

// show, hide buttons to add rows
if(this.cannot_add_rows) {
// add 'hide' to buttons
this.wrapper.find(".grid-add-row, .grid-add-multiple-rows")
.addClass('hide');
} else {
// show buttons
this.wrapper.find(".grid-add-row").removeClass('hide');

if(this.multiple_set) {
this.wrapper.find(".grid-add-multiple-rows").removeClass('hide')
}
}

this.make_sortable($rows);
} else {
this.wrapper.find(".grid-footer").toggle(false);
@@ -213,18 +228,22 @@ frappe.ui.form.Grid = Class.extend({
if(this.multiple_set) return;
var me = this;
var link_field = frappe.meta.get_docfield(this.df.options, link);
$(this.wrapper).find(".grid-add-multiple-rows")
.removeClass("hide")
.on("click", function() {
new frappe.ui.form.LinkSelector({
doctype: link_field.options,
fieldname: link,
qty_fieldname: qty,
target: me,
txt: ""
});
return false;
var btn = $(this.wrapper).find(".grid-add-multiple-rows");

// show button
btn.removeClass('hide');

// open link selector on click
btn.on("click", function() {
new frappe.ui.form.LinkSelector({
doctype: link_field.options,
fieldname: link,
qty_fieldname: qty,
target: me,
txt: ""
});
return false;
});
this.multiple_set = true;
},
setup_allow_bulk_edit: function() {


+ 3
- 3
frappe/public/js/frappe/form/grid_body.html Näytä tiedosto

@@ -7,11 +7,11 @@
<div class="small form-clickable-section grid-footer">
<div class="row">
<div class="col-sm-6">
<a href="#" class="btn btn-xs btn-default grid-add-row">
{%= __("Add new row") %}</a>
<a href="#" class="grid-add-multiple-rows btn btn-xs btn-default hide"
style="margin-left: 10px;">
style="margin-right: 10px;">
{%= __("Add multiple rows") %}</a>
<a href="#" class="btn btn-xs btn-default grid-add-row">
{%= __("Add new row") %}</a>
</div>
<div class="col-sm-6 text-right">
<a href="#" class="grid-download btn btn-xs btn-default hide"


+ 8
- 3
frappe/public/js/frappe/form/link_selector.js Näytä tiedosto

@@ -44,8 +44,9 @@ frappe.ui.form.LinkSelector = Class.extend({
}
});
this.dialog.show();
this.search();
},
search: function(btn) {
search: function() {
var args = {
txt: this.dialog.fields_dict.txt.get_value(),
doctype: this.doctype,
@@ -73,8 +74,12 @@ frappe.ui.form.LinkSelector = Class.extend({
parent.empty();
if(r.values.length) {
$.each(r.values, function(i, v) {
var row = $(repl('<p><b><a href="#" data-value="%(name)s">%(name)s</a></b> \
<span class="text-muted">%(values)s</span></p>', {
var row = $(repl('<div class="row link-select-row">\
<div class="col-xs-4">\
<b><a href="#" data-value="%(name)s">%(name)s</a></b></div>\
<div class="col-xs-8">\
<span class="text-muted">%(values)s</span></div>\
</div>', {
name: v[0],
values: v.splice(1).join(", ")
})).appendTo(parent);


+ 3
- 8
frappe/public/less/desk.less Näytä tiedosto

@@ -121,16 +121,11 @@ textarea.form-control {
height: 120px;
}

ul.linked-with-list {
list-style: none;
margin: 0 0 20px 0;
padding: 0 0 0 0;
.link-select-row {
padding: 5px;
border-bottom: 1px solid @light-border-color;
}

ul.linked-with-list li {
padding: 5px 0px;
border-bottom: 1px solid @border-color;
}

/* jquery ui */



+ 191
- 176
frappe/translations/ar.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/bg.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/bn.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/bs.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/ca.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/cs.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 153
- 157
frappe/translations/da-DK.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/da.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/de.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/el.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 1685
- 1689
frappe/translations/es-PE.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 228
- 213
frappe/translations/es.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 193
- 178
frappe/translations/et.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/fa.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/fi.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 210
- 195
frappe/translations/fr.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/gu.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/he.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/hi.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/hr.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/hu.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/id.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/it.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 177
frappe/translations/ja.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 190
- 175
frappe/translations/km.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/kn.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/ko.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/lv.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/mk.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/ml.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/mr.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/ms.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/my.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 193
- 178
frappe/translations/nl.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/no.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 192
- 177
frappe/translations/pl.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/pt-BR.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/pt.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/ro.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/ru.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/sk.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 192
- 177
frappe/translations/sl.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/sq.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/sr.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/sv.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/ta.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/te.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/th.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 195
- 179
frappe/translations/tr.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/uk.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 189
- 175
frappe/translations/ur.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/vi.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 191
- 176
frappe/translations/zh-cn.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 226
- 211
frappe/translations/zh-tw.csv
File diff suppressed because it is too large
Näytä tiedosto


+ 1
- 1
setup.py Näytä tiedosto

@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
from pip.req import parse_requirements

version = "6.27.2"
version = "6.27.3"
requirements = parse_requirements("requirements.txt", session="")

setup(


Ladataan…
Peruuta
Tallenna