zaviagodev / frappe

MIT License
0 stars 1 forks source link

Issue in Inventory tab in item doctype. #229

Open John-zaviago opened 8 months ago

John-zaviago commented 8 months ago

There is some issue when i try to transfer the stock between one location to another - there is an error showing and unable to move on with the process

Image

Image

`### App Versions

{
    "apps_maintainer": "0.0.1",
    "business_automations": "0.0.1",
    "e_commerce_store": "0.0.1",
    "erpnext": "15.15.0",
    "frappe": "15.12.0",
    "headless_e_commerce": "0.0.1",
    "payments": "0.0.1",
    "test_app": "0.0.1",
    "webshop": "0.0.1"
}

Route

Form/Stock Entry/new-stock-entry-qgevlipuyx

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 110, in application
    response = frappe.api.handle(request)
  File "apps/frappe/frappe/api/__init__.py", line 49, in handle
    data = endpoint(**arguments)
  File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 49, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1684, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
    return func(*args, **kwargs)
  File "apps/frappe/frappe/client.py", line 201, in insert
    return insert_doc(doc).as_dict()
  File "apps/frappe/frappe/client.py", line 517, in insert_doc
    return frappe.get_doc(doc).insert()
  File "apps/frappe/frappe/model/document.py", line 286, in insert
    self.run_before_save_methods()
  File "apps/frappe/frappe/model/document.py", line 1088, in run_before_save_methods
    self.run_method("validate")
  File "apps/frappe/frappe/model/document.py", line 954, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1320, in composer
    return composed(self, method, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1302, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "apps/frappe/frappe/model/document.py", line 951, in fn
    return method_object(*args, **kwargs)
  File "apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py", line 231, in validate
    self.calculate_rate_and_amount()
  File "apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py", line 786, in calculate_rate_and_amount
    self.set_basic_rate(reset_outgoing_rate, raise_error_if_no_rate)
  File "apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py", line 828, in set_basic_rate
    d.basic_rate = get_valuation_rate(
  File "apps/erpnext/erpnext/stock/stock_ledger.py", line 1630, in get_valuation_rate
    if last_valuation_rate := frappe.db.sql(
  File "apps/frappe/frappe/database/database.py", line 235, in sql
    self._cursor.execute(query, values)
  File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 153, in execute
    result = self._query(query)
  File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 322, in _query
    conn.query(q)
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 558, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 822, in _read_query_result
    result.read()
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 1200, in read
    first_packet = self.connection._read_packet()
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 772, in _read_packet
    packet.raise_for_error()
  File "env/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "env/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.OperationalError: (1054, "Unknown column 'posting_datetime' in 'order clause'")

Request Data

{
    "type": "POST",
    "args": {
        "doc": "{\"doctype\":\"Stock Entry\",\"from_warehouse\":\"Work In Progress - Z\",\"to_warehouse\":\"boooboooo - Z\",\"stock_entry_type\":\"Material Receipt\",\"items\":[{\"item_code\":\"apple15\",\"s_warehouse\":\"Work In Progress - Z\",\"t_warehouse\":\"boooboooo - Z\",\"qty\":3,\"conversion_factor\":1,\"transfer_qty\":3}],\"docstatus\":1}"
    },
    "headers": {},
    "error_handlers": {},
    "url": "/api/method/frappe.client.insert",
    "request_id": null
}

Response Data

{
    "exception": "pymysql.err.OperationalError: (1054, \"Unknown column 'posting_datetime' in 'order clause'\")",
    "exc_type": "OperationalError",
    "_exc_source": "erpnext (app)"
}