mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-31 10:52:41 +02:00
fix: internal transfer entry with serial/batch
(cherry picked from commit 9b4e62a758)
This commit is contained in:
committed by
Mergify
parent
f5af5dd8c0
commit
d67a439051
@@ -2411,6 +2411,9 @@ def make_inter_company_transaction(doctype, source_name, target_doc=None):
|
|||||||
target.purchase_order = source.purchase_order
|
target.purchase_order = source.purchase_order
|
||||||
target.po_detail = source.purchase_order_item
|
target.po_detail = source.purchase_order_item
|
||||||
|
|
||||||
|
if (source.get("serial_no") or source.get("batch_no")) and not source.get("serial_and_batch_bundle"):
|
||||||
|
target.use_serial_batch_fields = 1
|
||||||
|
|
||||||
item_field_map = {
|
item_field_map = {
|
||||||
"doctype": target_doctype + " Item",
|
"doctype": target_doctype + " Item",
|
||||||
"field_no_map": ["income_account", "expense_account", "cost_center", "warehouse"],
|
"field_no_map": ["income_account", "expense_account", "cost_center", "warehouse"],
|
||||||
|
|||||||
@@ -253,6 +253,14 @@ class StockController(AccountsController):
|
|||||||
"do_not_submit": True if not via_landed_cost_voucher else False,
|
"do_not_submit": True if not via_landed_cost_voucher else False,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if self.is_internal_transfer() and row.get("from_warehouse") and not self.is_return:
|
||||||
|
self.update_bundle_details(bundle_details, table_name, row)
|
||||||
|
bundle_details["type_of_transaction"] = "Outward"
|
||||||
|
bundle_details["warehouse"] = row.get("from_warehouse")
|
||||||
|
bundle_details["qty"] = row.get("stock_qty") or row.get("qty")
|
||||||
|
self.create_serial_batch_bundle(bundle_details, row)
|
||||||
|
continue
|
||||||
|
|
||||||
if row.get("qty") or row.get("consumed_qty") or row.get("stock_qty"):
|
if row.get("qty") or row.get("consumed_qty") or row.get("stock_qty"):
|
||||||
self.update_bundle_details(bundle_details, table_name, row, parent_details=parent_details)
|
self.update_bundle_details(bundle_details, table_name, row, parent_details=parent_details)
|
||||||
self.create_serial_batch_bundle(bundle_details, row)
|
self.create_serial_batch_bundle(bundle_details, row)
|
||||||
|
|||||||
@@ -1310,6 +1310,9 @@ def make_inter_company_transaction(doctype, source_name, target_doc=None):
|
|||||||
if source.get("use_serial_batch_fields"):
|
if source.get("use_serial_batch_fields"):
|
||||||
target.set("use_serial_batch_fields", 1)
|
target.set("use_serial_batch_fields", 1)
|
||||||
|
|
||||||
|
if (source.get("serial_no") or source.get("batch_no")) and not source.get("serial_and_batch_bundle"):
|
||||||
|
target.set("use_serial_batch_fields", 1)
|
||||||
|
|
||||||
doclist = get_mapped_doc(
|
doclist = get_mapped_doc(
|
||||||
doctype,
|
doctype,
|
||||||
source_name,
|
source_name,
|
||||||
|
|||||||
Reference in New Issue
Block a user