Point of Sale Tax Type Error

Traceback (most recent call last):
File “/Volumes/Data/Workspace/Python/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 55, in application
response = frappe.handler.handle()
File “/Volumes/Data/Workspace/Python/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 20, in handle
data = execute_cmd(cmd)
File “/Volumes/Data/Workspace/Python/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 55, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/Volumes/Data/Workspace/Python/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1021, in call
return fn(*args, **newargs)
File “/Volumes/Data/Workspace/Python/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/pos.py”, line 55, in get_pos_data
‘tax_data’: get_item_tax_data(),
File “/Volumes/Data/Workspace/Python/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/pos.py”, line 310, in get_item_tax_data
taxes = frappe.db.sql(“”" select parent, tax_type, tax_rate from tabItem Tax"“”, as_dict=1)
File “/Volumes/Data/Workspace/Python/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 166, in sql
self._cursor.execute(query)
File “/Volumes/Data/Workspace/Python/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/cursors.py”, line 170, in execute
result = self._query(query)
File “/Volumes/Data/Workspace/Python/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/cursors.py”, line 328, in _query
conn.query(q)
File “/Volumes/Data/Workspace/Python/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py”, line 517, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “/Volumes/Data/Workspace/Python/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py”, line 732, in _read_query_result
result.read()
File “/Volumes/Data/Workspace/Python/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py”, line 1075, in read
first_packet = self.connection._read_packet()
File “/Volumes/Data/Workspace/Python/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py”, line 684, in _read_packet
packet.check_error()
File “/Volumes/Data/Workspace/Python/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/protocol.py”, line 220, in check_error
err.raise_mysql_exception(self._data)
File “/Volumes/Data/Workspace/Python/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/err.py”, line 109, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.InternalError: (1054, “Unknown column ‘tax_type’ in ‘field list’”)

Any one have the idea why I am facing tax type issue. its kind of urgent. I am stuck in point of sale error

Hi and welcome!

I checked to confirm tax_type is in both v10 and v11 for eg

frappe@ubuntu:~/frappe-bench$ bench mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 109580
Server version: 10.2.13-MariaDB-10.2.13+maria~xenial-log mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [d56cb677eaab3383]> desc `tabItem Tax`;
+-------------+---------------+------+-----+----------+-------+
| Field       | Type          | Null | Key | Default  | Extra |
+-------------+---------------+------+-----+----------+-------+
| name        | varchar(140)  | NO   | PRI | NULL     |       |
| creation    | datetime(6)   | YES  |     | NULL     |       |
| modified    | datetime(6)   | YES  |     | NULL     |       |
| modified_by | varchar(140)  | YES  |     | NULL     |       |
| owner       | varchar(140)  | YES  |     | NULL     |       |
| docstatus   | int(1)        | NO   |     | 0        |       |
| parent      | varchar(140)  | YES  | MUL | NULL     |       |
| parentfield | varchar(140)  | YES  |     | NULL     |       |
| parenttype  | varchar(140)  | YES  |     | NULL     |       |
| idx         | int(8)        | NO   |     | 0        |       |
| tax_type    | varchar(140)  | YES  |     | NULL     |       |
| tax_rate    | decimal(18,6) | NO   |     | 0.000000 |       |
+-------------+---------------+------+-----+----------+-------+
12 rows in set (0.00 sec)

Maybe restart the database, clear the caches or try Python 3.6 as that is supported.

What version erpnext and you are on MacOS?

Using Python 3.6 on MacOS 10.13.6. Ok let me try to restart the database.

Your stacktrace refers to 3.7?

@nayabraheel

ALTER TABLE tabItem Tax
ADD COLUMN tax_type VARCHAR(140) AFTER idx;

ALTER TABLE tabItem Tax
ADD COLUMN tax_rate VARCHAR(140) AFTER tax_type;

There is no such a column in my new installation.

MariaDB [_7f9f4ce860d7d369]> desc tabItem Tax;
±------------------±-------------±-----±----±--------±------+
| Field | Type | Null | Key | Default | Extra |
±------------------±-------------±-----±----±--------±------+
| name | varchar(140) | NO | PRI | NULL | |
| creation | datetime(6) | YES | | NULL | |
| modified | datetime(6) | YES | MUL | NULL | |
| modified_by | varchar(140) | YES | | NULL | |
| owner | varchar(140) | YES | | NULL | |
| docstatus | int(1) | NO | | 0 | |
| parent | varchar(140) | YES | MUL | NULL | |
| parentfield | varchar(140) | YES | | NULL | |
| parenttype | varchar(140) | YES | | NULL | |
| idx | int(8) | NO | | 0 | |
| item_tax_template | varchar(140) | YES | | NULL | |
| tax_category | varchar(140) | YES | | NULL | |
±------------------±-------------±-----±----±--------±------+
12 rows in set (0.002 sec)