mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-18 00:55:02 +00:00
fix: allow creation of DN in SI for items not having DN reference
(cherry picked from commit b691de0147)
This commit is contained in:
@@ -115,15 +115,9 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cint(doc.update_stock) != 1) {
|
if (cint(doc.update_stock) != 1) {
|
||||||
// show Make Delivery Note button only if Sales Invoice is not created from Delivery Note
|
if (!is_delivered_by_supplier) {
|
||||||
var from_delivery_note = false;
|
|
||||||
from_delivery_note = this.frm.doc.items.some(function (item) {
|
|
||||||
return item.delivery_note ? true : false;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!from_delivery_note && !is_delivered_by_supplier) {
|
|
||||||
this.frm.add_custom_button(
|
this.frm.add_custom_button(
|
||||||
__("Delivery"),
|
__("Delivery Note"),
|
||||||
this.frm.cscript["Make Delivery Note"],
|
this.frm.cscript["Make Delivery Note"],
|
||||||
__("Create")
|
__("Create")
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2422,7 +2422,9 @@ def make_delivery_note(source_name, target_doc=None):
|
|||||||
"cost_center": "cost_center",
|
"cost_center": "cost_center",
|
||||||
},
|
},
|
||||||
"postprocess": update_item,
|
"postprocess": update_item,
|
||||||
"condition": lambda doc: doc.delivered_by_supplier != 1 and not doc.scio_detail,
|
"condition": lambda doc: doc.delivered_by_supplier != 1
|
||||||
|
and not doc.scio_detail
|
||||||
|
and not doc.dn_detail,
|
||||||
},
|
},
|
||||||
"Sales Taxes and Charges": {"doctype": "Sales Taxes and Charges", "reset_value": True},
|
"Sales Taxes and Charges": {"doctype": "Sales Taxes and Charges", "reset_value": True},
|
||||||
"Sales Team": {
|
"Sales Team": {
|
||||||
|
|||||||
Reference in New Issue
Block a user