fix: allow creation of DN in SI for items not having DN reference

(cherry picked from commit b691de0147)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.js
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.py
This commit is contained in:
Mihir Kandoi
2026-01-20 15:08:37 +05:30
committed by Mergify
parent 8847e1c2bd
commit 184fa889c3
2 changed files with 13 additions and 0 deletions

View File

@@ -111,6 +111,7 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends (
}
if (cint(doc.update_stock) != 1) {
<<<<<<< HEAD
// show Make Delivery Note button only if Sales Invoice is not created from Delivery Note
var from_delivery_note = false;
from_delivery_note = cur_frm.doc.items.some(function (item) {
@@ -121,6 +122,12 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends (
cur_frm.add_custom_button(
__("Delivery"),
cur_frm.cscript["Make Delivery Note"],
=======
if (!is_delivered_by_supplier) {
this.frm.add_custom_button(
__("Delivery Note"),
this.frm.cscript["Make Delivery Note"],
>>>>>>> b691de0147 (fix: allow creation of DN in SI for items not having DN reference)
__("Create")
);
}

View File

@@ -2211,7 +2211,13 @@ def make_delivery_note(source_name, target_doc=None):
"cost_center": "cost_center",
},
"postprocess": update_item,
<<<<<<< HEAD
"condition": lambda doc: doc.delivered_by_supplier != 1,
=======
"condition": lambda doc: doc.delivered_by_supplier != 1
and not doc.scio_detail
and not doc.dn_detail,
>>>>>>> b691de0147 (fix: allow creation of DN in SI for items not having DN reference)
},
"Sales Taxes and Charges": {"doctype": "Sales Taxes and Charges", "reset_value": True},
"Sales Team": {