diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 9711c4637bc..217c42c1a14 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -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") ); } diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 9e15f8701bb..38641f00574 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -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": {