mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-18 20:49:19 +00:00
Merge pull request #50075 from frappe/mergify/bp/version-15-hotfix/pr-50065
fix(stock-reconciliation): include inventory dimensions in duplicate validation (backport #50065)
This commit is contained in:
@@ -294,7 +294,7 @@ class SerialandBatchBundle(Document):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
if self.returned_against and self.docstatus == 1:
|
if (self.returned_against or self.voucher_type == "Stock Reconciliation") and self.docstatus == 1:
|
||||||
kwargs["ignore_voucher_detail_no"] = self.voucher_detail_no
|
kwargs["ignore_voucher_detail_no"] = self.voucher_detail_no
|
||||||
|
|
||||||
if self.docstatus == 1:
|
if self.docstatus == 1:
|
||||||
@@ -2677,7 +2677,10 @@ def get_stock_ledgers_for_serial_nos(kwargs):
|
|||||||
else:
|
else:
|
||||||
query = query.where(stock_ledger_entry[field] == kwargs.get(field))
|
query = query.where(stock_ledger_entry[field] == kwargs.get(field))
|
||||||
|
|
||||||
if kwargs.voucher_no:
|
if kwargs.ignore_voucher_detail_no:
|
||||||
|
query = query.where(stock_ledger_entry.voucher_detail_no != kwargs.ignore_voucher_detail_no)
|
||||||
|
|
||||||
|
elif kwargs.voucher_no:
|
||||||
query = query.where(stock_ledger_entry.voucher_no != kwargs.voucher_no)
|
query = query.where(stock_ledger_entry.voucher_no != kwargs.voucher_no)
|
||||||
|
|
||||||
return query.run(as_dict=True)
|
return query.run(as_dict=True)
|
||||||
|
|||||||
@@ -589,6 +589,10 @@ class StockReconciliation(StockController):
|
|||||||
if row.get(field):
|
if row.get(field):
|
||||||
key.append(row.get(field))
|
key.append(row.get(field))
|
||||||
|
|
||||||
|
for dimension in get_inventory_dimensions():
|
||||||
|
if row.get(dimension.get("fieldname")):
|
||||||
|
key.append(row.get(dimension.get("fieldname")))
|
||||||
|
|
||||||
if key in item_warehouse_combinations:
|
if key in item_warehouse_combinations:
|
||||||
self.validation_messages.append(
|
self.validation_messages.append(
|
||||||
_get_msg(row_num, _("Same item and warehouse combination already entered."))
|
_get_msg(row_num, _("Same item and warehouse combination already entered."))
|
||||||
|
|||||||
Reference in New Issue
Block a user