Skip to content

Commit

Permalink
fix: Allow creating Item as is_fixed_asset in Quick Entry.
Browse files Browse the repository at this point in the history
  • Loading branch information
bosue committed Oct 24, 2023
1 parent 025acc0 commit 13f9093
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
4 changes: 3 additions & 1 deletion erpnext/stock/doctype/item/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ frappe.ui.form.on("Item", {
frappe.call({
method: "erpnext.stock.doctype.item.item.get_asset_naming_series",
callback: function(r) {
frm.set_value("is_stock_item", frm.doc.is_fixed_asset ? 0 : 1);
if (frm.doc.is_fixed_asset) {
frm.set_value("is_stock_item", 0);
}
frm.events.set_asset_naming_series(frm, r.message);
}
});
Expand Down
18 changes: 11 additions & 7 deletions erpnext/stock/doctype/item/item.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
"stock_uom",
"column_break0",
"disabled",
"allow_alternative_item",
"is_fixed_asset",
"auto_create_assets",
"is_grouped_asset",
"asset_category",
"is_stock_item",
"allow_alternative_item",
"has_variants",
"opening_stock",
"valuation_rate",
"standard_rate",
"is_fixed_asset",
"auto_create_assets",
"is_grouped_asset",
"asset_category",
"asset_naming_series",
"over_delivery_receipt_allowance",
"over_billing_allowance",
Expand Down Expand Up @@ -202,6 +202,7 @@
"label": "Allow Alternative Item"
},
{
"allow_in_quick_entry": 1,
"bold": 1,
"default": "1",
"depends_on": "eval:!doc.is_fixed_asset",
Expand Down Expand Up @@ -239,13 +240,16 @@
"label": "Standard Selling Rate"
},
{
"allow_in_quick_entry": 1,
"default": "0",
"fieldname": "is_fixed_asset",
"fieldtype": "Check",
"label": "Is Fixed Asset",
"read_only_depends_on": "is_stock_item",
"set_only_once": 1
},
{
"allow_in_quick_entry": 1,
"depends_on": "is_fixed_asset",
"fieldname": "asset_category",
"fieldtype": "Link",
Expand Down Expand Up @@ -888,7 +892,7 @@
"index_web_pages_for_search": 1,
"links": [],
"make_attachments_public": 1,
"modified": "2023-09-11 13:46:32.688051",
"modified": "2023-10-24 08:12:41.307459",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item",
Expand Down Expand Up @@ -961,4 +965,4 @@
"states": [],
"title_field": "item_name",
"track_changes": 1
}
}

0 comments on commit 13f9093

Please sign in to comment.