Merge pull request #1781 from anandpdoshi/hotfix
Reload sales taxes and charges in patch
diff --git a/erpnext/patches/v4_0/update_tax_amount_after_discount.py b/erpnext/patches/v4_0/update_tax_amount_after_discount.py
index 37f082b..e935bc4 100644
--- a/erpnext/patches/v4_0/update_tax_amount_after_discount.py
+++ b/erpnext/patches/v4_0/update_tax_amount_after_discount.py
@@ -5,6 +5,7 @@
import frappe
def execute():
+ frappe.reload_doc("accounts", "doctype", "sales_taxes_and_charges")
docs_with_discount_amount = frappe._dict()
for dt in ["Quotation", "Sales Order", "Delivery Note", "Sales Invoice"]:
records = frappe.db.sql_list("""select name from `tab%s`
diff --git a/erpnext/setup/doctype/item_group/item_group.js b/erpnext/setup/doctype/item_group/item_group.js
index 2aaf558..954f6c5 100644
--- a/erpnext/setup/doctype/item_group/item_group.js
+++ b/erpnext/setup/doctype/item_group/item_group.js
@@ -9,10 +9,9 @@
frappe.set_route("Sales Browser", "Item Group");
}, "icon-sitemap")
- if(!doc.__islocal && doc.show_in_website) {
- cur_frm.appframe.add_button("View In Website", function() {
- window.open(doc.__onload.website_route);
- }, "icon-globe");
+ 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)]));
}
}
diff --git a/erpnext/setup/doctype/item_group/item_group.json b/erpnext/setup/doctype/item_group/item_group.json
index 82f3c03..66e3967 100644
--- a/erpnext/setup/doctype/item_group/item_group.json
+++ b/erpnext/setup/doctype/item_group/item_group.json
@@ -22,14 +22,6 @@
"search_index": 0
},
{
- "fieldname": "page_name",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Page Name",
- "permlevel": 0,
- "read_only": 1
- },
- {
"fieldname": "cb0",
"fieldtype": "Column Break",
"in_list_view": 0,
@@ -81,6 +73,15 @@
},
{
"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",
"fieldname": "parent_website_route",
"fieldtype": "Link",
"label": "Parent Website Page",
@@ -162,7 +163,7 @@
"in_create": 1,
"issingle": 0,
"max_attachments": 3,
- "modified": "2014-05-27 03:49:12.086044",
+ "modified": "2014-06-10 05:37:03.763185",
"modified_by": "Administrator",
"module": "Setup",
"name": "Item Group",
diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js
index 2b499c1..2eeb841 100644
--- a/erpnext/stock/doctype/item/item.js
+++ b/erpnext/stock/doctype/item/item.js
@@ -16,11 +16,6 @@
}
- 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();
if (!doc.__islocal && doc.is_stock_item == 'Yes') {
@@ -28,6 +23,11 @@
(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);
}
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index 6d6db94..f43b531 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -13,6 +13,7 @@
class Item(WebsiteGenerator):
def onload(self):
+ super(Item, self).onload()
self.get("__onload").sle_exists = self.check_if_sle_exists()
def autoname(self):
diff --git a/erpnext/support/doctype/support_email_settings/support_email_settings.py b/erpnext/support/doctype/support_email_settings/support_email_settings.py
index 8763c6d..be88891 100644
--- a/erpnext/support/doctype/support_email_settings/support_email_settings.py
+++ b/erpnext/support/doctype/support_email_settings/support_email_settings.py
@@ -6,6 +6,7 @@
from __future__ import unicode_literals
import frappe
from frappe import _
+from frappe.utils import cint
from frappe.model.document import Document
from frappe.utils.email_lib.receive import POP3Mailbox
import _socket, poplib
@@ -16,7 +17,7 @@
"""
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.encode()
inc_email.host = self.mail_server