Commit graph

2838 commits

Author SHA1 Message Date
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
sokumon
a235fc110b chore: add correct docs url 2025-12-30 16:43:34 +05:30
UmakanthKaspa
6bb584f725
feat: Support dynamic expressions in workflow update_value field (#34354)
* feat: add dynamic value support for workflow update_value field

* feat: add evaluate as expression checkbox to workflow states

* test: add tests for dynamic workflow update_value expression

* fix: use description field instead of sender in workflow
  tests

* chore: fix typo

---------

Co-authored-by: UmakanthKaspa <kaspaumakanth1999@gmail.com>
Co-authored-by: Akhil Narang <me@akhilnarang.dev>
2025-12-30 15:58:43 +05:30
Sagar Vora
fd7aa0969b
Merge pull request #35501 from sagarvora/stricter-link-assert 2025-12-29 17:00:29 +05:30
Sagar Vora
49d33a7b3a fix: stricter link field assertion 2025-12-29 16:35:51 +05:30
Sagar Vora
fc3a85b93a fix: check perms before validating links 2025-12-29 16:08:27 +05:30
artykbasar
2739385184
fix(estimate_count): scope to site db (#35481)
* Fix large-table heuristics: scope estimate_count and guard recency

* fix(estimate_count): scope to site database

Incase some setups don't have per-db-users

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

---------

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Co-authored-by: artykbasar <artykbasar@users.noreply.github.com>
Co-authored-by: Akhil Narang <me@akhilnarang.dev>
2025-12-29 14:11:34 +05:30
Tai Cai
12efd72cc9 fix(model): fix postgres compatibility in update_user_settings
In Postgres, double quotes denote identifiers. The previous LIKE clause format caused "UndefinedColumn" errors during field renaming (e.g., during HRMS installation) because the pattern was interpreted as a column name.

This change parameterizes the LIKE pattern and passes the wildcarded value as a bound parameter, ensuring compatibility with both MySQL and Postgres.
2025-12-24 11:33:42 +07:00
Akhil Narang
e859b1d312
fix: disable UP040, revert some instances to TypeAlias
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-12-23 13:12:04 +05:30
Akhil Narang
f7feeea0a0
fix: ruff "unsafe" fixes
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-12-22 21:06:48 +05:30
Akhil Narang
8723a2b6ee
fix: ruff fixes
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-12-22 21:06:48 +05:30
Akhil Narang
3a2dcaa2de
fix(with_comment_count): handle string values
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-12-18 18:11:02 +05:30
Akhil Narang
c0ebc96597
feat(qb_query): expose fields like db_query
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-12-18 17:26:52 +05:30
sokumon
709169a538 chore: clean desktop icon controller 2025-12-18 14:20:00 +05:30
Akhil Narang
42d8cae26e
fix(meta): use raw SQL to avoid recursively querying meta in some cases
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-12-17 11:21:22 +05:30
Akhil Narang
c7f5ea837a
feat: implement field masking for query builder (#35230)
* feat: implement field masking for query builder

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* fix: add series and sessions to "core doctypes" list

This is so that we don't try to query their meta
This should also resolve #35030

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

---------

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-12-16 12:08:13 +05:30
Soham Kulkarni
c22a1937b5
Merge pull request #35067 from sokumon/remove-orphans 2025-12-10 18:01:14 +05:30
Akhil Narang
ef6a0bffc2
fix: update overloaded get_doc() signature
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-12-10 16:52:37 +05:30
Akhil Narang
2dcfe07ca8
refactor: make use of check_permission parameter for get_lazy_doc
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-12-10 16:52:26 +05:30
Akhil Narang
75b91f44ce
feat(get_lazy_doc): add in check_permission parameter
So as to avoid manually calling doc.check_permission() often

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-12-10 15:40:58 +05:30
Akhil Narang
bb5a94ac20
Merge pull request #35135 from akhilnarang/fix-run-doc-method
feat(get_doc): add in `check_permission` parameter
2025-12-10 15:36:27 +05:30
Akhil Narang
40ebe6b97a
feat(get_doc): add in check_permissions parameter
If a string, we'll try to check for that permission
Otherwise, we'll just check for `read`
2025-12-09 19:31:14 +05:30
sokumon
dfd5d6982d fix: create and use a file map to remove orphans 2025-12-09 17:31:20 +05:30
Akhil Narang
269471729c
feat(qb_query)!: return query object if requested
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-12-09 11:39:48 +05:30
sokumon
ea6a9cd76e fix: print more information in error 2025-12-08 00:43:03 +05:30
sokumon
7b32b96cfc fix: handle names with parenthesis 2025-12-07 23:09:44 +05:30
sokumon
fa5784b04b fix: use the correct part for dashboard 2025-12-07 21:17:21 +05:30
Exequiel Arona
9774adf7ac
fix: fields are pass to virtual doctype controller (#35078) 2025-12-05 13:48:36 +05:30
Aarol D'Souza
15e59a3ba2
fix(postgres): add rollback to prevent crash on hash collision (#34686)
* fix(postgres): add rollback to prevent crash on hash collision

* fix(postgres): rollback to savepoint to prevent crash on hash collision

* fix(postgres): tighten bounds for a rollback to savepoint for a better perf

* fix(postgres): Handle hash collision efficiently with ON CONFLICT

* refactor: better naming

- Private methods
- "rows" is not a correct name for single record's name

* fix: Bad error handling

- Why raise postgres error?
- Let default error raising/handling happen

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2025-12-05 12:02:10 +05:30
Soham Kulkarni
6f4b28d29e
Revert "feat: removal of orphan entities" 2025-12-04 13:45:23 +05:30
Soham Kulkarni
2b9f1e08a7
Merge pull request #34817 from sokumon/remove-orphans 2025-12-04 13:14:00 +05:30
Hussain Nagaria
0891a69bda
fix: bring back currency precision fix #34886 (#35015)
* fix: use number format from currency if defined

* refactor: extract out function
2025-12-02 07:16:17 +00:00
Sagar Vora
3a3a83b644 refactor: remove redundant child table permission checks
The `check_parent_permission` calls in client.py are redundant because
`frappe.has_permission` already handles child tables via `has_child_permission`,
which performs the same validations plus additional permlevel checks.
2025-12-01 20:37:18 +05:30
Sagar Vora
d48b0d1632 fix(search)!: validate ignore_user_permissions in link search 2025-12-01 19:03:55 +05:30
sokumon
632eb8e50b fix: use correct filter for dashboard 2025-11-27 17:03:52 +05:30
Akhil Narang
c7dcc0e097
Revert "fix: use number format from currency document if defined (#34886)" (#34906)
This reverts commit a8c835190d.
2025-11-26 10:50:28 +00:00
Akhil Narang
a1ba7969e1
fix(sqlite): user_sync query was wrong (#34897)
Adjust to use `ON CONFLICT` in a similar manner as the others

```
 File "apps/frappe/frappe/model/rename_doc.py", line 192, in rename_doc
    update_user_settings(old, new, link_fields)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/rename_doc.py", line 276, in update_user_settings
    sync_user_settings()
    ~~~~~~~~~~~~~~~~~~^^
  File "apps/frappe/frappe/model/utils/user_settings.py", line 52, in sync_user_settings
    frappe.db.multisql(
    ^^^^^^^^^^^^^^^^^^^
    ...<12 lines>...
    	as_dict=1,

  File "apps/frappe/frappe/database/database.py", line 1416, in multisql
    return self.sql(query, values, **kwargs)
           ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/database/sqlite/database.py", line 454, in sql
    return super().sql(*args, **kwargs)
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/database/database.py", line 272, in sql
    self.execute_query(query, values)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/database/sqlite/database.py", line 443, in execute_query
    return self._cursor.execute(query, values or ())
           ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 3, and there are 4 supplied.
```

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-11-26 15:15:05 +05:30
sokumon
8bf734bb4a fix: check for if the record exists 2025-11-26 14:40:58 +05:30
sokumon
d7c96412a4 fix: semgrep issue 2025-11-26 13:41:09 +05:30
sokumon
826b5f0a0f fix: handle renamed icons via removing icons with no fixture 2025-11-26 13:40:42 +05:30
sokumon
fd79a52695 fix: delete icon and sidebar based on workspace 2025-11-26 13:40:42 +05:30
sokumon
2c7f77afab feat: removal of orphan entities 2025-11-26 13:40:42 +05:30
Hussain Nagaria
a8c835190d
fix: use number format from currency document if defined (#34886)
* fix: use number format from currency if defined

* refactor: extract out function
2025-11-25 12:44:18 +00:00
Ankush Menat
81bc61fe97
chore: remove dead code 2025-11-19 21:15:58 +05:30
Akhil Narang
15588de6cd
fix(query): ensure backwards compatibility for sorting, filtering
If `db_query_compat=True` (set by `qb_query.py`), then we default to some `db_query.py` behaviour.
Otherwise, we'll retail the previous query builder behaviour, this is to minimize breakage on either side.

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-11-19 21:15:58 +05:30
Akhil Narang
7ad6f7e2c6
refactor: ensure no meta recursion
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-11-19 21:15:58 +05:30