fix: woocommerce settings patch (#17422)

(cherry picked from commit 7df8c0ef82d72920aba342623dc10c5c14b1d8f8)
diff --git a/erpnext/patches/v11_1/woocommerce_set_creation_user.py b/erpnext/patches/v11_1/woocommerce_set_creation_user.py
index e50d5ae..5ccdec6 100644
--- a/erpnext/patches/v11_1/woocommerce_set_creation_user.py
+++ b/erpnext/patches/v11_1/woocommerce_set_creation_user.py
@@ -1,10 +1,11 @@
 from __future__ import unicode_literals
 import frappe
+from frappe.utils import cint
 
 def execute():
-	woocommerce_setting_enable_sync = frappe.db.sql("SELECT t.value FROM tabSingles t WHERE doctype = 'Woocommerce Settings' AND field = 'enable_sync'",  as_dict=True)
-	if len(woocommerce_setting_enable_sync) and woocommerce_setting_enable_sync[0].value == '1':
-		frappe.db.sql("""UPDATE tabSingles
-					SET value = (SELECT t.value FROM tabSingles t WHERE doctype = 'Woocommerce Settings' AND field = 'modified_by')
-					WHERE doctype = 'Woocommerce Settings'
-					AND field = 'creation_user';""")
\ No newline at end of file
+	frappe.reload_doc("erpnext_integrations", "doctype","woocommerce_settings")
+	doc = frappe.get_doc("Woocommerce Settings")
+
+	if cint(doc.enable_sync):
+		doc.creation_user = doc.modified_by
+		doc.save(ignore_permissions=True)
\ No newline at end of file