From b0fd0b36159d4404b2970083ba540eb4a4c1291c Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 13 Feb 2012 11:34:36 +0530 Subject: [PATCH 1/3] Edited through patch --- .../customer_address_contact.txt | 32 ++++---- .../Delivery Note-Packing Slip.txt | 76 +++++++++---------- 2 files changed, 54 insertions(+), 54 deletions(-) diff --git a/erpnext/selling/search_criteria/customer_address_contact/customer_address_contact.txt b/erpnext/selling/search_criteria/customer_address_contact/customer_address_contact.txt index 9e0a7155bc..99890b78a8 100644 --- a/erpnext/selling/search_criteria/customer_address_contact/customer_address_contact.txt +++ b/erpnext/selling/search_criteria/customer_address_contact/customer_address_contact.txt @@ -3,34 +3,34 @@ # These values are common in all dictionaries { - 'creation': '2012-01-23 18:28:40', + 'creation': '2012-02-13 11:28:45', 'docstatus': 0, - 'modified': '2012-01-23 18:28:40', - 'modified_by': 'Administrator', - 'owner': 'Administrator' + 'modified': '2012-02-13 11:28:45', + 'modified_by': u'Administrator', + 'owner': u'Administrator' }, # These values are common for all Search Criteria { - 'add_col': "`tabAddress`.address_line1 AS 'Address Line 1'\n`tabAddress`.address_line2 AS 'Address Line 2'\n`tabAddress`.city AS 'City'\n`tabAddress`.state AS 'State'\n`tabAddress`.pincode AS 'Pincode'\n`tabAddress`.country AS 'Country'\n`tabContact`.first_name AS 'Contact First Name'\n`tabContact`.last_name AS 'Contact Last Name'\n`tabContact`.phone AS 'Contact Phone'\n`tabContact`.mobile_no AS 'Contact Mobile'\n`tabContact`.email_id AS 'Contact Email'", - 'add_cond': '`tabAddress`.customer=`tabCustomer`.name\nifnull(`tabAddress`.is_primary_address, 0)=1\n`tabContact`.customer=`tabCustomer`.name\nifnull(`tabContact`.is_primary_contact, 0)=1', - 'add_tab': '`tabAddress`\n`tabContact`', - 'columns': 'Customer\x01ID,Customer\x01Customer Name', - 'criteria_name': 'Customer Address Contact', - 'doc_type': 'Customer', + 'add_col': u"`tabAddress`.address_line1 AS 'Address Line 1'\n`tabAddress`.address_line2 AS 'Address Line 2'\n`tabAddress`.city AS 'City'\n`tabAddress`.state AS 'State'\n`tabAddress`.pincode AS 'Pincode'\n`tabAddress`.country AS 'Country'\n`tabContact`.first_name AS 'Contact First Name'\n`tabContact`.last_name AS 'Contact Last Name'\n`tabContact`.phone AS 'Contact Phone'\n`tabContact`.mobile_no AS 'Contact Mobile'\n`tabContact`.email_id AS 'Contact Email'", + 'add_cond': u'`tabAddress`.customer=`tabCustomer`.name\nifnull(`tabAddress`.is_primary_address, 0)=1\n`tabContact`.customer=`tabCustomer`.name\nifnull(`tabContact`.is_primary_contact, 0)=1', + 'add_tab': u'`tabAddress`\n`tabContact`', + 'columns': u'Customer\x01ID,Customer\x01Customer Name', + 'criteria_name': u'Customer Address Contact', + 'doc_type': u'Customer', 'doctype': 'Search Criteria', - 'filters': "{'Customer\x01Saved':1,'Customer\x01Submitted':1}", - 'module': 'Selling', + 'filters': u"{'Customer\x01Saved':1,'Customer\x01Submitted':1}", + 'module': u'Selling', 'name': '__common__', 'page_len': 50, - 'sort_by': '`tabCustomer`.`customer_name`', - 'sort_order': 'ASC', - 'standard': 'Yes' + 'sort_by': u'`tabCustomer`.`customer_name`', + 'sort_order': u'ASC', + 'standard': u'Yes' }, # Search Criteria, customer_address_contact { 'doctype': 'Search Criteria', - 'name': 'customer_address_contact' + 'name': u'customer_address_contact' } ] \ No newline at end of file diff --git a/erpnext/stock/DocType Mapper/Delivery Note-Packing Slip/Delivery Note-Packing Slip.txt b/erpnext/stock/DocType Mapper/Delivery Note-Packing Slip/Delivery Note-Packing Slip.txt index 171e08f807..baf2b7465e 100644 --- a/erpnext/stock/DocType Mapper/Delivery Note-Packing Slip/Delivery Note-Packing Slip.txt +++ b/erpnext/stock/DocType Mapper/Delivery Note-Packing Slip/Delivery Note-Packing Slip.txt @@ -3,91 +3,91 @@ # These values are common in all dictionaries { - 'creation': '2012-02-02 11:35:53', + 'creation': '2012-02-13 11:28:48', 'docstatus': 0, - 'modified': '2012-02-02 11:35:53', - 'modified_by': 'Administrator', - 'owner': 'Administrator' + 'modified': '2012-02-13 11:28:48', + 'modified_by': u'Administrator', + 'owner': u'Administrator' }, # These values are common for all Table Mapper Detail { - 'doctype': 'Table Mapper Detail', + 'doctype': u'Table Mapper Detail', 'name': '__common__', - 'parent': 'Delivery Note-Packing Slip', - 'parentfield': 'table_mapper_details', - 'parenttype': 'DocType Mapper' + 'parent': u'Delivery Note-Packing Slip', + 'parentfield': u'table_mapper_details', + 'parenttype': u'DocType Mapper' }, # These values are common for all Field Mapper Detail { - 'doctype': 'Field Mapper Detail', + 'doctype': u'Field Mapper Detail', 'name': '__common__', - 'parent': 'Delivery Note-Packing Slip', - 'parentfield': 'field_mapper_details', - 'parenttype': 'DocType Mapper' + 'parent': u'Delivery Note-Packing Slip', + 'parentfield': u'field_mapper_details', + 'parenttype': u'DocType Mapper' }, # These values are common for all DocType Mapper { 'doctype': u'DocType Mapper', - 'from_doctype': 'Delivery Note', - 'module': 'Stock', + 'from_doctype': u'Delivery Note', + 'module': u'Stock', 'name': '__common__', 'ref_doc_submitted': 1, - 'to_doctype': 'Packing Slip' + 'to_doctype': u'Packing Slip' }, # DocType Mapper, Delivery Note-Packing Slip { 'doctype': u'DocType Mapper', - 'name': 'Delivery Note-Packing Slip' + 'name': u'Delivery Note-Packing Slip' }, # Field Mapper Detail { - 'doctype': 'Field Mapper Detail', - 'from_field': 'name', - 'map': 'Yes', + 'doctype': u'Field Mapper Detail', + 'from_field': u'name', + 'map': u'Yes', 'match_id': 0, - 'to_field': 'delivery_note' + 'to_field': u'delivery_note' }, # Field Mapper Detail { - 'doctype': 'Field Mapper Detail', - 'from_field': 'qty', - 'map': 'No', + 'doctype': u'Field Mapper Detail', + 'from_field': u'qty', + 'map': u'No', 'match_id': 1, - 'to_field': 'qty' + 'to_field': u'qty' }, # Field Mapper Detail { - 'doctype': 'Field Mapper Detail', - 'from_field': 'naming_series', - 'map': 'No', + 'doctype': u'Field Mapper Detail', + 'from_field': u'naming_series', + 'map': u'No', 'match_id': 0, - 'to_field': 'naming_series' + 'to_field': u'naming_series' }, # Table Mapper Detail { - 'doctype': 'Table Mapper Detail', - 'from_table': 'Delivery Note', + 'doctype': u'Table Mapper Detail', + 'from_table': u'Delivery Note', 'match_id': 0, - 'to_table': 'Packing Slip', - 'validation_logic': 'docstatus=1' + 'to_table': u'Packing Slip', + 'validation_logic': u'docstatus=1' }, # Table Mapper Detail { - 'doctype': 'Table Mapper Detail', - 'from_field': 'delivery_note_details', - 'from_table': 'Delivery Note Detail', + 'doctype': u'Table Mapper Detail', + 'from_field': u'delivery_note_details', + 'from_table': u'Delivery Note Detail', 'match_id': 1, - 'to_field': 'item_details', - 'to_table': 'Packing Slip Detail', - 'validation_logic': 'IFNULL(packed_qty, 0) < IFNULL(qty, 0)' + 'to_field': u'item_details', + 'to_table': u'Packing Slip Detail', + 'validation_logic': u'IFNULL(packed_qty, 0) < IFNULL(qty, 0)' } ] \ No newline at end of file From bf0d92e125d9a30e130a85430bcab51fe9df457c Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 13 Feb 2012 12:22:08 +0530 Subject: [PATCH 2/3] deleted and disabled users excluded in applicable to and approver link fields --- .../setup/doctype/authorization_rule/authorization_rule.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/setup/doctype/authorization_rule/authorization_rule.js b/erpnext/setup/doctype/authorization_rule/authorization_rule.js index 54863ec63e..21f0848088 100644 --- a/erpnext/setup/doctype/authorization_rule/authorization_rule.js +++ b/erpnext/setup/doctype/authorization_rule/authorization_rule.js @@ -72,7 +72,7 @@ cur_frm.cscript.transaction = function(doc,cdt,cdn){ // System User Trigger // ------------------- cur_frm.fields_dict['system_user'].get_query = function(doc) { - return 'SELECT tabProfile.name FROM tabProfile WHERE tabProfile.name not in ("Administrator","Guest") AND tabProfile.%(key)s LIKE "%s" LIMIT 50' + return 'SELECT tabProfile.name FROM tabProfile WHERE tabProfile.name not in ("Administrator","Guest") AND tabProfile.docstatus != 2 AND tabProfile.enabled = 1 AND tabProfile.%(key)s LIKE "%s" LIMIT 50' } @@ -86,7 +86,7 @@ cur_frm.fields_dict['system_role'].get_query = function(doc) { // Approving User Trigger // ----------------------- cur_frm.fields_dict['approving_user'].get_query = function(doc) { - return 'SELECT tabProfile.name FROM tabProfile WHERE tabProfile.name not in ("Administrator","Guest") AND tabProfile.%(key)s LIKE "%s" LIMIT 50' + return 'SELECT tabProfile.name FROM tabProfile WHERE tabProfile.name not in ("Administrator","Guest") AND tabProfile.docstatus != 2 AND tabProfile.enabled = 1 AND tabProfile.%(key)s LIKE "%s" LIMIT 50' } @@ -106,4 +106,4 @@ cur_frm.fields_dict['master_name'].get_query = function(doc){ return 'SELECT `tabItem`.`name` FROM `tabItem` WHERE (IFNULL(`tabItem`.`end_of_life`,"") = "" OR `tabItem`.`end_of_life` = "0000-00-00" OR `tabItem`.`end_of_life` > NOW()) and `tabItem`.is_sales_item = "Yes" and tabItem.%(key)s LIKE "%s" ORDER BY `tabItem`.`name` DESC LIMIT 50'; else return 'SELECT `tabItem`.`name` FROM `tabItem` WHERE `tabItem`.`name` = "cheating done to avoid null" ORDER BY `tabItem`.`name` DESC LIMIT 50'; -} \ No newline at end of file +} From 7949b33b70fa082d2c53ceaec25fef118672f4e4 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 13 Feb 2012 12:43:38 +0530 Subject: [PATCH 3/3] Logout session if user deleted --- erpnext/home/page/my_company/my_company.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/home/page/my_company/my_company.py b/erpnext/home/page/my_company/my_company.py index dcd54e1062..2e2aad6324 100644 --- a/erpnext/home/page/my_company/my_company.py +++ b/erpnext/home/page/my_company/my_company.py @@ -47,6 +47,9 @@ def delete_user(args): if cint(webnotes.conn.get_value('Control Panel', None, 'sync_with_gateway')): from server_tools.gateway_utils import remove_user_gateway remove_user_gateway(args['user']) + + webnotes.login_manager.logout(user=args['user']) + # # add user