Plz advise how to fix

Error Report

Python 3.6.9: /home/frappe/frappe-bench/env/bin/python3 (prefix: /home/frappe/frappe-bench/env)

Timestamp:

2020-08-05 04:22:20.935019

Relapsed

15

Exception

args 40,49,48,53,52,44,32,34,85,110,107,110,111,119,110,32,99,111,108,117,109,110,32,39,98,114,97,110,99,104,39,32,105,110,32,39,102,105,101,108,100,32,108,105,115,116,39,34,41
with_traceback 60,98,117,105,108,116,45,105,110,32,109,101,116,104,111,100,32,119,105,116,104,95,116,114,97,99,101,98,97,99,107,32,111,102,32,73,110,116,101,114,110,97,108,69,114,114,111,114,32,111,98,106,101,99,116,62

Locals

data b"\xff\x1e\x04#42S22Unknown column ‘branch’ in ‘field list’"
errno 1054
errorclass
errval Unknown column ‘branch’ in ‘field list’
is_41 True

Traceback

/home/frappe/frappe-bench/apps/frappe/frappe/app.py: 64

62

63 elif frappe.request.path.startswith("/api/"):

64 response = frappe.api.handle()

65

66 elif frappe.request.path.startswith(’/backups’):

Locals

/home/frappe/frappe-bench/apps/frappe/frappe/api.py: 59

57 if call==“method”:

58 frappe.local.form_dict.cmd = doctype

59 return frappe.handler.handle()

60

61 elif call==“resource”:

Locals

/home/frappe/frappe-bench/apps/frappe/frappe/handler.py: 24

22

23 if cmd!=‘login’:

24 data = execute_cmd(cmd)

25

26 # data can be an empty string or list which are valid responses

Locals

/home/frappe/frappe-bench/apps/frappe/frappe/handler.py: 63

61 is_whitelisted(method)

62

63 return frappe.call(method, **frappe.form_dict)

64

65

Locals

/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py: 1054

1052 newargs = get_newargs(fn, kwargs)

1053

1054 return fn(*args, **newargs)

1055

1056 def get_newargs(fn, kwargs):

Locals

/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py: 22

20 else:

21 try:

22 doc.save()

23 except frappe.NameError as e:

24 doctype, name, original_exception = e if isinstance(e, tuple) else (doc.doctype or “”, doc.name or “”, None)

Locals

/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py: 273

271 def save(self, *args, **kwargs):

272 “”“Wrapper for _save”""

273 return self._save(*args, **kwargs)

274

275 def _save(self, ignore_permissions=None, ignore_version=None):

Locals

/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py: 296

294

295 if self.get("__islocal") or not self.get(“name”):

296 self.insert()

297 return

298

Locals

/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py: 252

250 # children

251 for d in self.get_all_children():

252 d.db_insert()

253

254 self.run_method(“after_insert”)

Locals

/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py: 325

323 columns = “, “.join([”"+c+"” for c in columns]),

324 values = “, “.join([”%s”] * len(columns))

325 ), list(d.values()))

326 except Exception as e:

327 if frappe.db.is_primary_key_violation(e):

Locals

/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py: 156

154 frappe.log(values)

155 frappe.log(">>>>")

156 self._cursor.execute(query, values)

157

158 if frappe.flags.in_migrate:

Locals

/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/cursors.py: 170

168 query = self.mogrify(query, args)

169

170 result = self._query(query)

171 self._executed = query

172 return result

Locals

/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/cursors.py: 328

326 self._last_executed = q

327 self._clear_result()

328 conn.query(q)

329 self._do_get_result()

330 return self.rowcount

Locals

/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py: 517

515 sql = sql.encode(self.encoding, ‘surrogateescape’)

516 self._execute_command(COMMAND.COM_QUERY, sql)

517 self._affected_rows = self._read_query_result(unbuffered=unbuffered)

518 return self._affected_rows

519

Locals

/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py: 732

730 else:

731 result = MySQLResult(self)

732 result.read()

733 self._result = result

734 if result.server_status is not None:

Locals

/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py: 1075

1073 def read(self):

1074 try:

1075 first_packet = self.connection._read_packet()

1076

1077 if first_packet.is_ok_packet():

Locals

/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py: 684

682

683 packet = packet_type(buff, self.encoding)

684 packet.check_error()

685 return packet

686

Locals

/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/protocol.py: 220

218 errno = self.read_uint16()

219 if DEBUG: print(“errno =”, errno)

220 err.raise_mysql_exception(self._data)

221

222 def dump(self):

Locals

/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/err.py: 109

105 errval = data[9:].decode(‘utf-8’, ‘replace’)

106 else:

107 errval = data[3:].decode(‘utf-8’, ‘replace’)

108 errorclass = error_map.get(errno, InternalError)

109 raise errorclass(errno, errval)

It may help to say what command produced the error, and if this is a new installation of ERPNext or one that has been customized .

I am getting this error in “Delivery Note” since i added an accounting dimension based on branch doctype from HR module.

Any help would be really appreciated.