Skip to content

Commit 15b6633

Browse files
authored
feat: add setting to hide Subscription references across doctypes (#54576)
1 parent f14751d commit 15b6633

14 files changed

Lines changed: 110 additions & 76 deletions

File tree

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,

erpnext/accounts/doctype/journal_entry/journal_entry.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"clearance_date",
4040
"column_break_oizh",
4141
"user_remark",
42-
"subscription_section",
42+
"auto_repeat_section",
4343
"auto_repeat",
4444
"tax_withholding_tab",
4545
"section_tax_withholding_entry",
@@ -477,11 +477,6 @@
477477
"options": "Stock Entry",
478478
"read_only": 1
479479
},
480-
{
481-
"fieldname": "subscription_section",
482-
"fieldtype": "Section Break",
483-
"label": "Subscription"
484-
},
485480
{
486481
"allow_on_submit": 1,
487482
"fieldname": "auto_repeat",

erpnext/accounts/doctype/payment_entry/payment_entry.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,17 @@
8989
"remarks",
9090
"base_in_words",
9191
"is_opening",
92+
"title",
9293
"column_break_16",
9394
"letter_head",
9495
"print_heading",
9596
"bank",
9697
"bank_account_no",
9798
"payment_order",
9899
"in_words",
99-
"subscription_section",
100-
"auto_repeat",
101100
"amended_from",
102-
"title"
101+
"auto_repeat_section",
102+
"auto_repeat"
103103
],
104104
"fields": [
105105
{
@@ -503,11 +503,6 @@
503503
"print_hide": 1,
504504
"read_only": 1
505505
},
506-
{
507-
"fieldname": "subscription_section",
508-
"fieldtype": "Section Break",
509-
"label": "Subscription Section"
510-
},
511506
{
512507
"allow_on_submit": 1,
513508
"fieldname": "auto_repeat",
@@ -781,6 +776,11 @@
781776
"fieldname": "override_tax_withholding_entries",
782777
"fieldtype": "Check",
783778
"label": "Edit Tax Withholding Entries"
779+
},
780+
{
781+
"fieldname": "auto_repeat_section",
782+
"fieldtype": "Section Break",
783+
"label": "Auto Repeat"
784784
}
785785
],
786786
"grid_page_length": 50,

erpnext/accounts/doctype/payment_request/payment_request.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@
183183
"depends_on": "eval:doc.is_a_subscription",
184184
"fieldname": "subscription_section",
185185
"fieldtype": "Section Break",
186-
"label": "Subscription Section"
186+
"label": "Subscription"
187187
},
188188
{
189189
"fieldname": "subscription_plans",
@@ -478,7 +478,7 @@
478478
"index_web_pages_for_search": 1,
479479
"is_submittable": 1,
480480
"links": [],
481-
"modified": "2026-01-13 12:53:00.963274",
481+
"modified": "2026-02-27 19:11:03.308896",
482482
"modified_by": "Administrator",
483483
"module": "Accounts",
484484
"name": "Payment Request",

erpnext/accounts/doctype/pos_invoice/pos_invoice.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
"subscription_section",
188188
"from_date",
189189
"to_date",
190-
"column_break_140",
190+
"auto_repeat_section",
191191
"auto_repeat",
192192
"update_auto_repeat_reference",
193193
"against_income_account"
@@ -1462,7 +1462,7 @@
14621462
{
14631463
"fieldname": "subscription_section",
14641464
"fieldtype": "Section Break",
1465-
"label": "Subscription Section"
1465+
"label": "Subscription"
14661466
},
14671467
{
14681468
"allow_on_submit": 1,
@@ -1480,10 +1480,6 @@
14801480
"no_copy": 1,
14811481
"print_hide": 1
14821482
},
1483-
{
1484-
"fieldname": "column_break_140",
1485-
"fieldtype": "Column Break"
1486-
},
14871483
{
14881484
"allow_on_submit": 1,
14891485
"fieldname": "auto_repeat",
@@ -1619,12 +1615,17 @@
16191615
{
16201616
"fieldname": "column_break_bhao",
16211617
"fieldtype": "Column Break"
1618+
},
1619+
{
1620+
"fieldname": "auto_repeat_section",
1621+
"fieldtype": "Section Break",
1622+
"label": "Auto Repeat"
16221623
}
16231624
],
16241625
"icon": "fa fa-file-text",
16251626
"is_submittable": 1,
16261627
"links": [],
1627-
"modified": "2026-02-10 14:23:07.181782",
1628+
"modified": "2026-03-02 07:32:47.667810",
16281629
"modified_by": "Administrator",
16291630
"module": "Accounts",
16301631
"name": "POS Invoice",

erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,12 @@
180180
"unrealized_profit_loss_account",
181181
"subscription_section",
182182
"subscription",
183-
"auto_repeat",
184-
"update_auto_repeat_reference",
185183
"column_break_114",
186184
"from_date",
187185
"to_date",
186+
"automation_section",
187+
"auto_repeat",
188+
"update_auto_repeat_reference",
188189
"printing_settings",
189190
"letter_head",
190191
"group_same_items",
@@ -1675,6 +1676,12 @@
16751676
"fieldname": "totals_section",
16761677
"fieldtype": "Section Break",
16771678
"label": "Totals"
1679+
},
1680+
{
1681+
"collapsible": 1,
1682+
"fieldname": "automation_section",
1683+
"fieldtype": "Section Break",
1684+
"label": "Automation"
16781685
}
16791686
],
16801687
"grid_page_length": 50,

