Even in our site, we are not able to submit purchase Orders. We are thrown up with the same mysql syntax error. Attaching the server log here.
Traceback (most recent call last):
File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py", line 19, in savedocs
doc.submit()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 857, in submit
self._submit()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 846, in _submit
self.save()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 259, in save
return self._save(*args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 295, in _save
self.run_before_save_methods()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 890, in run_before_save_methods
self.run_method("validate")
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 781, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1059, in composer
return composed(self, method, *args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1042, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 775, in <lambda>
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/buying/doctype/purchase_order/purchase_order.py", line 37, in validate
super(PurchaseOrder, self).validate()
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/buying_controller.py", line 34, in validate
super(BuyingController, self).validate()
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/stock_controller.py", line 17, in validate
super(StockController, self).validate()
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/accounts_controller.py", line 40, in validate
self.set_missing_values(for_validate=True)
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/buying_controller.py", line 68, in set_missing_values
self.update_if_missing(get_party_details(self.supplier, party_type="Supplier", ignore_permissions=self.flags.ignore_permissions, doctype=self.doctype, company=self.company))
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/party.py", line 33, in get_party_details
company, posting_date, price_list, currency, doctype, ignore_permissions, fetch_payment_terms_template)
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/party.py", line 52, in _get_party_details
out["taxes_and_charges"] = set_taxes(party.name, party_type, posting_date, company, out.customer_group, out.supplier_type)
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/party.py", line 362, in set_taxes
return get_tax_template(posting_date, args)
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/tax_rule/tax_rule.py", line 147, in get_tax_template
where {0}""".format(" and ".join(conditions)), as_dict = True)
File "/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py", line 165, in sql
self._cursor.execute(query)
File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/cursors.py", line 165, in execute
result = self._query(query)
File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/cursors.py", line 321, in _query
conn.query(q)
File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 860, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 1061, in _read_query_result
result.read()
File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 1349, in read
first_packet = self.connection._read_packet()
File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 1018, in _read_packet
packet.check_error()
File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 384, in check_error
err.raise_mysql_exception(self._data)
File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/err.py", line 107, in raise_mysql_exception
raise errorclass(errno, errval)
ProgrammingError: (1064, u"You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'Coimbatore'') and coalesce(tax_type, '') in ('', ''Purchase'') and coalesce(bill' at line 3")
Traceback (most recent call last):
File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 55, in application
response = frappe.handler.handle()
File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 20, in handle
data = execute_cmd(cmd)
File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 55, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1007, in call
return fn(*args, **newargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py", line 19, in savedocs
doc.submit()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 857, in submit
self._submit()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 846, in _submit
self.save()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 259, in save
return self._save(*args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 295, in _save
self.run_before_save_methods()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 890, in run_before_save_methods
self.run_method("validate")
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 781, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1059, in composer
return composed(self, method, *args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1042, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 775, in <lambda>
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/buying/doctype/purchase_order/purchase_order.py", line 37, in validate
super(PurchaseOrder, self).validate()
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/buying_controller.py", line 34, in validate
super(BuyingController, self).validate()
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/stock_controller.py", line 17, in validate
super(StockController, self).validate()
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/accounts_controller.py", line 40, in validate
self.set_missing_values(for_validate=True)
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/buying_controller.py", line 68, in set_missing_values
self.update_if_missing(get_party_details(self.supplier, party_type="Supplier", ignore_permissions=self.flags.ignore_permissions, doctype=self.doctype, company=self.company))
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/party.py", line 33, in get_party_details
company, posting_date, price_list, currency, doctype, ignore_permissions, fetch_payment_terms_template)
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/party.py", line 52, in _get_party_details
out["taxes_and_charges"] = set_taxes(party.name, party_type, posting_date, company, out.customer_group, out.supplier_type)
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/party.py", line 362, in set_taxes
return get_tax_template(posting_date, args)
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/tax_rule/tax_rule.py", line 147, in get_tax_template
where {0}""".format(" and ".join(conditions)), as_dict = True)
File "/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py", line 165, in sql
self._cursor.execute(query)
File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/cursors.py", line 165, in execute
result = self._query(query)
File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/cursors.py", line 321, in _query
conn.query(q)
File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 860, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 1061, in _read_query_result
result.read()
File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 1349, in read
first_packet = self.connection._read_packet()
File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 1018, in _read_packet
packet.check_error()
File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 384, in check_error
err.raise_mysql_exception(self._data)
File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/err.py", line 107, in raise_mysql_exception
raise errorclass(errno, errval)
ProgrammingError: (1064, u"You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'Coimbatore'') and coalesce(tax_type, '') in ('', ''Purchase'') and coalesce(bill' at line 3")