Commit graph

2884 commits

Author SHA1 Message Date
Suraj Shetty
0c9a55f4e5
Merge pull request #37180 from frappe/32475-attached_to_field-and-folder-fields-not-copied-by-copy_attachments_from_amended_from-function 2026-02-24 15:54:40 +05:30
sokumon
68a8b9fa4a fix: check if app value exists 2026-02-24 14:44:51 +05:30
Soham Kulkarni
23b17de20a
Merge pull request #37446 from sokumon/robust-patch 2026-02-24 12:59:23 +05:30
sokumon
204fb51bb9 fix: make removal of orphan entities robust 2026-02-24 12:35:21 +05:30
Priyal208
e86df0f9cc
fix: skip _validate_update_after_submit() for virtual fields (#37390) 2026-02-23 12:59:57 +00:00
diptanilsaha
57f6734255 fix(sync): remove is_standard notifications records on deletion 2026-02-23 12:59:57 +05:30
Akhil Narang
04b2a433b6
fix(db_query): relax some restrictions (#37314)
Allow valid identifiers

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2026-02-23 12:21:26 +05:30
Aarol D'Souza
c55ff193a6
fix: add type hints to whitelisted methods 3 (#37149)
* fix(apps): add type hints to whitelisted methods

* fix(recorder): add type hints to whitelisted methods

* fix(comments): add type hints to whitelisted methods

* fix(oauth2): add type hints to whitelisted methods

* fix(google_calendar): add type hints to whitelisted methods

* fix(print): add type hints to whitelisted methods

* fix(print_format_builder): add type hints to whitelisted methods

* refactor(network_printer_settings): remove unused args

* fix(document): add type hints to whitelisted methods

* fix(user_settings): add type hints to whitelisted methods

* fix(mapper): add type hints to whitelisted methods

* fix(connected_app): add type hints to whitelisted methods

* fix(google_contacts): add type hints to whitelisted methods

* fix(frappecloud_billing): add type hints to whitelisted methods

* test: rewrite test to fit the strict type check

* fix(social_login_key): add type hints to whitelisted methods

* fix(share): add type hints to whitelisted methods

* fix(webhook): add type hints to whitelisted methods

* fix(workflow): add type hints to whitelisted methods

* fix(workflow main): add type hints to whitelisted methods

* fix(workflow_action): add type hints to whitelisted methods

* fix: flexible type hint

* fix(client): add type hints to whitelisted methods

* fix: fix some of the tighter types

* fix(frappecloud_billing): add str typehint to whitelisted endpoint

* fix: target_doc can be dict/json string

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2026-02-20 06:50:19 +00:00
Sumit Jain
b781fa4ee3 fix: Copy attached_to_field and folder when amending documents 2026-02-18 14:04:58 +05:30
Aarol D'Souza
a043c26709
Merge pull request #35318 from AarDG10/add-custom-hook
feat(server script): parse child table list onto server script for customizations
2026-02-17 23:05:32 +05:30
Ankush Menat
c38815c60c
fix: limit join param to get_all (#37131) 2026-02-17 10:19:54 +00:00
Saqib Ansari
326406d139 fix: avoid false cache misses by ensuring string keys for linked fields 2026-02-17 12:21:19 +05:30
Akhil Narang
7c756aa811
Merge pull request #35872 from czarflix/fix/perf-bulk-link-validation
perf(validation): optimize link validation with bulk pre-fetching
2026-02-16 16:14:21 +05:30
Akhil Narang
ab577751f2
fix(sanitize_fields): strengthen field check
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2026-02-10 21:35:53 +05:30
Sagar Vora
93065e6af4 fix: handle extended class unpickling when frappe is not initialised
Store __bases__ in pickle for reconstructing extended classes during unpickling.
This avoids dependency on get_controller() which requires frappe to be initialised.

Uses functools.cache on _create_extended_class to avoid recreating the class
for each unpickled object.

fixes frappe#35371
2026-02-09 18:00:42 +05:30
Suraj Shetty
cefac6851e
Merge pull request #36621 from frappe/fix-empty-list-in-operator-behavior
fix!: Enhance IN/NOT IN operator handling for empty lists
2026-02-09 15:17:54 +05:30
barredterra
251189a1e2 fix: skip db changes while renaming virtual doctype 2026-02-08 17:44:04 +01:00
Safwan
1307ae33eb
fix: use system number format for currency precision (#36648)
* fix: use system number format for currency precision

* fix: remove default format
2026-02-07 06:30:00 +00:00
Sumit Jain
1d9eb802fc
feat: Enhance autoname functionality (#36827)
* feat: Enhance autoname functionality to support expression naming rules with and without dots before dashes

* style: Fix formatting issues

---------

Co-authored-by: Suraj Shetty <surajshetty3416@gmail.com>
2026-02-07 06:22:28 +00:00
Ayaan Ahmad
ddc757dcc8 refactor(model): extract repeated DB query logic into helper function
Address @akhilnarang's code review feedback:

1. Extract _fetch_link_values helper function
   - Encapsulates repeated DB query pattern (was duplicated 3 times)
   - Handles cache=True fallback and virtual doctype logic

2. Sort values_to_fetch for cache key consistency
   - Uses tuple(sorted({...})) to match prefetch sorting
   - Prevents cache misses due to field order differences
2026-02-04 00:32:46 +05:30
Sumit Jain
c6868b11c6 feat: Enhance IN/NOT IN operator handling for empty lists
Added logic to return appropriate criteria for empty lists in IN and NOT IN operators. An empty list with IN now returns 0 results (1=0), while NOT IN returns all results (1=1). Updated tests to verify this behavior.
2026-02-03 12:31:29 +05:30
Sagar Vora
f2a608c08d fix: allow default fields for users with select perms 2026-02-02 15:19:23 +05:30
AarDG10
7485f1367d refactor: parse in db_query as is parsed in query to maintain parity 2026-01-30 23:45:03 +05:30
Aarol D'Souza
a74725f826
Merge branch 'develop' into add-custom-hook 2026-01-30 23:32:46 +05:30
AarDG10
edd15715b6 feat(query): parse child tables via query file too 2026-01-30 23:25:26 +05:30
sokumon
aeb53b3401 fix: change condition for Workspace 2026-01-28 15:41:30 +05:30
AarDG10
3774a68093 refactor: get rid of noise and add docstring 2026-01-27 13:51:03 +05:30
Hussain Nagaria
d5dc81cf50 Revert "fix(BaseDocument): reset name when __islocal is set"
This reverts commit 8f3710cdec19da5918e3bf25cef38be693fdc5c2.
2026-01-26 15:59:56 +05:30
Ejaaz Khan
d124305323
Merge pull request #35278 from stephenBDT/fix-virtual-childtable-fields-not-in-pdf-2
fix: virtual childtable docfields value not in pdf childtable
2026-01-24 02:01:28 +05:30
Ankush Menat
ee56afade5
refactor!: Remove UUID Utils library (#36216)
potentially minor breaking change - removal of a default dependency.

Use inbuilt `uuid` library instead of relying on third party lib.

py3.14 adds support for uuidv7, so we no longer need third party lib.
2026-01-22 11:40:11 +00:00
sokumon
1357924b05 fix: cleanup desktop icons in migrate 2026-01-21 16:51:47 +05:30
Rahul Agrawal
2df6e92c2f
fix: remove read-only field validation map_doc (#35757) 2026-01-20 22:17:12 +05:30
Hussain Nagaria
0080ee6aae
fix(BaseDocument): reset name when __islocal is set (#36080) 2026-01-19 13:42:25 +00:00
Ayaan Ahmad
614bb642ef refactor(model): simplify prefetch per szufisher's suggestion
- Remove fetch_if_empty check from prefetch phase
- Fetch ALL fields, let base_document.py handle fetch_if_empty
- Avoids DRY violation (same logic in two places)
- Efficiency difference is negligible
2026-01-17 21:29:48 +05:30
sokumon
04972a8619 fix: remove sync_user_settings from hooks 2026-01-17 19:16:06 +05:30
sokumon
8c9aa18ab5 feat: create icons when user settings are synced 2026-01-17 19:16:06 +05:30
Ayaan Ahmad
6197b73d52 fix(model): resolve CI failures in bulk link validation
- Remove cache-check-before-get_all due to recursive_defaultdict edge cases
- Fix ruff-format (multi-line to single-line function call)
- Keep cache population after fetch (addresses maintainer request)
- Preserve core N+1 optimization (bulk fetching via get_all)
2026-01-15 00:21:04 +05:30
Ayaan Ahmad
f37890c31f fix(model): address PR feedback for bulk link validation
- Replace **kwargs with explicit link_value_cache parameter
- Check db.value_cache before get_all for cross-document caching
- Populate db.value_cache after fetching for subsequent documents
- Add sorted() for deterministic cache key matching
- Add isinstance guard for integer docnames (MariaDB)
- Fix linting issues (RUF005, slice spacing)
2026-01-14 22:31:22 +05:30
AarDG10
6929f5e7a9 feat(permissions): parse child tables to be used in server scripts 2026-01-13 12:13:37 +05:30
Ayaan Ahmad
3f86d478e8 perf(validation): optimize link validation with bulk pre-fetching
Implements a _prefetch_link_values method that bulk-fetches all link values
before validation, eliminating N+1 queries when saving documents with many
child rows containing Link/Dynamic Link fields.

Performance Impact:
- 50 child rows: 51 queries → 3 queries (94% reduction)
- 500 child rows: 501 queries → 3 queries (99.4% reduction)

Implementation:
- Uses instance-level cache (garbage collected after validation)
- Sentinel pattern to distinguish cache miss from cached-None
- DB-conditional case handling (MariaDB vs Postgres)
- Chunking at 1000 items for safety
- Backward compatible via **kwargs

Edge Cases Handled:
- Empty name lists (skip query)
- Invalid docname types (preserves existing assertions)
- Virtual doctypes (individual fetch)
- Single doctypes (special handling)
- Dynamic links with doctype changes (cache miss fallback)

Closes #35794
2026-01-12 20:23:54 +05:30
Akhil Narang
8c5b5ecec3
Merge pull request #35775 from akhilnarang/multisql-wildcard
feat(multisql): support passing a wildcard query
2026-01-12 12:23:31 +05:30
sokumon
5c81a34cbb fix: remove orphan workspace sidebars 2026-01-12 10:35:50 +05:30
Sagar Vora
6327f4ca8a fix: specify valid rights for share query 2026-01-09 12:44:48 +05:30
Akhil Narang
8657690ef5
refactor: use wildcard to avoid duplicating some queries
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2026-01-08 18:56:05 +05:30
AarDG10
2c96697c76 feat(custom app): add custom permissions hook 2026-01-07 10:44:55 +05:30
rohitwaghchaure
4e51d71c0b
Merge pull request #35674 from rohitwaghchaure/fixed-parse-data-too-long-error
fix: better validation message for data too long error
2026-01-06 15:11:13 +05:30
Rohit Waghchaure
f30e1e9a1c fix: better validation message for data too long error 2026-01-06 11:49:08 +05:30
Mihir Kandoi
922c1b812d
fix(document naming): customer parser should be checked before anything else (#35586) 2026-01-05 13:44:32 +05:30
Raizaaa
0a2ab6364c
fix: added 'autoname' to reserved keywords (#35473)
* fix: added 'autoname' to reserved keywords

* fix: prevent using autoname as DocField name

- Add validation for autoname in check_invalid_fieldnames()
- Treat Python keywords as reserved fieldnames

* fix: move autoname out of reserved keywords

* fix: move python keywords out of reserved keywords

* fix: skip reserved docfield name check for 'DocType'

---------

Co-authored-by: Raiza Safeel <raizasafeel@Raizas-MacBook-Air.local>
2025-12-31 12:00:49 +05:30
Soham Kulkarni
c145726f5f
Merge pull request #35539 from sokumon/cancel 2025-12-30 16:53:29 +05:30