erpnext icon indicating copy to clipboard operation
erpnext copied to clipboard

Expired Batches cannot be transferred out of the warehouse to inspection warehouse

Open aakvatech opened this issue 2 years ago • 2 comments

Information about bug

When a batch expires and, rightly so, cannot be used for delivery to client.

However, companies don't just issue out expired goods all the time from the final warehouse, but rather transfer them to a separate warehouse for inspection and verification before issue for incineration/destruction.

Current code only allows Material Issue, and Material Transfer should also be allowed, preferable to a designated warehouse (with "Has Expired Goods" flag?).

Module

stock

Version

ERPNext: v14.20.0 (version-14) Frappe Framework: v14.30.0 (version-14)

Installation method

FrappeCloud

Relevant log output / Stack trace / Full Error Message.

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 66, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/api.py", line 54, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 45, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 83, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1607, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/desk/form/save.py", line 26, in savedocs
    doc.save()
  File "apps/frappe/frappe/model/document.py", line 305, in save
    return self._save(*args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 327, in _save
    return self.insert()
  File "apps/frappe/frappe/model/document.py", line 259, in insert
    self.run_before_save_methods()
  File "apps/frappe/frappe/model/document.py", line 1045, in run_before_save_methods
    self.run_method("validate")
  File "apps/frappe/frappe/model/document.py", line 914, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1264, in composer
    return composed(self, method, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1246, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "apps/frappe/frappe/model/document.py", line 911, in fn
    return method_object(*args, **kwargs)
  File "apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py", line 145, in validate
    self.validate_serialized_batch()
  File "apps/erpnext/erpnext/controllers/stock_controller.py", line 111, in validate_serialized_batch
    frappe.throw(
  File "apps/frappe/frappe/__init__.py", line 525, in throw
    msgprint(
  File "apps/frappe/frappe/__init__.py", line 493, in msgprint
    _raise_exception()
  File "apps/frappe/frappe/__init__.py", line 442, in _raise_exception
    raise raise_exception(msg)
erpnext.controllers.stock_controller.BatchExpiredError: Row #1: The batch <a href="https://abcde.frappe.cloud/app/batch/BA:%20302">BA: 302</a> has already expired.

aakvatech avatar Apr 04 '23 04:04 aakvatech

Hello,

Can you share any screenshots or error messages related to the bug?

Regards, Rehan Ansari

rehanrehman389 avatar Apr 05 '23 15:04 rehanrehman389

Same case with me, sometimes the company needs to transfer the expired batches from store to store I suggest add check in stock button to allow transfer expired batchs Screenshot from 2023-09-04 09-52-18

0xhaval avatar Sep 04 '23 06:09 0xhaval