Skip to content

Commit 184fa88

Browse files
mihir-kandoimergify[bot]
authored andcommitted
fix: allow creation of DN in SI for items not having DN reference
(cherry picked from commit b691de0) # Conflicts: # erpnext/accounts/doctype/sales_invoice/sales_invoice.js # erpnext/accounts/doctype/sales_invoice/sales_invoice.py
1 parent 8847e1c commit 184fa88

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

erpnext/accounts/doctype/sales_invoice/sales_invoice.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends (
111111
}
112112

113113
if (cint(doc.update_stock) != 1) {
114+
<<<<<<< HEAD
114115
// show Make Delivery Note button only if Sales Invoice is not created from Delivery Note
115116
var from_delivery_note = false;
116117
from_delivery_note = cur_frm.doc.items.some(function (item) {
@@ -121,6 +122,12 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends (
121122
cur_frm.add_custom_button(
122123
__("Delivery"),
123124
cur_frm.cscript["Make Delivery Note"],
125+
=======
126+
if (!is_delivered_by_supplier) {
127+
this.frm.add_custom_button(
128+
__("Delivery Note"),
129+
this.frm.cscript["Make Delivery Note"],
130+
>>>>>>> b691de0147 (fix: allow creation of DN in SI for items not having DN reference)
124131
__("Create")
125132
);
126133
}

erpnext/accounts/doctype/sales_invoice/sales_invoice.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2211,7 +2211,13 @@ def update_item(source_doc, target_doc, source_parent):
22112211
"cost_center": "cost_center",
22122212
},
22132213
"postprocess": update_item,
2214+
<<<<<<< HEAD
22142215
"condition": lambda doc: doc.delivered_by_supplier != 1,
2216+
=======
2217+
"condition": lambda doc: doc.delivered_by_supplier != 1
2218+
and not doc.scio_detail
2219+
and not doc.dn_detail,
2220+
>>>>>>> b691de0147 (fix: allow creation of DN in SI for items not having DN reference)
22152221
},
22162222
"Sales Taxes and Charges": {"doctype": "Sales Taxes and Charges", "reset_value": True},
22172223
"Sales Team": {

0 commit comments

Comments
 (0)