fix: Indentation and removed f-strings
- Sider: fixed indentation in js
- Dont use f-strings in queries
diff --git a/erpnext/buying/doctype/supplier/supplier.py b/erpnext/buying/doctype/supplier/supplier.py
index 207485e..c9750ca 100644
--- a/erpnext/buying/doctype/supplier/supplier.py
+++ b/erpnext/buying/doctype/supplier/supplier.py
@@ -104,7 +104,7 @@
def on_trash(self):
if self.supplier_primary_contact:
- frappe.db.sql(f"""
+ frappe.db.sql("""
UPDATE `tabSupplier`
SET
supplier_primary_contact=null,
@@ -112,7 +112,7 @@
mobile_no=null,
email_id=null,
primary_address=null
- WHERE name='{self.name}'""")
+ WHERE name=%(name)s""", {"name": self.name})
delete_contact_and_address('Supplier', self.name)
diff --git a/erpnext/public/js/utils/supplier_quick_entry.js b/erpnext/public/js/utils/supplier_quick_entry.js
index e4a3812..8d591a9 100644
--- a/erpnext/public/js/utils/supplier_quick_entry.js
+++ b/erpnext/public/js/utils/supplier_quick_entry.js
@@ -13,63 +13,64 @@
get_variant_fields() {
var variant_fields = [
- {
- fieldtype: "Section Break",
- label: __("Primary Contact Details"),
- collapsible: 1
- },
- {
- label: __("Email Id"),
- fieldname: "email_id",
- fieldtype: "Data"
- },
- {
- fieldtype: "Column Break"
- },
- {
- label: __("Mobile Number"),
- fieldname: "mobile_no",
- fieldtype: "Data"
- },
- {
- fieldtype: "Section Break",
- label: __("Primary Address Details"),
- collapsible: 1
- },
- {
- label: __("Address Line 1"),
- fieldname: "address_line1",
- fieldtype: "Data"
- },
- {
- label: __("Address Line 2"),
- fieldname: "address_line2",
- fieldtype: "Data"
- },
- {
- label: __("ZIP Code"),
- fieldname: "pincode",
- fieldtype: "Data"
- },
- {
- fieldtype: "Column Break"
- },
- {
- label: __("City"),
- fieldname: "city",
- fieldtype: "Data"
- },
- {
- label: __("State"),
- fieldname: "state",
- fieldtype: "Data"
- },
- {
- label: __("Country"),
- fieldname: "country",
- fieldtype: "Link",
- options: "Country"
- }];
+ {
+ fieldtype: "Section Break",
+ label: __("Primary Contact Details"),
+ collapsible: 1
+ },
+ {
+ label: __("Email Id"),
+ fieldname: "email_id",
+ fieldtype: "Data"
+ },
+ {
+ fieldtype: "Column Break"
+ },
+ {
+ label: __("Mobile Number"),
+ fieldname: "mobile_no",
+ fieldtype: "Data"
+ },
+ {
+ fieldtype: "Section Break",
+ label: __("Primary Address Details"),
+ collapsible: 1
+ },
+ {
+ label: __("Address Line 1"),
+ fieldname: "address_line1",
+ fieldtype: "Data"
+ },
+ {
+ label: __("Address Line 2"),
+ fieldname: "address_line2",
+ fieldtype: "Data"
+ },
+ {
+ label: __("ZIP Code"),
+ fieldname: "pincode",
+ fieldtype: "Data"
+ },
+ {
+ fieldtype: "Column Break"
+ },
+ {
+ label: __("City"),
+ fieldname: "city",
+ fieldtype: "Data"
+ },
+ {
+ label: __("State"),
+ fieldname: "state",
+ fieldtype: "Data"
+ },
+ {
+ label: __("Country"),
+ fieldname: "country",
+ fieldtype: "Link",
+ options: "Country"
+ }
+ ];
return variant_fields;
}
diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py
index 05cabcb..1164f40 100644
--- a/erpnext/selling/doctype/customer/customer.py
+++ b/erpnext/selling/doctype/customer/customer.py
@@ -252,7 +252,7 @@
def on_trash(self):
if self.customer_primary_contact:
- frappe.db.sql(f"""
+ frappe.db.sql("""
UPDATE `tabCustomer`
SET
customer_primary_contact=null,
@@ -260,7 +260,7 @@
mobile_no=null,
email_id=null,
primary_address=null
- WHERE name='{self.name}'""")
+ WHERE name=%(name)s""", {"name": self.name})
delete_contact_and_address('Customer', self.name)
if self.lead_name: