fix: Indentation and removed f-strings

- Sider: fixed indentation in js
- Dont use f-strings in queries
This commit is contained in:
marination 2021-08-30 12:50:24 +05:30
parent 2a3ef03388
commit 7b78473da3
3 changed files with 62 additions and 61 deletions

View File

@ -104,7 +104,7 @@ class Supplier(TransactionBase):
def on_trash(self): def on_trash(self):
if self.supplier_primary_contact: if self.supplier_primary_contact:
frappe.db.sql(f""" frappe.db.sql("""
UPDATE `tabSupplier` UPDATE `tabSupplier`
SET SET
supplier_primary_contact=null, supplier_primary_contact=null,
@ -112,7 +112,7 @@ class Supplier(TransactionBase):
mobile_no=null, mobile_no=null,
email_id=null, email_id=null,
primary_address=null primary_address=null
WHERE name='{self.name}'""") WHERE name=%(name)s""", {"name": self.name})
delete_contact_and_address('Supplier', self.name) delete_contact_and_address('Supplier', self.name)

View File

@ -13,63 +13,64 @@ frappe.ui.form.SupplierQuickEntryForm = class SupplierQuickEntryForm extends fra
get_variant_fields() { get_variant_fields() {
var variant_fields = [ var variant_fields = [
{ {
fieldtype: "Section Break", fieldtype: "Section Break",
label: __("Primary Contact Details"), label: __("Primary Contact Details"),
collapsible: 1 collapsible: 1
}, },
{ {
label: __("Email Id"), label: __("Email Id"),
fieldname: "email_id", fieldname: "email_id",
fieldtype: "Data" fieldtype: "Data"
}, },
{ {
fieldtype: "Column Break" fieldtype: "Column Break"
}, },
{ {
label: __("Mobile Number"), label: __("Mobile Number"),
fieldname: "mobile_no", fieldname: "mobile_no",
fieldtype: "Data" fieldtype: "Data"
}, },
{ {
fieldtype: "Section Break", fieldtype: "Section Break",
label: __("Primary Address Details"), label: __("Primary Address Details"),
collapsible: 1 collapsible: 1
}, },
{ {
label: __("Address Line 1"), label: __("Address Line 1"),
fieldname: "address_line1", fieldname: "address_line1",
fieldtype: "Data" fieldtype: "Data"
}, },
{ {
label: __("Address Line 2"), label: __("Address Line 2"),
fieldname: "address_line2", fieldname: "address_line2",
fieldtype: "Data" fieldtype: "Data"
}, },
{ {
label: __("ZIP Code"), label: __("ZIP Code"),
fieldname: "pincode", fieldname: "pincode",
fieldtype: "Data" fieldtype: "Data"
}, },
{ {
fieldtype: "Column Break" fieldtype: "Column Break"
}, },
{ {
label: __("City"), label: __("City"),
fieldname: "city", fieldname: "city",
fieldtype: "Data" fieldtype: "Data"
}, },
{ {
label: __("State"), label: __("State"),
fieldname: "state", fieldname: "state",
fieldtype: "Data" fieldtype: "Data"
}, },
{ {
label: __("Country"), label: __("Country"),
fieldname: "country", fieldname: "country",
fieldtype: "Link", fieldtype: "Link",
options: "Country" options: "Country"
}]; }
];
return variant_fields; return variant_fields;
} }

View File

@ -252,7 +252,7 @@ class Customer(TransactionBase):
def on_trash(self): def on_trash(self):
if self.customer_primary_contact: if self.customer_primary_contact:
frappe.db.sql(f""" frappe.db.sql("""
UPDATE `tabCustomer` UPDATE `tabCustomer`
SET SET
customer_primary_contact=null, customer_primary_contact=null,
@ -260,7 +260,7 @@ class Customer(TransactionBase):
mobile_no=null, mobile_no=null,
email_id=null, email_id=null,
primary_address=null primary_address=null
WHERE name='{self.name}'""") WHERE name=%(name)s""", {"name": self.name})
delete_contact_and_address('Customer', self.name) delete_contact_and_address('Customer', self.name)
if self.lead_name: if self.lead_name: