Closed madappally closed 5 years ago
This is the code that causing problem. File: erpnext/accounts/doctype/sales_invoice/pos.py
def get_item_tax_data():
itemwise_tax = {}
taxes = frappe.db.sql(""" select parent, tax_type, tax_rate from `tabItem Tax`""", as_dict=1)
for tax in taxes:
if tax.parent not in itemwise_tax:
itemwise_tax.setdefault(tax.parent, {})
itemwise_tax[tax.parent][tax.tax_type] = tax.tax_rate
return itemwise_tax
Solved the problem by changing 'tabItem Tax' to 'tabItem Tax Template Detail'.
taxes = frappe.db.sql(""" select parent, tax_type, tax_rate from
tabItem Tax Template Detail""", as_dict=1)
I can’t open POS in offline mode becasue of Unknown Column ‘tax_type’ error (See screenshot)
I’ve checked the database table and confirmed that there no such a column in tabItem Tax;
Here is the result of ‘tabItem Tax’ table 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)
Installation Details: ERPNext: v12.x.x-develop () (develop) Frappe Framework: v12.x.x-develop () (develop) OS: Centos7 Python: 2.7 Database: mysql Ver 15.1 Distrib 10.3.16-MariaDB