Skip to content

Commit e09487d

Browse files
authored
Merge pull request #54583 from frappe/version-16-hotfix
2 parents 764c775 + 5de4b01 commit e09487d

105 files changed

Lines changed: 3111 additions & 1561 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/server-tests-mariadb.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
runs-on: ubuntu-latest
4242
timeout-minutes: 60
4343
env:
44+
TZ: 'Asia/Kolkata'
4445
NODE_ENV: "production"
4546
WITH_COVERAGE: ${{ github.event_name != 'pull_request' }}
4647

@@ -56,6 +57,7 @@ jobs:
5657
mysql:
5758
image: mariadb:10.6
5859
env:
60+
TZ: 'Asia/Kolkata'
5961
MARIADB_ROOT_PASSWORD: 'root'
6062
ports:
6163
- 3306:3306

erpnext/accounts/doctype/account/account.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ frappe.ui.form.on("Account", {
55
setup: function (frm) {
66
frm.add_fetch("parent_account", "report_type", "report_type");
77
frm.add_fetch("parent_account", "root_type", "root_type");
8-
},
9-
onload: function (frm) {
8+
109
frm.set_query("parent_account", function (doc) {
1110
return {
1211
filters: {
@@ -15,7 +14,18 @@ frappe.ui.form.on("Account", {
1514
},
1615
};
1716
});
17+
18+
frm.set_query("account_category", function () {
19+
if (!frm.doc.root_type) return;
20+
21+
return {
22+
filters: {
23+
root_type: ["in", [frm.doc.root_type, ""]],
24+
},
25+
};
26+
});
1827
},
28+
1929
refresh: function (frm) {
2030
frm.toggle_display("account_name", frm.is_new());
2131

@@ -58,12 +68,20 @@ frappe.ui.form.on("Account", {
5868
}
5969
}
6070
},
71+
6172
account_type: function (frm) {
6273
if (frm.doc.is_group == 0) {
6374
frm.toggle_display(["tax_rate"], frm.doc.account_type == "Tax");
6475
frm.toggle_display("warehouse", frm.doc.account_type == "Stock");
6576
}
6677
},
78+
79+
root_type: function (frm) {
80+
if (frm.doc.account_category) {
81+
frm.set_value("account_category", "");
82+
}
83+
},
84+
6785
add_toolbar_buttons: function (frm) {
6886
frm.add_custom_button(
6987
__("Chart of Accounts"),

erpnext/accounts/doctype/account_category/account_category.json

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@
77
"engine": "InnoDB",
88
"field_order": [
99
"account_category_name",
10+
"root_type",
11+
"column_break_qluu",
1012
"description"
1113
],
1214
"fields": [
1315
{
1416
"fieldname": "account_category_name",
1517
"fieldtype": "Data",
1618
"in_list_view": 1,
19+
"in_standard_filter": 1,
1720
"label": "Account Category Name",
1821
"reqd": 1,
1922
"unique": 1
@@ -22,6 +25,18 @@
2225
"fieldname": "description",
2326
"fieldtype": "Small Text",
2427
"label": "Description"
28+
},
29+
{
30+
"fieldname": "column_break_qluu",
31+
"fieldtype": "Column Break"
32+
},
33+
{
34+
"fieldname": "root_type",
35+
"fieldtype": "Select",
36+
"in_list_view": 1,
37+
"in_standard_filter": 1,
38+
"label": "Root Type",
39+
"options": "\nAsset\nLiability\nIncome\nExpense\nEquity"
2540
}
2641
],
2742
"grid_page_length": 50,
@@ -32,7 +47,7 @@
3247
"link_fieldname": "account_category"
3348
}
3449
],
35-
"modified": "2026-02-23 01:19:49.589393",
50+
"modified": "2026-03-05 06:49:34.430723",
3651
"modified_by": "Administrator",
3752
"module": "Accounts",
3853
"name": "Account Category",
@@ -69,7 +84,7 @@
6984
}
7085
],
7186
"row_format": "Dynamic",
72-
"search_fields": "account_category_name, description",
87+
"search_fields": "account_category_name, root_type",
7388
"sort_field": "creation",
7489
"sort_order": "DESC",
7590
"states": []

erpnext/accounts/doctype/account_category/account_category.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class AccountCategory(Document):
2121

2222
account_category_name: DF.Data
2323
description: DF.SmallText | None
24+
root_type: DF.Literal["", "Asset", "Liability", "Income", "Expense", "Equity"]
2425
# end: auto-generated types
2526

2627
def after_rename(self, old_name, new_name, merge):

erpnext/accounts/doctype/accounts_settings/accounts_settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"invoicing_features_section",
1717
"check_supplier_invoice_uniqueness",
1818
"automatically_fetch_payment_terms",
19+
"enable_subscription",
1920
"column_break_17",
2021
"enable_common_party_accounting",
2122
"allow_multi_currency_invoices_against_single_party_account",

erpnext/accounts/doctype/accounts_settings/accounts_settings.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ class AccountsSettings(Document):
7777
enable_immutable_ledger: DF.Check
7878
enable_loyalty_point_program: DF.Check
7979
enable_party_matching: DF.Check
80+
enable_subscription: DF.Check
8081
exchange_gain_loss_posting_date: DF.Literal["Invoice", "Payment", "Reconciliation Date"]
8182
fetch_payment_schedule_in_payment_request: DF.Check
8283
fetch_valuation_rate_for_internal_transaction: DF.Check
@@ -142,6 +143,10 @@ def validate(self):
142143
toggle_loyalty_point_program_section(not self.enable_loyalty_point_program)
143144
clear_cache = True
144145

146+
if old_doc.enable_subscription != self.enable_subscription:
147+
toggle_subscription_sections(not self.enable_subscription)
148+
clear_cache = True
149+
145150
if clear_cache:
146151
frappe.clear_cache()
147152

@@ -234,6 +239,12 @@ def toggle_loyalty_point_program_section(hide):
234239
create_property_setter_for_hiding_field(doctype, "loyalty_points_redemption", hide)
235240

236241

242+
def toggle_subscription_sections(hide):
243+
subscription_doctypes = frappe.get_hooks("subscription_doctypes")
244+
for doctype in subscription_doctypes:
245+
create_property_setter_for_hiding_field(doctype, "subscription_section", hide)
246+
247+
237248
def create_property_setter_for_hiding_field(doctype, field_name, hide):
238249
make_property_setter(
239250
doctype,

0 commit comments

Comments
 (0)