Browse Source

customer/supplier name fix

develop
Ravi Dey 14 years ago
parent
commit
bb4b9bfa15
  1. 3
      crm/doctype/customer/customer.py
  2. 3
      srm/doctype/supplier/supplier.py
  3. 2
      tools/doctype/address/address.py
  4. 2
      tools/doctype/contact/contact.py

3
crm/doctype/customer/customer.py

@ -25,7 +25,8 @@ class DocType:
if cust_master_name == 'Customer Name':
# filter out bad characters in name
cust = self.doc.customer_name.replace('&','and').replace('.','').replace("'",'').replace('"','').replace(',','').replace('`','')
#cust = self.doc.customer_name.replace('&','and').replace('.','').replace("'",'').replace('"','').replace(',','').replace('`','')
cust = self.doc.customer_name
supp = sql("select name from `tabSupplier` where name = %s", (cust))
supp = supp and supp[0][0] or ''

3
srm/doctype/supplier/supplier.py

@ -29,7 +29,8 @@ class DocType:
if supp_master_name == 'Supplier Name':
# filter out bad characters in name
supp = self.doc.supplier_name.replace('&','and').replace('.','').replace("'",'').replace('"','').replace(',','').replace('`','')
#supp = self.doc.supplier_name.replace('&','and').replace('.','').replace("'",'').replace('"','').replace(',','').replace('`','')
supp = self.doc.supplier_name
cust = sql("select name from `tabCustomer` where name = '%s'" % (supp))
cust = cust and cust[0][0] or ''

2
tools/doctype/address/address.py

@ -22,7 +22,7 @@ class DocType:
self.doc.name = self.doc.sales_partner + '-' + self.doc.address_type
# filter out bad characters in name
self.doc.name = self.doc.name.replace('&','and').replace('.','').replace("'",'').replace('"','').replace(',','').replace('`','')
#self.doc.name = self.doc.name.replace('&','and').replace('.','').replace("'",'').replace('"','').replace(',','').replace('`','')
#----------------------
# Call to Validate

2
tools/doctype/contact/contact.py

@ -22,7 +22,7 @@ class DocType:
self.doc.name = self.doc.first_name + (self.doc.last_name and ' ' + self.doc.last_name or '') + '-' + self.doc.sales_partner
# filter out bad characters in name
self.doc.name = self.doc.name.replace('&','and').replace('.','').replace("'",'').replace('"','').replace(',','')
#self.doc.name = self.doc.name.replace('&','and').replace('.','').replace("'",'').replace('"','').replace(',','')
#----------------------
# Call to Validate

Loading…
Cancel
Save