Moved Notification Count hooks to frappe, employee user id patch, Item ignore restriction fields

This commit is contained in:
Anand Doshi 2014-03-05 15:24:29 +05:30
parent 0c4ef64b32
commit 74d0e40bdc
4 changed files with 26 additions and 5 deletions

View File

@ -29,10 +29,6 @@ bean_event:*:on_update = erpnext.home.update_feed
bean_event:*:on_submit = erpnext.home.update_feed
bean_event:Comment:on_update = erpnext.home.make_comment_feed
bean_event:*:on_update = frappe.core.doctype.notification_count.notification_count.clear_doctype_notifications
bean_event:*:on_cancel = frappe.core.doctype.notification_count.notification_count.clear_doctype_notifications
bean_event:*:on_trash = frappe.core.doctype.notification_count.notification_count.clear_doctype_notifications
bean_event:Stock Entry:on_submit = erpnext.stock.doctype.material_request.material_request.update_completed_qty
bean_event:Stock Entry:on_cancel = erpnext.stock.doctype.material_request.material_request.update_completed_qty

View File

@ -26,3 +26,4 @@ erpnext.patches.4_0.customer_discount_to_pricing_rule
execute:frappe.db.sql("""delete from `tabWebsite Item Group` where ifnull(item_group, '')=''""")
erpnext.patches.4_0.remove_module_home_pages
erpnext.patches.4_0.split_email_settings
erpnext.patches.4_0.fix_employee_user_id

View File

@ -0,0 +1,13 @@
import frappe
from frappe.utils import get_fullname
def execute():
for user_id in frappe.db.sql_list("""select distinct user_id from `tabEmployee`
where ifnull(user_id, '')!=''
group by user_id having count(name) > 1"""):
fullname = get_fullname(user_id)
employee = frappe.db.get_value("Employee", {"employee_name": fullname, "user_id": user_id})
if employee:
frappe.db.sql("""update `tabEmployee` set user_id=null
where user_id=%s and name!=%s""", (user_id, employee))

View File

@ -2,7 +2,7 @@
{
"creation": "2013-05-03 10:45:46",
"docstatus": 0,
"modified": "2014-02-20 18:27:02",
"modified": "2014-03-05 15:20:59",
"modified_by": "Administrator",
"owner": "Administrator"
},
@ -111,6 +111,7 @@
"doctype": "DocField",
"fieldname": "stock_uom",
"fieldtype": "Link",
"ignore_restrictions": 1,
"label": "Default Unit of Measure",
"oldfieldname": "stock_uom",
"oldfieldtype": "Link",
@ -217,6 +218,7 @@
"doctype": "DocField",
"fieldname": "default_warehouse",
"fieldtype": "Link",
"ignore_restrictions": 1,
"label": "Default Warehouse",
"oldfieldname": "default_warehouse",
"oldfieldtype": "Link",
@ -349,6 +351,7 @@
"doctype": "DocField",
"fieldname": "weight_uom",
"fieldtype": "Link",
"ignore_restrictions": 1,
"label": "Weight UOM",
"options": "UOM",
"read_only": 0
@ -420,6 +423,7 @@
"doctype": "DocField",
"fieldname": "default_supplier",
"fieldtype": "Link",
"ignore_restrictions": 1,
"label": "Default Supplier",
"options": "Supplier"
},
@ -441,6 +445,7 @@
"doctype": "DocField",
"fieldname": "expense_account",
"fieldtype": "Link",
"ignore_restrictions": 1,
"label": "Default Expense Account",
"oldfieldname": "purchase_account",
"oldfieldtype": "Link",
@ -453,6 +458,7 @@
"doctype": "DocField",
"fieldname": "buying_cost_center",
"fieldtype": "Link",
"ignore_restrictions": 1,
"label": "Default Buying Cost Center",
"oldfieldname": "cost_center",
"oldfieldtype": "Link",
@ -579,6 +585,7 @@
"doctype": "DocField",
"fieldname": "income_account",
"fieldtype": "Link",
"ignore_restrictions": 1,
"label": "Default Income Account",
"options": "Account",
"read_only": 0
@ -588,6 +595,7 @@
"doctype": "DocField",
"fieldname": "selling_cost_center",
"fieldtype": "Link",
"ignore_restrictions": 1,
"label": "Default Selling Cost Center",
"options": "Cost Center",
"read_only": 0
@ -691,6 +699,7 @@
"doctype": "DocField",
"fieldname": "default_bom",
"fieldtype": "Link",
"ignore_restrictions": 1,
"label": "Default BOM",
"no_copy": 1,
"oldfieldname": "default_bom",
@ -802,6 +811,7 @@
"doctype": "DocField",
"fieldname": "website_warehouse",
"fieldtype": "Link",
"ignore_restrictions": 1,
"label": "Website Warehouse",
"options": "Warehouse",
"read_only": 0
@ -852,6 +862,7 @@
"doctype": "DocField",
"fieldname": "parent_website_route",
"fieldtype": "Link",
"ignore_restrictions": 1,
"label": "Parent Website Route",
"options": "Website Route"
},