erpnext/accounts/doctype/sales_invoice/sales_invoice.json

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@
9191
"column_break_xjag",
9292
"base_rounding_adjustment",
9393
"base_rounded_total",
94-
"section_break_vacb",
94+
"section_break_pxwz",
9595
"total_advance",
96-
"column_break_rdks",
96+
"column_break_iaso",
9797
"outstanding_amount",
9898
"section_tax_withholding_entry",
9999
"tax_withholding_group",
@@ -199,6 +199,7 @@
199199
"unrealized_profit_loss_account",
200200
"against_income_account",
201201
"commission_section",
202+
"column_break_rdiw",
202203
"sales_partner",
203204
"amount_eligible_for_commission",
204205
"column_break10",
@@ -214,12 +215,14 @@
214215
"language",
215216
"subscription_section",
216217
"subscription",
217-
"from_date",
218-
"auto_repeat",
219218
"column_break_140",
219+
"from_date",
220220
"to_date",
221+
"automation_section",
222+
"auto_repeat",
221223
"update_auto_repeat_reference",
222224
"utm_analytics_section",
225+
"column_break_rdke",
223226
"utm_source",
224227
"utm_medium",
225228
"column_break_ixxw",
@@ -2305,22 +2308,36 @@
23052308
"print_hide": 1
23062309
},
23072310
{
2308-
"fieldname": "section_break_vacb",
2311+
"fieldname": "column_break_ixxw",
2312+
"fieldtype": "Column Break"
2313+
},
2314+
{
2315+
"collapsible": 1,
2316+
"fieldname": "utm_analytics_section",
2317+
"fieldtype": "Section Break",
2318+
"label": "UTM Analytics"
2319+
},
2320+
{
2321+
"collapsible": 1,
2322+
"fieldname": "automation_section",
2323+
"fieldtype": "Section Break",
2324+
"label": "Automation"
2325+
},
2326+
{
2327+
"fieldname": "section_break_pxwz",
23092328
"fieldtype": "Section Break"
23102329
},
23112330
{
2312-
"fieldname": "column_break_rdks",
2331+
"fieldname": "column_break_rdke",
23132332
"fieldtype": "Column Break"
23142333
},
23152334
{
2316-
"fieldname": "column_break_ixxw",
2335+
"fieldname": "column_break_rdiw",
23172336
"fieldtype": "Column Break"
23182337
},
23192338
{
2320-
"collapsible": 1,
2321-
"fieldname": "utm_analytics_section",
2322-
"fieldtype": "Section Break",
2323-
"label": "UTM Analytics"
2339+
"fieldname": "column_break_iaso",
2340+
"fieldtype": "Column Break"
23242341
}
23252342
],
23262343
"grid_page_length": 50,
@@ -2334,7 +2351,7 @@
23342351
"link_fieldname": "consolidated_invoice"
23352352
}
23362353
],
2337-
"modified": "2026-03-09 17:15:30.931929",
2354+
"modified": "2026-04-28 12:39:53.267755",
23382355
"modified_by": "Administrator",
23392356
"module": "Accounts",
23402357
"name": "Sales Invoice",

erpnext/buying/doctype/purchase_order/purchase_order.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
"column_break_86",
148148
"select_print_heading",
149149
"language",
150-
"subscription_section",
150+
"auto_repeat_section",
151151
"from_date",
152152
"to_date",
153153
"column_break_97",
@@ -1013,12 +1013,6 @@
10131013
"label": "Print Language",
10141014
"print_hide": 1
10151015
},
1016-
{
1017-
"collapsible": 1,
1018-
"fieldname": "subscription_section",
1019-
"fieldtype": "Section Break",
1020-
"label": "Auto Repeat"
1021-
},
10221016
{
10231017
"allow_on_submit": 1,
10241018
"fieldname": "from_date",
@@ -1309,6 +1303,12 @@
13091303
"fieldtype": "Time",
13101304
"label": "Time",
13111305
"mandatory_depends_on": "is_internal_supplier"
1306+
},
1307+
{
1308+
"collapsible": 1,
1309+
"fieldname": "auto_repeat_section",
1310+
"fieldtype": "Section Break",
1311+
"label": "Auto Repeat"
13121312
}
13131313
],
13141314
"grid_page_length": 50,

erpnext/buying/doctype/supplier_quotation/supplier_quotation.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
"column_break_85",
112112
"select_print_heading",
113113
"language",
114-
"subscription_section",
114+
"auto_repeat_section",
115115
"auto_repeat",
116116
"update_auto_repeat_reference",
117117
"more_info",
@@ -736,11 +736,6 @@
736736
"print_hide": 1,
737737
"read_only": 1
738738
},
739-
{
740-
"fieldname": "subscription_section",
741-
"fieldtype": "Section Break",
742-
"label": "Auto Repeat"
743-
},
744739
{
745740
"fieldname": "auto_repeat",
746741
"fieldtype": "Link",
@@ -940,6 +935,11 @@
940935
"no_copy": 1,
941936
"options": "Item Wise Tax Detail",
942937
"print_hide": 1
938+
},
939+
{
940+
"fieldname": "auto_repeat_section",
941+
"fieldtype": "Section Break",
942+
"label": "Auto Repeat"
943943
}
944944
],
945945
"grid_page_length": 50,
@@ -948,7 +948,7 @@
948948
"index_web_pages_for_search": 1,
949949
"is_submittable": 1,
950950
"links": [],
951-
"modified": "2026-01-29 21:23:13.778468",
951+
"modified": "2026-02-27 18:05:50.121391",
952952
"modified_by": "Administrator",
953953
"module": "Buying",
954954
"name": "Supplier Quotation",

0 commit comments

Comments
 (0)