Skip to content

Commit

Permalink
fix: merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
sagarvora committed Jul 29, 2022
2 parents 2e8ab7b + 1409f48 commit 2f71fb1
Show file tree
Hide file tree
Showing 17 changed files with 128 additions and 33 deletions.
2 changes: 1 addition & 1 deletion frappe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
# Lazy imports
faker = lazy_import("faker")

__version__ = "13.22.2"
__version__ = "13.36.2"

__title__ = "Frappe Framework"

Expand Down
19 changes: 19 additions & 0 deletions frappe/change_log/v13/v13_24_0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Version 13.24.0 Release Notes

### Features & Enhancements

- feat: add translated search doctypes to hooks ([#16197](https://github.com/frappe/frappe/pull/16197))

### Fixes & Enhancements

- fix(listview): Global filter check ([#16389](https://github.com/frappe/frappe/pull/16389))
- fix: Other user must not able to delete other user's comment except System Manager ([#16018](https://github.com/frappe/frappe/pull/16018))
- fix: Use calendar name as it is ([#16372](https://github.com/frappe/frappe/pull/16372))
- fix: Setting permissions to any role of some doctypes is not working ([#16239](https://github.com/frappe/frappe/pull/16239))
- fix(translation): Set translated text as html to get unescaped output ([#16214](https://github.com/frappe/frappe/pull/16214))
- fix: update translation ([#16406](https://github.com/frappe/frappe/pull/16406))
- perf: limit rows to 1 for get_value and exists (v13 port) ([#16413](https://github.com/frappe/frappe/pull/16413))
- fix: Attach not working on submitted doc ([#16358](https://github.com/frappe/frappe/pull/16358))
- fix: Show traceback if custom app installation fails with exception ([#13858](https://github.com/frappe/frappe/pull/13858))
- fix: show traceback as string instead of bytes ([#16234](https://github.com/frappe/frappe/pull/16234))
- fix: Attach not working on submitted doc (copy #16358) ([#16412](https://github.com/frappe/frappe/pull/16412))
19 changes: 19 additions & 0 deletions frappe/change_log/v13/v13_25_0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Version 13.25.0 Release Notes

### Features & Enhancements

- feat: store reference to leaflet's drawControl ([#16407](https://github.com/frappe/frappe/pull/16407))
- feat(minor): Add Custom Group Search for custom LDAP servers ([#16059](https://github.com/frappe/frappe/pull/16059))
- feat: allow breaking `_()` function call to different lines ([#16409](https://github.com/frappe/frappe/pull/16409))

### Fixes & Enhancements

- fix: Allow empty webhook data ([#16433](https://github.com/frappe/frappe/pull/16433))
- fix: set translatable on show alert ([#16427](https://github.com/frappe/frappe/pull/16427))
- fix: update french translation ([#16444](https://github.com/frappe/frappe/pull/16444))
- fix: update translation ([#16417](https://github.com/frappe/frappe/pull/16417))
- fix: don't update autoname field when using `Document.save` ([#16436](https://github.com/frappe/frappe/pull/16436))
- fix: Fetch only active letter heads for printing ([#16504](https://github.com/frappe/frappe/pull/16504))
- fix: Follow FIFO while inserting global search record ([#16488](https://github.com/frappe/frappe/pull/16488))
- fix: incorrect logic for `parenttype` parameter in `get_all_children` ([#16462](https://github.com/frappe/frappe/pull/16462))
- fix: bad closure on double quote in print.js ([#16420](https://github.com/frappe/frappe/pull/16420))
16 changes: 16 additions & 0 deletions frappe/change_log/v13/v13_26_0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Version 13.26.0 Release Notes

### Features & Enhancements

- feat(minor): use specific email signature via from field ([#16507](https://github.com/frappe/frappe/pull/16507))
- feat: add "After Insert" doctype event to server script ([#16543](https://github.com/frappe/frappe/pull/16543))
- feat: Ignore permlevel for specific fields ([#16590](https://github.com/frappe/frappe/pull/16590))

### Fixes & Enhancements

- fix: use the right filter value when flushing route history ([#16586](https://github.com/frappe/frappe/pull/16586))
- fix(desk): Use Int control for Long Int ([#16572](https://github.com/frappe/frappe/pull/16572))
- fix: stabilize leaflet map ([#16513](https://github.com/frappe/frappe/pull/16513))
- fix: new route syntax for Logs in System Console ([#16554](https://github.com/frappe/frappe/pull/16554))
- fix: update french translation ([#16550](https://github.com/frappe/frappe/pull/16550))
- fix: Show assignments based on allocated todo only ([#16535](https://github.com/frappe/frappe/pull/16535))
13 changes: 11 additions & 2 deletions frappe/desk/doctype/dashboard_chart/dashboard_chart.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
"column_break_2",
"color",
"section_break_10",
"last_synced_on"
"last_synced_on",
"roles"
],
"fields": [
{
Expand Down Expand Up @@ -277,13 +278,20 @@
"fieldtype": "Link",
"label": "Parent Document Type",
"options": "DocType"
},
{
"fieldname": "roles",
"fieldtype": "Table",
"label": "Roles",
"options": "Has Role"
}
],
"links": [],
"modified": "2021-11-09 17:18:11.456145",
"modified": "2022-07-27 11:09:09.203236",
"modified_by": "Administrator",
"module": "Desk",
"name": "Dashboard Chart",
"naming_rule": "By fieldname",
"owner": "Administrator",
"permissions": [
{
Expand Down Expand Up @@ -323,5 +331,6 @@
],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}
7 changes: 6 additions & 1 deletion frappe/desk/doctype/dashboard_chart/dashboard_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from frappe.model.document import Document
from frappe.model.naming import append_number_if_name_exists
from frappe.modules.export_file import export_to_files
from frappe.utils import cint, get_datetime, getdate, now_datetime, nowdate
from frappe.utils import cint, get_datetime, getdate, has_common, now_datetime, nowdate
from frappe.utils.dashboard import cache_source
from frappe.utils.data import format_date
from frappe.utils.dateutils import (
Expand Down Expand Up @@ -90,6 +90,11 @@ def has_permission(doc, ptype, user):
if doc.document_type in allowed_doctypes:
return True

if doc.roles:
allowed = [d.role for d in doc.roles]
if has_common(roles, allowed):
return True

return False


Expand Down
2 changes: 1 addition & 1 deletion frappe/desk/form/document_follow.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def get_version(doctype, doc_name, frequency, user):
timeline = []
filters = get_filters("docname", doc_name, frequency, user)
version = frappe.get_all(
"Version", filters=filters, fields=["ref_doctype", "data", "modified", "modified", "modified_by"]
"Version", filters=filters, fields=["ref_doctype", "data", "modified", "modified_by"]
)
if version:
for v in version:
Expand Down
1 change: 1 addition & 0 deletions frappe/patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -187,4 +187,5 @@ frappe.patches.v13_0.set_first_day_of_the_week
frappe.patches.v13_0.encrypt_2fa_secrets
frappe.patches.v13_0.set_document_expiry_default
frappe.patches.v13_0.reset_corrupt_defaults
frappe.patches.v13_0.payment_gateways_deprecation_warning
frappe.patches.v13_0.set_suspend_email_queue_default
9 changes: 9 additions & 0 deletions frappe/patches/v13_0/payment_gateways_deprecation_warning.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import click


def execute():
click.secho(
"Payment Gateways are moved to a separate app in version 14.\n"
"When upgrading to Frappe version-14, Please install the 'Payments' app to continue using them: https://github.com/frappe/payments",
fg="yellow",
)
5 changes: 4 additions & 1 deletion frappe/printing/doctype/letter_head/letter_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,12 @@ def set_image_as_html(

# To preserve the aspect ratio of the image, apply constraints only on
# the greater dimension and allow the other to scale accordingly
dimension = "width" if width > height else "height"
dimension = "width" if self.get(width) > self.get(height) else "height"
dimension_value = self.get(f"{dimension_prefix}{dimension}")

if not dimension_value:
dimension_value = ""

self.set(
html_field,
f"""<div style="text-align: {self.get(align, "").lower()};">
Expand Down
8 changes: 8 additions & 0 deletions frappe/public/js/frappe/list/base_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ frappe.views.BaseList = class BaseList {
];
}

get_list_view_settings() {
return frappe
.call("frappe.desk.listview.get_list_settings", {
doctype: this.doctype,
})
.then((doc) => (this.list_view_settings = doc.message || {}));
}

setup_fields() {
this.set_fields();
this.build_fields();
Expand Down
15 changes: 6 additions & 9 deletions frappe/public/js/frappe/list/list_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,6 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
return this.get_list_view_settings();
}

get_list_view_settings() {
return frappe
.call("frappe.desk.listview.get_list_settings", {
doctype: this.doctype,
})
.then((doc) => (this.list_view_settings = doc.message || {}));
}

on_sort_change(sort_by, sort_order) {
this.sort_by = sort_by;
this.sort_order = sort_order;
Expand Down Expand Up @@ -1883,7 +1875,12 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
// refresh list view
const page_name = frappe.get_route_str();
const list_view = frappe.views.list_view[page_name];
list_view && list_view.on_update(data);
if (
list_view && list_view.list_view_settings &&
!list_view.list_view_settings.disable_auto_refresh
) {
list_view.on_update(data);
}
}
};

Expand Down
2 changes: 1 addition & 1 deletion frappe/public/js/frappe/ui/filters/filter_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ frappe.ui.FilterGroup = class {
trigger: 'manual',
container: 'body',
placement: 'bottom',
offset: '-100px 0'
offset: '-100px, 0'
});
}

Expand Down
2 changes: 1 addition & 1 deletion frappe/public/js/frappe/ui/group_by/group_by.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ frappe.ui.GroupBy = class {
trigger: 'manual',
container: 'body',
placement: 'bottom',
offset: '-100px 0',
offset: '-100px, 0',
});
}

Expand Down
4 changes: 2 additions & 2 deletions frappe/public/js/frappe/ui/notifications/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class NotificationsView extends BaseNotificationsView {
this.get_notifications_list(this.max_length).then(list => {
this.dropdown_items = list;
this.render_notifications_dropdown();
if (this.settings.seen == 0) {
if (this.settings.seen == 0 && this.dropdown_items.length > 0) {
this.toggle_notification_icon(false);
}
});
Expand Down Expand Up @@ -322,7 +322,7 @@ class NotificationsView extends BaseNotificationsView {

get_notifications_list(limit) {
return frappe.db.get_list('Notification Log', {
fields: ['*'],
fields: ['subject', "type", "document_type", "document_name", "creation", "from_user", "name"],
limit: limit,
order_by: 'creation desc'
});
Expand Down
27 changes: 13 additions & 14 deletions frappe/public/js/frappe/ui/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ frappe.ui.Tree = class {
}

reload_node(node) {
this.load_children(node);
return this.load_children(node);
}

toggle() {
Expand All @@ -150,21 +150,20 @@ frappe.ui.Tree = class {
}

load_children(node, deep=false) {
let lab = node.label, value = node.data.value, is_root = node.is_root;

if(!deep) {
frappe.run_serially([
const value = node.data.value,
is_root = node.is_root;

return deep
? frappe.run_serially([
() => this.get_all_nodes(value, is_root, node.label),
data_list => this.render_children_of_all_nodes(data_list),
() => this.set_selected_node(node),
])
: frappe.run_serially([
() => this.get_nodes(value, is_root),
(data_set) => this.render_node_children(node, data_set),
() => this.set_selected_node(node)
]);
} else {
frappe.run_serially([
() => this.get_all_nodes(value, is_root, lab),
(data_list) => this.render_children_of_all_nodes(data_list),
() => this.set_selected_node(node)
data_set => this.render_node_children(node, data_set),
() => this.set_selected_node(node),
]);
}
}

render_children_of_all_nodes(data_list) {
Expand Down
10 changes: 10 additions & 0 deletions frappe/public/js/frappe/views/reports/report_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ frappe.views.ReportView = class ReportView extends frappe.views.ListView {
this.add_totals_row = this.view_user_settings.add_totals_row || 0;
this.chart_args = this.view_user_settings.chart_args;
}
return this.get_list_view_settings();
}

setup_view() {
Expand Down Expand Up @@ -208,6 +209,9 @@ frappe.views.ReportView = class ReportView extends frappe.views.ListView {
}

render_count() {
if (this.list_view_setting && this.list_view_settings.disable_count) {
return;
}
let $list_count = this.$paging_area.find('.list-count');
if (!$list_count.length) {
$list_count = $('<span>')
Expand Down Expand Up @@ -1530,6 +1534,12 @@ frappe.views.ReportView = class ReportView extends frappe.views.ListView {
});
}

if (frappe.user.has_role("System Manager")) {
if (this.get_view_settings) {
items.push(this.get_view_settings());
}
}

return items.map(i => Object.assign(i, { standard: true }));
}

Expand Down

0 comments on commit 2f71fb1

Please sign in to comment.