mirror of
https://github.com/erpnext/foundation.git
synced 2026-10-16 18:00:47 +02:00
[fix] rename jobs page to erpnext-job to avoid conflict with erpnext's job application
This commit is contained in:
@@ -290,7 +290,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2017-03-06 16:04:54.620681",
|
||||
"modified": "2017-03-22 15:30:54.620681",
|
||||
"modified_by": "Administrator",
|
||||
"module": "ERPNext Foundation",
|
||||
"name": "Portal Job",
|
||||
@@ -321,7 +321,7 @@
|
||||
"quick_entry": 1,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"route": "/jobs",
|
||||
"route": "/erpnext-jobs",
|
||||
"show_name_in_global_search": 0,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
|
||||
@@ -10,16 +10,16 @@ import foundation
|
||||
class PortalJob(WebsiteGenerator):
|
||||
def get_context(self, context):
|
||||
context.parents = [dict(label='View All Jobs',
|
||||
route='jobs')]
|
||||
route='erpnext-jobs')]
|
||||
context.is_member = foundation.is_member()
|
||||
|
||||
def validate(self):
|
||||
if not self.route:
|
||||
self.route = 'jobs/' + self.scrub(self.title)
|
||||
self.route = 'erpnext-jobs/' + self.scrub(self.title)
|
||||
|
||||
def get_list_context(context):
|
||||
context.allow_guest = True
|
||||
context.title = 'ERPNext Jobs'
|
||||
context.no_breadcrumbs = True
|
||||
context.order_by = 'creation desc'
|
||||
context.introduction = '<div>Jobs for ERPNext Service Providers</div><br><button class="button green-btn">Post A Job</button>'
|
||||
context.introduction = '<div>Jobs for ERPNext Service Providers</div><br><a class="green-btn" href="/my-jobs?new=1">Post A Job</a>'
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
"route": "my-jobs",
|
||||
"show_sidebar": 1,
|
||||
"sidebar_items": [],
|
||||
"success_url": "/jobs",
|
||||
"success_url": "/erpnext-jobs",
|
||||
"title": "Jobs",
|
||||
"web_form_fields": [
|
||||
{
|
||||
|
||||
@@ -53,7 +53,7 @@ website_context = {
|
||||
]},
|
||||
{"label": "Community", "child_items": [
|
||||
{"label": "Service Providers", "url": "/service-providers"},
|
||||
{"label": "Jobs", "url": "/jobs"},
|
||||
{"label": "Jobs", "url": "/erpnext-jobs"},
|
||||
{"label": "Apps", "url": "/apps"},
|
||||
{"label": "Events", "url": "/events"}
|
||||
]},
|
||||
@@ -69,7 +69,6 @@ website_context = {
|
||||
"hide_login": 1,
|
||||
"favicon": "/assets/frappe_theme/img/favicon.ico"
|
||||
}
|
||||
|
||||
# website user home page (by Role)
|
||||
# role_home_page = {
|
||||
# "Role": "home_page"
|
||||
|
||||
@@ -10,7 +10,7 @@ def migrate():
|
||||
|
||||
users = source.sql('select * from tabUser', as_dict=1)
|
||||
for u in users:
|
||||
if validate_email_add(u.email.strip()):
|
||||
if validate_email_add(u.email.strip()) and not frappe.db.exists("User", u.email):
|
||||
frappe.get_doc(dict(
|
||||
doctype='User',
|
||||
name=u.name,
|
||||
@@ -23,10 +23,11 @@ def migrate():
|
||||
print "sync auth"
|
||||
auth = source.sql('select * from __Auth where name != "Administrator"', as_dict=1)
|
||||
for user in auth:
|
||||
frappe.db.sql("""insert into __Auth
|
||||
(doctype, name, fieldname, password, salt, encrypted)
|
||||
values (%s, %s, %s, %s, %s, %s)""",
|
||||
(user.doctype, user.name, user.fieldname, user.password, user.salt, user.encrypted), debug=1)
|
||||
if not frappe.db.sql("select doctype from __Auth where name = %s", user.name):
|
||||
frappe.db.sql("""insert into __Auth
|
||||
(doctype, name, fieldname, password, salt, encrypted)
|
||||
values (%s, %s, %s, %s, %s, %s)""",
|
||||
(user.doctype, user.name, user.fieldname, user.password, user.salt, user.encrypted))
|
||||
print user.name
|
||||
|
||||
frappe.db.sql('delete from `tabService Provider`')
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
foundation.patches.v0_0.update_erpnext_job_route
|
||||
0
foundation/patches/__init__.py
Normal file
0
foundation/patches/__init__.py
Normal file
0
foundation/patches/v0_0/__init__.py
Normal file
0
foundation/patches/v0_0/__init__.py
Normal file
7
foundation/patches/v0_0/update_erpnext_job_route.py
Normal file
7
foundation/patches/v0_0/update_erpnext_job_route.py
Normal file
@@ -0,0 +1,7 @@
|
||||
import frappe
|
||||
|
||||
def execute():
|
||||
for job in frappe.get_all("Portal Job"):
|
||||
print job.name
|
||||
frappe.db.set_value("Portal Job", job.name, "route", "erpnext-job/{0}".format(job.name.encode('utf-8')),
|
||||
update_modified=False)
|
||||
Reference in New Issue
Block a user