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) { refresh: function(frm) {

View File

@ -10,7 +10,7 @@ frappe.ui.form.on("Purchase Receipt", {
frm.custom_make_buttons = { frm.custom_make_buttons = {
'Stock Entry': 'Return', 'Stock Entry': 'Return',
'Purchase Invoice': 'Invoice' 'Purchase Invoice': 'Invoice'
} };
frm.set_query("asset", "items", function() { frm.set_query("asset", "items", function() {
return { return {
@ -18,7 +18,15 @@ frappe.ui.form.on("Purchase Receipt", {
"purchase_receipt": frm.doc.name "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) { onload: function(frm) {
erpnext.queries.setup_queries(frm, "Warehouse", function() { erpnext.queries.setup_queries(frm, "Warehouse", function() {

View File

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