fix: Make expense account editable in Subcontracting Receipt Item (#31848)

This commit is contained in:
Sagar Sharma 2022-08-17 15:57:41 +05:30 committed by GitHub
parent 396667b702
commit 2d04e71412
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 6 deletions

View File

@ -322,7 +322,13 @@ class StockController(AccountsController):
) )
if ( if (
self.doctype self.doctype
not in ("Purchase Receipt", "Purchase Invoice", "Stock Reconciliation", "Stock Entry") not in (
"Purchase Receipt",
"Purchase Invoice",
"Stock Reconciliation",
"Stock Entry",
"Subcontracting Receipt",
)
and not is_expense_account and not is_expense_account
): ):
frappe.throw( frappe.throw(

View File

@ -48,6 +48,13 @@ frappe.ui.form.on('Subcontracting Receipt', {
is_group: 0 is_group: 0
} }
})); }));
frm.set_query("expense_account", "items", function () {
return {
query: "erpnext.controllers.queries.get_expense_account",
filters: { 'company': frm.doc.company }
};
});
}, },
refresh: (frm) => { refresh: (frm) => {

View File

@ -49,11 +49,12 @@
"col_break5", "col_break5",
"batch_no", "batch_no",
"rejected_serial_no", "rejected_serial_no",
"expense_account",
"manufacture_details", "manufacture_details",
"manufacturer", "manufacturer",
"column_break_16", "column_break_16",
"manufacturer_part_no", "manufacturer_part_no",
"accounting_details_section",
"expense_account",
"accounting_dimensions_section", "accounting_dimensions_section",
"project", "project",
"dimension_col_break", "dimension_col_break",
@ -363,10 +364,8 @@
{ {
"fieldname": "expense_account", "fieldname": "expense_account",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 1,
"label": "Expense Account", "label": "Expense Account",
"options": "Account", "options": "Account"
"read_only": 1
}, },
{ {
"collapsible": 1, "collapsible": 1,
@ -456,12 +455,17 @@
"no_copy": 1, "no_copy": 1,
"print_hide": 1, "print_hide": 1,
"read_only": 1 "read_only": 1
},
{
"fieldname": "accounting_details_section",
"fieldtype": "Section Break",
"label": "Accounting Details"
} }
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"links": [], "links": [],
"modified": "2022-04-21 12:07:55.899701", "modified": "2022-08-15 11:34:00.970042",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Subcontracting", "module": "Subcontracting",
"name": "Subcontracting Receipt Item", "name": "Subcontracting Receipt Item",