From 9f91053201ad1e95a5bd6d48c30956078a2a7605 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 26 Mar 2013 12:25:11 +0530 Subject: [PATCH] patch to set user type as System User if user has a role and if previous user type is Partner --- patches/march_2013/p09_unset_user_type_partner.py | 6 ++++++ patches/patch_list.py | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 patches/march_2013/p09_unset_user_type_partner.py diff --git a/patches/march_2013/p09_unset_user_type_partner.py b/patches/march_2013/p09_unset_user_type_partner.py new file mode 100644 index 0000000000..cc5cdce5c2 --- /dev/null +++ b/patches/march_2013/p09_unset_user_type_partner.py @@ -0,0 +1,6 @@ +import webnotes + +def execute(): + webnotes.conn.sql("""update `tabProfile` set user_type='System User' + where user_type='Partner' and exists (select name from `tabUserRole` + where parent=`tabProfile`.name)""") \ No newline at end of file diff --git a/patches/patch_list.py b/patches/patch_list.py index 00dd5da200..0c5427b52b 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -217,5 +217,6 @@ patch_list = [ "execute:webnotes.bean('Global Defaults').save()", "patches.march_2013.p07_update_project_in_stock_ledger", "execute:webnotes.bean('Style Settings').save() #2013-03-25", - "execute:webnotes.conn.set_value('Email Settings', None, 'send_print_in_body_and_attachment', 1)" + "execute:webnotes.conn.set_value('Email Settings', None, 'send_print_in_body_and_attachment', 1)", + "patches.march_2013.p09_unset_user_type_partner", ] \ No newline at end of file