Commit graph

5940 commits

Author SHA1 Message Date
ruthra kumar
8e6feb62c2 refactor: link to scheduled job type 2025-01-13 10:39:49 +05:30
ruthra kumar
58e291d61c feat: Scheduler Event 2025-01-13 10:31:31 +05:30
mergify[bot]
9733ad313a
fix: frappe license added in report.js (#29084)
frappe license added in report.js

(cherry picked from commit 63ea6d42eae895fa0ca93f74cea1009eb80e06d0)

Co-authored-by: Indrajith.vs <91895505+Gubbu77@users.noreply.github.com>
2025-01-09 11:48:51 +05:30
Ankush Menat
fdba41c682
perf: misc client cache improvements (#29070)
* perf: Reduce penalty for lack of redis connection

If redis isn't running than this client cache is slower than default
implementation because of the extra locking overhead.

* test: update perf redis counts

* perf: cache table columns in client-cache

* fix: race condition on cache-client_cache init

Rare but apparant in synthetic benchmarks.

Cache is set but client cache is still being initialized then request
will fail.

* perf: Don't run notifications when loading document

WHAT?

* fix: use cached doc to repopulate

* perf: reduce get_meta calls
2025-01-07 16:14:43 +05:30
Ankush Menat
73dc99275d refactor: move get_system_settings
- This should not be in init.py
- set_single_value is not a good alternate for properly cleaning up cache.
2025-01-06 20:31:38 +05:30
Ankush Menat
e37219ef39 perf: Store languages in client cache 2025-01-06 19:52:43 +05:30
Ankush Menat
c76b23a050 perf: cache server script map in client cache 2025-01-06 19:43:28 +05:30
Ankush Menat
546260162d perf: Skip link checking on internal deletes
These are deletes that aren't user triggered and these documents are
typically never "linked" somewhere else. So skip all expensive link /
dynamic link checks.
2025-01-06 11:48:19 +05:30
Hussain Nagaria
87a4c03850 fix: don't copy over API Key
* anyways wasn't useful since password isn't copied
2024-12-31 19:35:55 +05:30
Hussain Nagaria
673269fdcf fix: typo in test controller boilerplate 2024-12-21 13:13:22 +05:30
ruthra kumar
63a6c8c903 refactor: log in monitor as well 2024-12-20 11:35:41 +05:30
ruthra kumar
29cf8cef8f feat: log peak memory usage for Prepared reports 2024-12-20 10:18:27 +05:30
Ankush Menat
30ec033747
perf: Speedup get_doc by another ~1.5x (#28807)
* perf: Reduce impact of forced cache replacement on every doc access

* fix: clear cache before processing users

Note: This is just an artifact of testing model, this won't have any real
effect on execution in real system.

Basically `enqueue_on_commit` is not respected in tests and it can't be
practically supported either.
2024-12-17 16:48:43 +05:30
Akhil Narang
fae07e4bbb
fix(package): validate package name, export path
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-12-16 17:19:54 +05:30
Ankush Menat
1b1126c1c8
perf: index document name (#28718)
Moved index from doctype to docname. Docname always has higher
cardinality. Even if you filter by both it shouldn't matter as
cross-doctype name conflicts are rather rare.

Perf impact of this change should be net 0 but it does addresses problem
of indeterministic load times based on how many errors exist in db.

closes https://github.com/frappe/frappe/issues/28713
2024-12-09 09:08:59 +00:00
Ankush Menat
60bc472ab6
revert: restore JSON files (#28717)
* Revert: bring back JSON files

* chore: re-apply changes to new files

* chore: remove old TOML files

* chore: delete empty files
2024-12-09 08:41:56 +00:00
Sumit Bhanushali
1bb26f68d3 fix: check at doc level when if owner role permission is checked during export from list view
(cherry picked from commit 1ed45ceb97868c9b517dd3066f0b4ea2cd5358f5)
2024-12-09 07:22:32 +00:00
Sumit Bhanushali
91d553c9cf
Merge pull request #28363 from frappe/expr-series
fix(NamingExpression): series should be separate for different format expressions instead of global
2024-12-09 12:13:28 +05:30
Gavin D'souza
c6580b5880
refactor: Replace pytz to std lib zoneinfo & datetime
Signed-off-by: Gavin D'souza <gavin.dsouza@switchup.de>
2024-12-06 15:43:33 +05:30
Sumit Bhanushali
aaefd066f0 fix: validate "format:" expression to only contain one set of {#} pattern 2024-12-06 13:03:27 +05:30
Raffael Meyer
5c4dc84bad
fix: handle empty images (#28669)
Resolves #28668
2024-12-04 16:16:42 +01:00
Akhil Narang
84ef6ec677
refactor: fixup with ruff 0.8.1
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-12-04 13:18:04 +05:30
Sumit Bhanushali
3e74559617
Merge pull request #28622 from Z4nzu/develop
fix: Allow read-only fields to display even without value
2024-12-03 18:37:29 +05:30
Hardik Zinzu
634961d020 feat: Add system setting to control visibility of empty read-only fields 2024-12-03 16:43:49 +05:30
Faris Ansari
f7c005dc09
Merge pull request #28629 from netchampfaris/autoincrement-renaming
fix: allow renaming autoincrement documents
2024-12-02 14:25:05 +05:30
Faris Ansari
188f9f9650 fix: show Allow Rename field always 2024-11-30 16:48:49 +05:30
Faris Ansari
0ef8001102 fix: allow renaming autoincrement documents 2024-11-30 14:58:15 +05:30
David Arnold
e2a8c7fed3
test: fix universal type checker based on downstream use and more testing (#28619)
* test: fix universal type checker based on downstream use and more testing

* fix: type validation error reporting

* fix: types; various

* chore: switch off test-time type checking

still too many errors
2024-11-28 23:35:32 +01:00
Akhil Narang
a350b5c6de
refactor(user_query): adjust query, only check fields if required
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-11-21 18:08:37 +05:30
Akhil Narang
1a8d9d1122
refactor(user_query): simplify with as_list=True
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-11-21 18:05:41 +05:30
Nihantra Patel
b250d19153 fix: user_query 2024-11-21 12:20:18 +05:30
David Arnold
3c1392c8fd
fix: meta signature (#28526)
* fix: meta

* fix: test case

save is required:

1. Fetch values
```python
	def get_invalid_links(self, is_submittable=False):
		"""Return list of invalid links and also update fetch values if not set."""
		...
```

2. Is triggered by
```python

	def _validate_links(self):
		if self.flags.ignore_links or self._action == "cancel":
			return
        ...
```

3. Which is triggered by either `_save` or `insert`

----

`reload` does not trigger link fetch
```python
	def reload(self) -> "Self":
		"""Reload document from database"""
		return self.load_from_db()
```

Neither does the new calling path which does not excempt Document
from caching when initializing meta.

It can be proven that this revert would be an alternative fix. But this
seems design by accident and there's no preceivable reason to excempt
Document args from being cached normally.

diff --git a/frappe/model/meta.py b/frappe/model/meta.py
index c4321f0128..87452c812c 100644
--- a/frappe/model/meta.py
+++ b/frappe/model/meta.py
@@ -70,11 +70,10 @@ def get_meta(doctype: str | dict | DocRef, cached=True) -> "_Meta":
 	Returns:
 	    Meta object for the given doctype.
 	"""
-	if cached and (
-		doctype_name := getattr(doctype, "doctype", doctype)
-		if not isinstance(doctype, dict)
-		else doctype.get("doctype")
-	):
+	if cached and not isinstance(doctype, Document):
+		doctype_name = (
+			getattr(doctype, "doctype", doctype) if not isinstance(doctype, dict) else doctype.get("doctype")
+		)
 		if meta := frappe.cache.hget("doctype_meta", doctype_name):
 			return meta

Therefore, we comply the test.
2024-11-20 04:17:38 +00:00
Raffael Meyer
64b2010d21
refactor: readability of translation tests (#28519) 2024-11-19 19:05:05 +00:00
Frappe PR Bot
8c8bea7a36
fix: sync translations from crowdin (#28441)
Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
2024-11-19 19:22:20 +01:00
David Arnold
4f6e2fbe93
fix: boilerplate test case (#28514) 2024-11-19 11:29:34 +00:00
Akhil Narang
455edcb7d3
Merge pull request #28478 from akhilnarang/clarify-naming-series-options
chore(document_naming_settings): clarify that FY and ABBR require ERPNext being installed
2024-11-19 15:58:01 +05:30
Akhil Narang
605a11a4a1
Merge pull request #28498 from akhilnarang/fix-user-query
refactor(user_query): switch to `frappe.get_list()`
2024-11-19 15:56:54 +05:30
Shariq Ansari
16b56ee895
Merge pull request #28459 from shariquerik/billing
feat: Billing Page
2024-11-19 11:30:57 +05:30
Akhil Narang
b3acb7857b
refactor(user_query): switch to frappe.get_list()
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-11-18 13:04:15 +05:30
Akhil Narang
c06f528037
chore(document_naming_settings): clarify that FY and ABBR require ERPNext being installed
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-11-15 18:04:49 +05:30
Shariq Ansari
a78bcc4566 fix: allow adding condition (js) in navbar settings dropdown 2024-11-15 14:31:34 +05:30
Sumit Bhanushali
0baf4c85db fix(User): validate user email presence on create email account, hide impersonate user on new doc 2024-11-14 16:53:38 +05:30
David Arnold
057139ea2e
chore(communication): cleanup unused code (#28199)
* chore: feedback doctype no longer exists

missed from https://github.com/frappe/frappe/pull/17479

* chore: remove unused communication type

This was removed and migrated already in v12:

```
frappe/patches/v12_0/setup_comments_from_communications.py:	frappe.db.delete("Communication", {"communication_type": "Comment"})
```
... comming from 41d90fa6d1
which effectively reverted 465318878e
2024-11-14 00:12:14 +01:00
Akhil Narang
6aeccbb669 chore: format
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit ddc0d6007c2dd93a177717eec4178fb4db4d3620)
2024-11-12 10:01:43 +00:00
gavin
bdaa979159 chore: "or" over "if not" pattern
Co-authored-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit e7e7ee0ec15d73c1e59cc34b93253ad21d619e0a)
2024-11-12 10:01:43 +00:00
Maverjk Carter
ae1c887b58 fix: check app logo from website settings before checking navbar settings
(cherry picked from commit 3db7f7a674930c864fa0aa6ed89cc43d2e32c46f)
2024-11-12 10:01:43 +00:00
Devin Slauenwhite
e8d9bd39c7
feat: get current session user roles if uid is not provided (#26808) 2024-11-06 15:48:59 +05:30
Hussain Nagaria
465793849c fix: store and use default currency from system settings 2024-11-04 16:08:27 +05:30
Hussain Nagaria
ec742dfe02 fix(UI): succinct field name for DocType name 2024-11-04 14:55:53 +05:30
Sumit Bhanushali
0948874c62 fix: dont display phone numbers to which sms was sent to 2024-10-24 21:45:37 +05:30