From 689da20e7b87f980c9930d5ec21703f746d2c0d2 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 24 May 2017 17:31:58 +0530 Subject: [PATCH] Revert "View Attachments in portal (#8830)" This reverts commit 7e661437b1abb52b2a3595bb8bb52cb1a7b6249e. --- .../shopping_cart_settings.json | 75 +------------------ .../shopping_cart_settings.py | 4 - erpnext/templates/pages/order.html | 20 +---- erpnext/templates/pages/order.py | 8 -- 4 files changed, 2 insertions(+), 105 deletions(-) diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.json b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.json index ed782ad1cf..c5efdf8578 100644 --- a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.json +++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.json @@ -13,7 +13,6 @@ "editable_grid": 0, "fields": [ { - "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -42,67 +41,6 @@ "unique": 0 }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break_2", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "description": "Attachments can be shown without enabling the shopping cart", - "fieldname": "show_attachments", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Show Public Attachments", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -130,7 +68,6 @@ "unique": 0 }, { - "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -160,7 +97,6 @@ "unique": 0 }, { - "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -192,7 +128,6 @@ "unique": 0 }, { - "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -222,7 +157,6 @@ "unique": 0 }, { - "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -250,7 +184,6 @@ "unique": 0 }, { - "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -281,7 +214,6 @@ "unique": 0 }, { - "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -310,7 +242,6 @@ "unique": 0 }, { - "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 1, @@ -341,7 +272,6 @@ "unique": 0 }, { - "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -371,7 +301,6 @@ "unique": 0 }, { - "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -404,7 +333,6 @@ "unique": 0 }, { - "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -433,7 +361,6 @@ "unique": 0 }, { - "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -475,7 +402,7 @@ "issingle": 1, "istable": 0, "max_attachments": 0, - "modified": "2017-05-19 09:31:38.078110", + "modified": "2017-03-21 15:42:08.574497", "modified_by": "Administrator", "module": "Shopping Cart", "name": "Shopping Cart Settings", diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py index aa4f16360d..4e24d2e6ee 100644 --- a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py +++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py @@ -89,7 +89,3 @@ def check_shopping_cart_enabled(): if not get_shopping_cart_settings().enabled: frappe.throw(_("You need to enable Shopping Cart"), ShoppingCartSetupError) -def show_attachments(): - return get_shopping_cart_settings().show_attachments - - diff --git a/erpnext/templates/pages/order.html b/erpnext/templates/pages/order.html index da9eb33c89..71291783b0 100644 --- a/erpnext/templates/pages/order.html +++ b/erpnext/templates/pages/order.html @@ -86,24 +86,6 @@ {% endif %} {% endif %} - -{% if attachments %} -
-
-
- {{ _("Attachments") }} -
-
-
-
- {% for attachment in attachments %} -

- {{ attachment.file_name }} -

- {% endfor %} -
-
-
-{% endif %} + {% endblock %} diff --git a/erpnext/templates/pages/order.py b/erpnext/templates/pages/order.py index b453c7e3e7..296b907282 100644 --- a/erpnext/templates/pages/order.py +++ b/erpnext/templates/pages/order.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals import frappe from frappe import _ -from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import show_attachments def get_context(context): context.no_cache = 1 @@ -14,9 +13,6 @@ def get_context(context): if hasattr(context.doc, "set_indicator"): context.doc.set_indicator() - if show_attachments(): - context.attachments = get_attachments(frappe.form_dict.doctype, frappe.form_dict.name) - context.parents = frappe.form_dict.parents context.payment_ref = frappe.db.get_value("Payment Request", {"reference_name": frappe.form_dict.name}, "name") @@ -25,7 +21,3 @@ def get_context(context): if not frappe.has_website_permission(context.doc): frappe.throw(_("Not Permitted"), frappe.PermissionError) - -def get_attachments(dt, dn): - return frappe.get_all("File", fields=["name", "file_name", "file_url", "is_private"], - filters = {"attached_to_name": dn, "attached_to_doctype": dt, "is_private":0})