fix: Added Expense Account field to push value from PO-PR-PI

This commit is contained in:
Nabin Hait 2019-05-30 18:13:41 +05:30
parent 9944ef2baf
commit 0e1e37c921
3 changed files with 35 additions and 3 deletions

View File

@ -33,6 +33,14 @@ frappe.ui.form.on("Purchase Order", {
}
}
});
frm.set_query("expense_account", "items", function() {
return {
query: "erpnext.controllers.queries.get_expense_account",
filters: {'company': frm.doc.company}
}
});
},
refresh: function(frm) {

View File

@ -10,7 +10,7 @@ frappe.ui.form.on("Purchase Receipt", {
frm.custom_make_buttons = {
'Stock Entry': 'Return',
'Purchase Invoice': 'Invoice'
}
};
frm.set_query("asset", "items", function() {
return {
@ -18,7 +18,15 @@ frappe.ui.form.on("Purchase Receipt", {
"purchase_receipt": frm.doc.name
}
}
})
});
frm.set_query("expense_account", "items", function() {
return {
query: "erpnext.controllers.queries.get_expense_account",
filters: {'company': frm.doc.company}
}
});
},
onload: function(frm) {
erpnext.queries.setup_queries(frm, "Warehouse", function() {

View File

@ -4,6 +4,7 @@
"doctype": "DocType",
"document_type": "Document",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"barcode",
"section_break_2",
@ -80,6 +81,7 @@
"rejected_serial_no",
"section_break_50",
"project",
"expense_account",
"cost_center",
"col_break5",
"allow_zero_valuation_rate",
@ -245,6 +247,7 @@
"width": "100px"
},
{
"default": "0",
"fetch_from": "item_code.retain_sample",
"fieldname": "retain_sample",
"fieldtype": "Check",
@ -361,6 +364,7 @@
"read_only": 1
},
{
"default": "0",
"fieldname": "is_free_item",
"fieldtype": "Check",
"label": "Is Free Item",
@ -482,6 +486,7 @@
"fieldtype": "Column Break"
},
{
"default": "0",
"fieldname": "is_fixed_asset",
"fieldtype": "Check",
"hidden": 1,
@ -620,6 +625,7 @@
"fieldtype": "Column Break"
},
{
"default": "0",
"fieldname": "allow_zero_valuation_rate",
"fieldtype": "Check",
"label": "Allow Zero Valuation Rate",
@ -635,6 +641,7 @@
"print_hide": 1
},
{
"default": "0",
"depends_on": "eval:parent.is_subcontracted == 'Yes'",
"fieldname": "include_exploded_items",
"fieldtype": "Check",
@ -739,6 +746,7 @@
},
{
"allow_on_submit": 1,
"default": "0",
"fieldname": "page_break",
"fieldtype": "Check",
"label": "Page Break",
@ -766,11 +774,19 @@
"fieldname": "material_request_item",
"fieldtype": "Data",
"label": "Material Request Item"
},
{
"fieldname": "expense_account",
"fieldtype": "Link",
"hidden": 1,
"label": "Expense Account",
"options": "Account",
"read_only": 1
}
],
"idx": 1,
"istable": 1,
"modified": "2019-05-08 10:25:27.157675",
"modified": "2019-05-30 18:09:21.648599",
"modified_by": "Administrator",
"module": "Stock",
"name": "Purchase Receipt Item",