Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: AD not getting copied from SCO while creating a Material Transfer #32109

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion erpnext/controllers/subcontracting_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import frappe
from frappe import _
from frappe.model.mapper import get_mapped_doc
from frappe.utils import cint, cstr, flt, get_link_to_form

from erpnext.controllers.stock_controller import StockController
Expand Down Expand Up @@ -870,7 +871,17 @@ def add_items_in_ste(
def make_return_stock_entry_for_subcontract(
available_materials, order_doc, rm_details, order_doctype="Subcontracting Order"
):
ste_doc = frappe.new_doc("Stock Entry")
ste_doc = get_mapped_doc(
order_doctype,
order_doc.name,
{
order_doctype: {
"doctype": "Stock Entry",
},
},
ignore_child_tables=True,
)

ste_doc.purpose = "Material Transfer"

if order_doctype == "Purchase Order":
Expand Down