fix: Internal sales item link in Purchase Invoice

This commit is contained in:
Deepesh Garg
2020-12-27 19:45:27 +05:30
parent 9d4bf040e9
commit b7b3944cef
2 changed files with 5 additions and 8 deletions

View File

@@ -1630,15 +1630,12 @@ def make_inter_company_transaction(doctype, source_name, target_doc=None):
}
if source_doc.get('update_stock'):
item_field_map.update({
'field_map': {
source_document_warehouse_field: target_document_warehouse_field,
'batch_no': 'batch_no',
'serial_no': 'serial_no',
}
item_field_map["field_map"].update({
source_document_warehouse_field: target_document_warehouse_field,
'batch_no': 'batch_no',
'serial_no': 'serial_no'
})
doclist = get_mapped_doc(doctype, source_name, {
doctype: {
"doctype": target_doctype,

View File

@@ -229,7 +229,7 @@ class BuyingController(StockController):
if not cint(self.get("is_return")) and d.get("from_warehouse"):
# Get outgoing rate based on original item cost based on valuation method
if not d.get('sales_invoice_item'):
if not d.get(frappe.scrub(ref_doctype)):
outgoing_rate = get_incoming_rate({
"item_code": d.item_code,
"warehouse": d.from_warehouse,