diff --git a/foundation/erpnext_foundation/doctype/service_provider/service_provider.json b/foundation/erpnext_foundation/doctype/service_provider/service_provider.json index 656de1f1..a8328643 100644 --- a/foundation/erpnext_foundation/doctype/service_provider/service_provider.json +++ b/foundation/erpnext_foundation/doctype/service_provider/service_provider.json @@ -1,9 +1,10 @@ { "allow_copy": 0, + "allow_events_in_timeline": 0, "allow_guest_to_view": 1, "allow_import": 0, "allow_rename": 0, - "autoname": "field:title", + "autoname": "", "beta": 0, "creation": "2017-02-24 12:09:23.744409", "custom": 0, @@ -15,6 +16,7 @@ "fields": [ { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -46,6 +48,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -78,6 +81,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -110,6 +114,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -141,6 +146,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -172,6 +178,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -203,6 +210,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -234,6 +242,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -264,6 +273,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -295,6 +305,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -325,6 +336,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -356,6 +368,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -387,6 +400,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -417,6 +431,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -448,6 +463,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -479,6 +495,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -510,6 +527,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -540,7 +558,7 @@ "unique": 0 } ], - "has_web_view": 1, + "has_web_view": 0, "hide_heading": 0, "hide_toolbar": 0, "idx": 0, @@ -552,7 +570,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2018-03-09 17:08:21.803622", + "modified": "2018-10-02 15:12:31.902994", "modified_by": "Administrator", "module": "ERPNext Foundation", "name": "Service Provider", @@ -561,7 +579,6 @@ "permissions": [ { "amend": 0, - "apply_user_permissions": 0, "cancel": 0, "create": 1, "delete": 1, @@ -587,5 +604,6 @@ "sort_field": "modified", "sort_order": "DESC", "track_changes": 1, - "track_seen": 0 + "track_seen": 0, + "track_views": 0 } \ No newline at end of file diff --git a/foundation/erpnext_foundation/doctype/service_provider/service_provider.py b/foundation/erpnext_foundation/doctype/service_provider/service_provider.py index 8d6962a9..912614fd 100644 --- a/foundation/erpnext_foundation/doctype/service_provider/service_provider.py +++ b/foundation/erpnext_foundation/doctype/service_provider/service_provider.py @@ -4,32 +4,12 @@ from __future__ import unicode_literals import frappe -from frappe.website.website_generator import WebsiteGenerator from frappe.utils import get_datetime +from frappe.model.document import Document -class ServiceProvider(WebsiteGenerator): - website = frappe._dict( - condition_field = "show_in_website", - ) - def validate(self): - if not self.route: - self.route = 'service-providers/' + self.scrub(self.name) - - def get_context(self, context): - context.parents = [dict(label='All Service Providers', - route='service-providers', - title='All Service Providers')] - if self.member: - context.membership_type = frappe.get_value('Member', self.member, 'membership_type') - if context.website and not context.website.startswith('http'): - context.website = 'http://' + context.website - if not context.image: - if context.membership_type == "Gold": - context.image = "/assets/foundation/img/gold.png" - elif context.membership_type == "Silver": - context.image = "/assets/foundation/img/silver.png" - else: - context.image = "/assets/foundation/img/default-membership-logo.png" +class ServiceProvider(Document): + def autoname(self): + self.name = self.title def send_alert_to_inactive_service_providers(): for service_provider in frappe.get_all("Service Provider", fields=['email', 'title']): diff --git a/foundation/erpnext_foundation/doctype/service_provider/templates/service_provider.html b/foundation/erpnext_foundation/doctype/service_provider/templates/service_provider.html deleted file mode 100644 index b23ee54d..00000000 --- a/foundation/erpnext_foundation/doctype/service_provider/templates/service_provider.html +++ /dev/null @@ -1,54 +0,0 @@ -{% extends "templates/web.html" %} - -{% block page_content %} -

{{ title }}

-{% if membership_type %} -

{{ membership_type }} Member

-{% endif %} -
-
-
- - - -
-
- {{ introduction }} -
-
-
-
- - - - - - - - - - - - - - - - - - {% if website_url %} - - - - - {% endif %} -
Country{{ country }}
Address{{ (address or '').replace('\n', '
') }}
Phone{{ phone }}
Email - {{ email }}
Website{{ website_url }}
-
-
- {{ details }} -
-
-

Contact {{ title }}

-
-{% endblock %} diff --git a/foundation/erpnext_foundation/doctype/service_provider/templates/service_provider_row.html b/foundation/erpnext_foundation/doctype/service_provider/templates/service_provider_row.html deleted file mode 100644 index 2b999819..00000000 --- a/foundation/erpnext_foundation/doctype/service_provider/templates/service_provider_row.html +++ /dev/null @@ -1,4 +0,0 @@ -
- {{ title }} -
- \ No newline at end of file