Unable to track back issue

image

how to find error while creating sales invoice from delivery note

also error log with {{baseurl is removed }} {{documentnuber is removed}}

please suggest document to change or trackback doctype
Traceback with variables (most recent call last):
File “apps/frappe/frappe/app.py”, line 114, in application
response = frappe.api.handle(request)
request = <Request ‘https://{{baseurl}}/api/method/frappe.model.mapper.make_mapped_doc’ [POST]>
response = None
rollback = True
e = OperationalError(1054, “Unknown column ‘delivery_document_no’ in ‘WHERE’”)
File “apps/frappe/frappe/api/init.py”, line 49, in handle
data = endpoint(**arguments)
request = <Request ‘{{baseurl}}/api/method/frappe.model.mapper.make_mapped_doc’ [POST]>
endpoint = <function handle_rpc_call at 0x7f0485ac3c40>
arguments = {‘method’: ‘frappe.model.mapper.make_mapped_doc’}
File “apps/frappe/frappe/api/v1.py”, line 36, in handle_rpc_call
return frappe.handler.handle()
method = ‘frappe.model.mapper.make_mapped_doc’
frappe = <module ‘frappe’ from ‘apps/frappe/frappe/init.py’>
File “apps/frappe/frappe/handler.py”, line 49, in handle
data = execute_cmd(cmd)
cmd = ‘frappe.model.mapper.make_mapped_doc’
data = None
File “apps/frappe/frappe/handler.py”, line 85, in execute_cmd
return frappe.call(method, **frappe.form_dict)
cmd = ‘frappe.model.mapper.make_mapped_doc’
from_async = False
server_script = None
method = <function make_mapped_doc at 0x7f0483a59300>
File “apps/frappe/frappe/init.py”, line 1775, in call
return fn(*args, **newargs)
fn = <function make_mapped_doc at 0x7f0483a59300>
args = ()
kwargs = {‘method’: ‘erpnext.stock.doctype.delivery_note.delivery_note.make_sales_invoice’, ‘source_name’: ‘{docnumber}’, ‘args’: ‘’, ‘selected_children’: ‘{}’, ‘cmd’: ‘frappe.model.mapper.make_mapped_doc’}
newargs = {‘method’: ‘erpnext.stock.doctype.delivery_note.delivery_note.make_sales_invoice’, ‘source_name’: ‘{docnumber}’, ‘args’: ‘’, ‘selected_children’: ‘{}’}
File “apps/frappe/frappe/utils/typing_validations.py”, line 31, in wrapper
return func(*args, **kwargs)
args = ()
kwargs = {‘method’: ‘erpnext.stock.doctype.delivery_note.delivery_note.make_sales_invoice’, ‘source_name’: ‘{docnumber}’, ‘args’: ‘’, ‘selected_children’: ‘{}’}
apply_condition = <function whitelist..innerfn.. at 0x7f0483a59260>
func = <function make_mapped_doc at 0x7f0483a591c0>
File “apps/frappe/frappe/model/mapper.py”, line 36, in make_mapped_doc
return method(source_name)
method = <function make_sales_invoice at 0x7f048329c360>
source_name = ‘{docnumber}’
selected_children = {}
args = ‘’
File “apps/frappe/frappe/utils/typing_validations.py”, line 31, in wrapper
return func(*args, **kwargs)
args = (‘{docnumber}’,)
kwargs = {}
apply_condition = <function whitelist..innerfn.. at 0x7f048329c2c0>
func = <function make_sales_invoice at 0x7f048329c220>
File “apps/erpnext/erpnext/stock/doctype/delivery_note/delivery_note.py”, line 1007, in make_sales_invoice
doc = get_mapped_doc(
source_name = ‘{docnumber}’
target_doc = None
args = None
set_missing_values = <function make_sales_invoice..set_missing_values at 0x7f04800d3240>
update_item = <function make_sales_invoice..update_item at 0x7f04800fb240>
doc = <DeliveryNote: {docnumber} docstatus=1>
get_pending_qty = <function make_sales_invoice..get_pending_qty at 0x7f04800f8c20>
invoiced_qty_map = {‘gv8er8vq0d’: 1.0}
returned_qty_map = {}
to_make_invoice_qty_map = {‘gbqikkh348’: 4.0, ‘gbqi46udqp’: 1.0}
File “apps/frappe/frappe/model/mapper.py”, line 152, in get_mapped_doc
map_child_doc(source_d, target_doc, table_map, source_doc)
from_doctype = ‘Delivery Note’
from_docname = ‘{docnumber}’
table_maps = {‘Delivery Note’: {‘doctype’: ‘Sales Invoice’, ‘field_map’: {‘is_return’: ‘is_return’}, ‘validation’: {‘docstatus’: [‘=’, 1]}}, ‘Delivery Note Item’: {‘doctype’: ‘Sales Invoice Item’, ‘field_map’: {‘name’: ‘dn_detail’, ‘parent’: ‘delivery_note’, ‘so_detail’: ‘so_detail’, ‘against_sales_order’: ‘sales_order’, ‘serial_no’: ‘serial_no’, ‘cost_center’: ‘cost_center’}, ‘postprocess’: <function make_sales_invoice..update_item at 0x7f04800fb240>, ‘filter’: <function make_sales_invoice.. at 0x7f04800f85e0>}, ‘Sales Taxes and Charges’: {‘doctype’: ‘Sales Taxes and Charges’, ‘reset_value’: True, ‘ignore’: 0}, ‘Sales Team’: {‘doctype’: ‘Sales Team’, ‘field_map’: {‘incentives’: ‘incentives’}, ‘add_if_empty’: True}}
target_doc = <SalesInvoice: unsaved>
postprocess = <function make_sales_invoice..set_missing_values at 0x7f04800d3240>
ignore_permissions = False
ignore_child_tables = False
cached = False
apply_strict_user_permissions = 0
source_doc = <DeliveryNote: {docnumber} docstatus=1>
row_exists_for_parentfield = {‘items’: False}
df = <TableDocField: items parent=Delivery Note>
source_child_doctype = ‘Delivery Note Item’
table_map = {‘doctype’: ‘Sales Invoice Item’, ‘field_map’: {‘name’: ‘dn_detail’, ‘parent’: ‘delivery_note’, ‘so_detail’: ‘so_detail’, ‘against_sales_order’: ‘sales_order’, ‘serial_no’: ‘serial_no’, ‘cost_center’: ‘cost_center’}, ‘postprocess’: <function make_sales_invoice..update_item at 0x7f04800fb240>, ‘filter’: <function make_sales_invoice.. at 0x7f04800f85e0>}
target_child_doctype = ‘Sales Invoice Item’
target_parentfield = ‘items’
source_d = <DeliveryNoteItem: gbqi46udqp docstatus=1 parent={docnumber}>
File “apps/frappe/frappe/model/mapper.py”, line 268, in map_child_doc
map_doc(source_d, target_d, table_map, source_parent)
source_d = <DeliveryNoteItem: gbqi46udqp docstatus=1 parent={docnumber}>
target_parent = <SalesInvoice: unsaved>
table_map = {‘doctype’: ‘Sales Invoice Item’, ‘field_map’: {‘name’: ‘dn_detail’, ‘parent’: ‘delivery_note’, ‘so_detail’: ‘so_detail’, ‘against_sales_order’: ‘sales_order’, ‘serial_no’: ‘serial_no’, ‘cost_center’: ‘cost_center’}, ‘postprocess’: <function make_sales_invoice..update_item at 0x7f04800fb240>, ‘filter’: <function make_sales_invoice.. at 0x7f04800f85e0>}
source_parent = <DeliveryNote: {docnumber} docstatus=1>
target_child_doctype = ‘Sales Invoice Item’
target_parentfield = ‘items’
target_d = <SalesInvoiceItem: unsaved>
File “apps/frappe/frappe/model/mapper.py”, line 177, in map_doc
table_map[“postprocess”](source_doc, target_doc, source_parent)
source_doc = <DeliveryNoteItem: gbqi46udqp docstatus=1 parent={docnumber}>
target_doc = <SalesInvoiceItem: unsaved>
table_map = {‘doctype’: ‘Sales Invoice Item’, ‘field_map’: {‘name’: ‘dn_detail’, ‘parent’: ‘delivery_note’, ‘so_detail’: ‘so_detail’, ‘against_sales_order’: ‘sales_order’, ‘serial_no’: ‘serial_no’, ‘cost_center’: ‘cost_center’}, ‘postprocess’: <function make_sales_invoice..update_item at 0x7f04800fb240>, ‘filter’: <function make_sales_invoice.. at 0x7f04800f85e0>}
source_parent = <DeliveryNote: {docnumber} docstatus=1>
File “apps/erpnext/erpnext/stock/doctype/delivery_note/delivery_note.py”, line 983, in update_item
target_doc.serial_no = get_delivery_note_serial_no(
source_doc = <DeliveryNoteItem: gbqi46udqp docstatus=1 parent={docnumber}>
target_doc = <SalesInvoiceItem: unsaved>
source_parent = <DeliveryNote: {docnumber} docstatus=1>
to_make_invoice_qty_map = {‘gbqikkh348’: 4.0, ‘gbqi46udqp’: 1.0}
File “apps/erpnext/erpnext/stock/doctype/serial_no/serial_no.py”, line 174, in get_delivery_note_serial_no
dn_serial_nos = frappe.db.sql_list(
item_code = ‘RM01467’
qty = 1.0
delivery_note = ‘{docnumber}’
serial_nos = ‘’
File “apps/frappe/frappe/database/database.py”, line 404, in sql_list
return self.sql(query, values, *kwargs, debug=debug, pluck=True)
self = <frappe.database.mariadb.database.MariaDBDatabase object at 0x7f0481132d90>
query = ’ select name from tabSerial No\n\t\twhere item_code = %(item_code)s and delivery_document_no = %(delivery_note)s\n\t\tand sales_invoice is null limit 1’
values = {‘item_code’: ‘RM01467’, ‘delivery_note’: ‘{docnumber}’}
debug = False
kwargs = {}
File “apps/frappe/frappe/database/database.py”, line 227, in sql
self._cursor.execute(query, values)
self = <frappe.database.mariadb.database.MariaDBDatabase object at 0x7f0481132d90>
query = 'select name from tabSerial No\n\t\twhere item_code = %(item_code)s and delivery_document_no = %(delivery_note)s\n\t\tand sales_invoice is null limit 1 /
FRAPPE_TRACE_ID: 867b496d-bb5e-4559-8911-5e8a503a3f4c /’
values = {‘item_code’: ‘RM01467’, ‘delivery_note’: ‘{docnumber}’}
as_dict = 0
as_list = 0
debug = False
ignore_ddl = 0
auto_commit = 0
update = None
explain = False
run = True
pluck = True
as_iterator = False
trace_id = ‘867b496d-bb5e-4559-8911-5e8a503a3f4c’
File “env/lib/python3.11/site-packages/pymysql/cursors.py”, line 153, in execute
result = self._query(query)
self = <pymysql.cursors.Cursor object at 0x7f04804bc310>
query = "select name from tabSerial No\n\t\twhere item_code = ‘RM01467’ and delivery_document_no = ‘{docnumber}’\n\t\tand sales_invoice is null limit 1 /
FRAPPE_TRACE_ID: 867b496d-bb5e-4559-8911-5e8a503a3f4c /"
args = {‘item_code’: ‘RM01467’, ‘delivery_note’: ‘{docnumber}’}
File “env/lib/python3.11/site-packages/pymysql/cursors.py”, line 322, in _query
conn.query(q)
self = <pymysql.cursors.Cursor object at 0x7f04804bc310>
q = "select name from tabSerial No\n\t\twhere item_code = ‘RM01467’ and delivery_document_no = ‘{docnumber}’\n\t\tand sales_invoice is null limit 1 /
FRAPPE_TRACE_ID: 867b496d-bb5e-4559-8911-5e8a503a3f4c /"
conn = <pymysql.connections.Connection object at 0x7f047fc0d690>
File “env/lib/python3.11/site-packages/pymysql/connections.py”, line 563, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
self = <pymysql.connections.Connection object at 0x7f047fc0d690>
sql = b"select name from tabSerial No\n\t\twhere item_code = ‘RM01467’ and delivery_document_no = ‘{docnumber}’\n\t\tand sales_invoice is null limit 1 /
FRAPPE_TRACE_ID: 867b496d-bb5e-4559-8911-5e8a503a3f4c */"
unbuffered = False
File “env/lib/python3.11/site-packages/pymysql/connections.py”, line 825, in _read_query_result
result.read()
self = <pymysql.connections.Connection object at 0x7f047fc0d690>
unbuffered = False
result = <pymysql.connections.MySQLResult object at 0x7f0480499850>
File “env/lib/python3.11/site-packages/pymysql/connections.py”, line 1199, in read
first_packet = self.connection._read_packet()
self = <pymysql.connections.MySQLResult object at 0x7f0480499850>
File “env/lib/python3.11/site-packages/pymysql/connections.py”, line 775, in _read_packet
packet.raise_for_error()
self = <pymysql.connections.Connection object at 0x7f047fc0d690>
packet_type = <class ‘pymysql.protocol.MysqlPacket’>
buff = bytearray(b"\xff\x1e\x04#42S22Unknown column 'delivery_document_no' in 'WHERE'“)
packet_header = b’9\x00\x00\x01’
btrl = 57
btrh = 0
packet_number = 1
bytes_to_read = 57
recv_data = b”\xff\x1e\x04#42S22Unknown column ‘delivery_document_no’ in ‘WHERE’"
packet = <pymysql.protocol.MysqlPacket object at 0x7f04801c0a00>
File “env/lib/python3.11/site-packages/pymysql/protocol.py”, line 219, in raise_for_error
err.raise_mysql_exception(self._data)
self = <pymysql.protocol.MysqlPacket object at 0x7f04801c0a00>
errno = 1054
File “env/lib/python3.11/site-packages/pymysql/err.py”, line 150, in raise_mysql_exception
raise errorclass(errno, errval)
data = b"\xff\x1e\x04#42S22Unknown column ‘delivery_document_no’ in ‘WHERE’"
errno = 1054
errval = “Unknown column ‘delivery_document_no’ in ‘WHERE’”
errorclass = <class ‘pymysql.err.OperationalError’>
pymysql.err.OperationalError: (1054, “Unknown column ‘delivery_document_no’ in ‘WHERE’”)