mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-29 18:04:46 +00:00
[fix] [minor] serial no status update for material transfer
This commit is contained in:
@@ -343,10 +343,14 @@ class DocType(StockController):
|
||||
def update_stock_ledger(self, is_cancelled=0):
|
||||
self.values = []
|
||||
for d in getlist(self.doclist, 'mtn_details'):
|
||||
if cstr(d.s_warehouse):
|
||||
if cstr(d.s_warehouse) and not is_cancelled:
|
||||
self.add_to_values(d, cstr(d.s_warehouse), -flt(d.transfer_qty), is_cancelled)
|
||||
|
||||
if cstr(d.t_warehouse):
|
||||
self.add_to_values(d, cstr(d.t_warehouse), flt(d.transfer_qty), is_cancelled)
|
||||
|
||||
if cstr(d.s_warehouse) and is_cancelled:
|
||||
self.add_to_values(d, cstr(d.s_warehouse), -flt(d.transfer_qty), is_cancelled)
|
||||
|
||||
get_obj('Stock Ledger', 'Stock Ledger').update_stock(self.values,
|
||||
self.doc.amended_from and 'Yes' or 'No')
|
||||
|
||||
@@ -119,13 +119,14 @@ class DocType(DocListController):
|
||||
|
||||
if self.doc.actual_qty < 0:
|
||||
if sr.doc.warehouse!=self.doc.warehouse:
|
||||
webnotes.throw(_("Warehouse does not belong to Item") + \
|
||||
(": %s (%s)" % (self.doc.item_code, serial_no)), SerialNoWarehouseError)
|
||||
webnotes.throw(_("Serial No") + ": " + serial_no +
|
||||
_(" does not belong to Warehouse") + ": " + self.doc.warehouse,
|
||||
SerialNoWarehouseError)
|
||||
|
||||
if self.doc.voucher_type in ("Delivery Note", "Sales Invoice") \
|
||||
and sr.doc.status != "Available":
|
||||
webnotes.throw(_("Serial No status must be 'Available' to Deliver") + \
|
||||
": " + serial_no, SerialNoStatusError)
|
||||
webnotes.throw(_("Serial No status must be 'Available' to Deliver")
|
||||
+ ": " + serial_no, SerialNoStatusError)
|
||||
|
||||
|
||||
sr.doc.warehouse = None
|
||||
|
||||
Reference in New Issue
Block a user