mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-05 19:42:45 +00:00
Merge branch 'version-13-hotfix' into cst-ux-improvement
This commit is contained in:
@@ -370,7 +370,7 @@ def get_conditions(filters):
|
||||
where parent=`tabSales Invoice`.name
|
||||
and ifnull(`tab{table}`.{field}, '') = %({field})s)"""
|
||||
|
||||
conditions += get_sales_invoice_item_field_condition("mode_of_payments", "Sales Invoice Payment")
|
||||
conditions += get_sales_invoice_item_field_condition("mode_of_payment", "Sales Invoice Payment")
|
||||
conditions += get_sales_invoice_item_field_condition("cost_center")
|
||||
conditions += get_sales_invoice_item_field_condition("warehouse")
|
||||
conditions += get_sales_invoice_item_field_condition("brand")
|
||||
|
||||
@@ -10,6 +10,31 @@ frappe.ui.form.on("Item", {
|
||||
frm.add_fetch('attribute', 'to_range', 'to_range');
|
||||
frm.add_fetch('attribute', 'increment', 'increment');
|
||||
frm.add_fetch('tax_type', 'tax_rate', 'tax_rate');
|
||||
|
||||
frm.make_methods = {
|
||||
'Sales Order': () => {
|
||||
open_form(frm, "Sales Order", "Sales Order Item", "items");
|
||||
},
|
||||
'Delivery Note': () => {
|
||||
open_form(frm, "Delivery Note", "Delivery Note Item", "items");
|
||||
},
|
||||
'Sales Invoice': () => {
|
||||
open_form(frm, "Sales Invoice", "Sales Invoice Item", "items");
|
||||
},
|
||||
'Purchase Order': () => {
|
||||
open_form(frm, "Purchase Order", "Purchase Order Item", "items");
|
||||
},
|
||||
'Purchase Receipt': () => {
|
||||
open_form(frm, "Purchase Receipt", "Purchase Receipt Item", "items");
|
||||
},
|
||||
'Purchase Invoice': () => {
|
||||
open_form(frm, "Purchase Invoice", "Purchase Invoice Item", "items");
|
||||
},
|
||||
'Material Request': () => {
|
||||
open_form(frm, "Material Request", "Material Request Item", "items");
|
||||
},
|
||||
};
|
||||
|
||||
},
|
||||
onload: function(frm) {
|
||||
erpnext.item.setup_queries(frm);
|
||||
@@ -813,3 +838,17 @@ frappe.ui.form.on("UOM Conversion Detail", {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function open_form(frm, doctype, child_doctype, parentfield) {
|
||||
frappe.model.with_doctype(doctype, () => {
|
||||
let new_doc = frappe.model.get_new_doc(doctype);
|
||||
|
||||
let new_child_doc = frappe.model.add_child(new_doc, child_doctype, parentfield);
|
||||
new_child_doc.item_code = frm.doc.name;
|
||||
new_child_doc.item_name = frm.doc.item_name;
|
||||
new_child_doc.uom = frm.doc.stock_uom;
|
||||
new_child_doc.description = frm.doc.description;
|
||||
|
||||
frappe.ui.form.make_quick_entry(doctype, null, null, new_doc);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user