Show website route for generator via set_intro, fix in Support Email Settings
This commit is contained in:
parent
82029be6f9
commit
7656377f3f
@ -9,10 +9,9 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
|||||||
frappe.set_route("Sales Browser", "Item Group");
|
frappe.set_route("Sales Browser", "Item Group");
|
||||||
}, "icon-sitemap")
|
}, "icon-sitemap")
|
||||||
|
|
||||||
if(!doc.__islocal && doc.show_in_website) {
|
if (!doc.__islocal && doc.show_in_website) {
|
||||||
cur_frm.appframe.add_button("View In Website", function() {
|
cur_frm.set_intro(__("Published on website at: {0}",
|
||||||
window.open(doc.__onload.website_route);
|
[repl('<a href="/%(website_route)s" target="_blank">/%(website_route)s</a>', doc.__onload)]));
|
||||||
}, "icon-globe");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,14 +21,6 @@
|
|||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"search_index": 0
|
"search_index": 0
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"fieldname": "page_name",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"in_list_view": 1,
|
|
||||||
"label": "Page Name",
|
|
||||||
"permlevel": 0,
|
|
||||||
"read_only": 1
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"fieldname": "cb0",
|
"fieldname": "cb0",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
@ -79,6 +71,15 @@
|
|||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"search_index": 0
|
"search_index": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"depends_on": "show_in_website",
|
||||||
|
"fieldname": "page_name",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"in_list_view": 0,
|
||||||
|
"label": "Page Name",
|
||||||
|
"permlevel": 0,
|
||||||
|
"read_only": 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"depends_on": "show_in_website",
|
"depends_on": "show_in_website",
|
||||||
"fieldname": "parent_website_route",
|
"fieldname": "parent_website_route",
|
||||||
@ -162,7 +163,7 @@
|
|||||||
"in_create": 1,
|
"in_create": 1,
|
||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"max_attachments": 3,
|
"max_attachments": 3,
|
||||||
"modified": "2014-05-27 03:49:12.086044",
|
"modified": "2014-06-10 05:37:03.763185",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Setup",
|
"module": "Setup",
|
||||||
"name": "Item Group",
|
"name": "Item Group",
|
||||||
|
@ -16,11 +16,6 @@ cur_frm.cscript.refresh = function(doc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(!doc.__islocal && doc.show_in_website) {
|
|
||||||
cur_frm.appframe.add_button("View In Website", function() {
|
|
||||||
window.open(doc.__onload.website_route);
|
|
||||||
}, "icon-globe");
|
|
||||||
}
|
|
||||||
cur_frm.cscript.edit_prices_button();
|
cur_frm.cscript.edit_prices_button();
|
||||||
|
|
||||||
if (!doc.__islocal && doc.is_stock_item == 'Yes') {
|
if (!doc.__islocal && doc.is_stock_item == 'Yes') {
|
||||||
@ -28,6 +23,11 @@ cur_frm.cscript.refresh = function(doc) {
|
|||||||
(doc.__onload && doc.__onload.sle_exists=="exists") ? false : true);
|
(doc.__onload && doc.__onload.sle_exists=="exists") ? false : true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!doc.__islocal && doc.show_in_website) {
|
||||||
|
cur_frm.set_intro(__("Published on website at: {0}",
|
||||||
|
[repl('<a href="/%(website_route)s" target="_blank">/%(website_route)s</a>', doc.__onload)]));
|
||||||
|
}
|
||||||
|
|
||||||
erpnext.item.toggle_reqd(cur_frm);
|
erpnext.item.toggle_reqd(cur_frm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ class WarehouseNotSet(frappe.ValidationError): pass
|
|||||||
|
|
||||||
class Item(WebsiteGenerator):
|
class Item(WebsiteGenerator):
|
||||||
def onload(self):
|
def onload(self):
|
||||||
|
super(Item, self).onload()
|
||||||
self.get("__onload").sle_exists = self.check_if_sle_exists()
|
self.get("__onload").sle_exists = self.check_if_sle_exists()
|
||||||
|
|
||||||
def autoname(self):
|
def autoname(self):
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
from frappe import _
|
from frappe import _
|
||||||
|
from frappe.utils import cint
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
from frappe.utils.email_lib.receive import POP3Mailbox
|
from frappe.utils.email_lib.receive import POP3Mailbox
|
||||||
import _socket, poplib
|
import _socket, poplib
|
||||||
@ -16,7 +17,7 @@ class SupportEmailSettings(Document):
|
|||||||
"""
|
"""
|
||||||
Checks support ticket email settings
|
Checks support ticket email settings
|
||||||
"""
|
"""
|
||||||
if self.sync_support_mails and self.mail_server:
|
if cint(self.sync_support_mails) and self.mail_server and not frappe.local.flags.in_patch:
|
||||||
inc_email = frappe._dict(self.as_dict())
|
inc_email = frappe._dict(self.as_dict())
|
||||||
# inc_email.encode()
|
# inc_email.encode()
|
||||||
inc_email.host = self.mail_server
|
inc_email.host = self.mail_server
|
||||||
|
Loading…
Reference in New Issue
Block a user