Merge pull request #135 from raghukamath/service-providers

Remove service providers from listing who don't have show in website checked
This commit is contained in:
Faris Ansari
2018-03-09 18:28:26 +05:30
committed by GitHub
8 changed files with 570 additions and 519 deletions

View File

@@ -14,6 +14,7 @@
"engine": "InnoDB",
"fields": [
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -25,7 +26,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 1,
"in_list_view": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Title",
"length": 0,
@@ -40,9 +41,11 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -70,9 +73,11 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -84,7 +89,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Country",
"length": 0,
@@ -100,9 +105,11 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -129,9 +136,11 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -158,14 +167,16 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "website",
"fieldname": "website_url",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -187,9 +198,11 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -216,9 +229,11 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -244,9 +259,11 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -273,9 +290,11 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -301,9 +320,11 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -315,7 +336,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 1,
"in_list_view": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Introduction",
"length": 0,
@@ -330,9 +351,11 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -344,7 +367,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 1,
"in_list_view": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Details",
"length": 0,
@@ -359,9 +382,11 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -387,9 +412,11 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -416,9 +443,11 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -445,9 +474,11 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -474,9 +505,11 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -503,6 +536,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}
],
@@ -518,7 +552,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-03-06 16:04:35.370822",
"modified": "2018-03-09 17:08:21.803622",
"modified_by": "Administrator",
"module": "ERPNext Foundation",
"name": "Service Provider",

View File

@@ -8,7 +8,7 @@ from frappe.website.website_generator import WebsiteGenerator
from frappe.utils import get_datetime
class ServiceProvider(WebsiteGenerator):
_website = frappe._dict(
website = frappe._dict(
condition_field = "show_in_website",
)
def validate(self):
@@ -31,8 +31,6 @@ class ServiceProvider(WebsiteGenerator):
else:
context.image = "/assets/foundation/img/default-membership-logo.png"
def send_alert_to_inactive_service_providers():
for service_provider in frappe.get_all("Service Provider", fields=['email', 'title']):
if get_last_login_diff(service_provider.email) == 80:
@@ -55,7 +53,6 @@ def publish_service_provider():
if get_last_login_diff(service_provider.email) == 0 and service_provider.show_in_website == 0:
frappe.db.set_value('Service Provider', service_provider.name, 'show_in_website', 1, update_modified=False)
def get_last_login_diff(user):
"""
Returns difference between todays date and last login date

View File

@@ -1,2 +1,3 @@
foundation.patches.v0_0.update_erpnext_job_route
foundation.patches.v0_0.change_website_to_website_url
foundation.patches.v0_0.service_providers_website_to_website_url

View File

@@ -0,0 +1,7 @@
import frappe
def execute():
frappe.db.sql('''
update `tabService Provider`
set website_url = website
''')

View File

@@ -349,6 +349,12 @@ a:visited {
background-color: #fff;
min-width: 200px;
transition: all 0.3s ease-out;
margin: 0 1rem;
}
@media screen and (min-width: 500px) {
.list-items {
margin: 0;
}
}
.list-items:hover {
box-shadow: 0 5px 9px 0 rgba(0, 0, 0, 0.05);

View File

@@ -145,6 +145,11 @@ a {
background-color: #fff;
min-width: 200px;
transition: all @transition;
margin: 0 1rem;
@media screen and (min-width: @screen-palm) {
margin: 0;
}
&:hover {
box-shadow: 0 5px 9px 0 rgba(0, 0, 0, 0.05);

View File

@@ -11,6 +11,7 @@ def get_context(context):
route='service-providers', title='All Service Providers')]
filters = dict()
filters['show_in_website'] = 1
if frappe.form_dict.country:
filters['country'] = frappe.form_dict.country