Commit graph

2807 commits

Author SHA1 Message Date
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
Akhil Narang
0ea49a8f1e
fix: make sure limit is an integer
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-11-19 21:15:57 +05:30
Akhil Narang
1d2a73f659
fix: support virtual doctype handling
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-11-19 21:15:57 +05:30
Akhil Narang
7183caf871
fix(query_builder): default sorting based on doctype meta
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-11-19 21:15:57 +05:30
Akhil Narang
977aee5ab3
refactor: backticks aren't allowed in order_by or group_by
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-11-19 21:15:57 +05:30
Akhil Narang
340fe279b3
feat: add in initial version of DatabaseQuery using query builder
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-11-19 21:15:57 +05:30
Rohit Waghchaure
2b0ee31cb4 fix: read lock applied while fetching the current value from the tabSeries 2025-11-18 11:51:10 +05:30
Saqib Ansari
d4a0181379
Merge pull request #33905 from nextchamp-saqib/custom-perm-types
feat: custom permission types
2025-11-17 16:00:17 +05:30
Saqib Ansari
96d380b6d3 fix: sync permission types before doctypes 2025-11-15 14:07:32 +05:30
sokumon
ad03236e01 feat: Sidebar Group Item 2025-11-14 23:05:14 +05:30
sokumon
c057c730c5 refactor: make app level folders first class 2025-11-14 23:05:12 +05:30
sokumon
9658ca1642 feat: export and sync workspace sidebar and desktop icon 2025-11-14 23:05:11 +05:30
Saqib Ansari
010351cee2 refactor: single perm type for multiple doctypes
problem: if same perm type is defined in two different apps, we'd have to handle the merging of `doc_types` multi-select field
2025-11-14 14:49:36 +05:30
Saqib Ansari
619649589d fix: sync permission type doctype before importing custom perm types 2025-11-10 12:35:58 +05:30
Raffael Meyer
afefeb5dc1
refactor: allow defer_insert in doc.log_error (#34631) 2025-11-07 12:35:50 +01:00
Saqib Ansari
2f3af6adf1 feat: make permission type exportable 2025-10-30 14:05:01 +05:30
Saqib Ansari
f687f2a457 Merge branch 'develop' of https://github.com/frappe/frappe into custom-perm-types 2025-10-30 13:08:14 +05:30
Raffael Meyer
c55372a3b3
Merge pull request #34435 from barredterra/distinct-order-by-mariadb
fix(DatabaseQuery): allow distinct order_by for MariaDB
2025-10-24 12:28:05 +05:30
Ankush Menat
727775f820
Merge pull request #33088 from ankush/computed_child_table
feat: Computed/virtual child-tables
2025-10-15 18:32:16 +05:30
Akhil Narang
984c641bff
fix(sanitize_fields): use sqlparse for function detection
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-10-14 16:10:14 +05:30
Sagar Vora
a93530e221 Merge branch 'develop' into computed_child_table 2025-10-14 12:53:32 +05:30
Sagar Vora
2a42f0688f chore: update docstring 2025-10-14 12:41:58 +05:30
Sagar Vora
a084f5a2f3 refactor: separate only computed CTs, with new include_computed flag 2025-10-14 12:31:47 +05:30
Sagar Vora
7522b79f57 chore: remove unused import 2025-10-14 12:02:36 +05:30
Sagar Vora
ae21d544a5 fix: add fallback when getting children in as_dict 2025-10-13 11:48:03 +05:30
Aarol D'Souza
4ecb9bc57d
fix: clear cache and prevent data access after DocType deletion (#34307)
* fix: clear cache and prevent data access after DocType deletion

* fix: Handle potential DB failures during migrate

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2025-10-10 08:00:51 +00:00
Ejaaz Khan
e7832bfd4b
Merge pull request #32684 from iamejaaz/32489-role-perm-based-masking
feat: show mask data in form, list and report view
2025-10-09 10:55:50 +05:30
Akhil Narang
777460c5fb
Merge pull request #34217 from frappe/mergify/copy/develop/pr-34171
fix: Issue with certain DocType Names (copy #34171)
2025-10-01 17:35:09 +05:30
Akhil Narang
9d9789b752
fix(db_query): adjust doctype name detection
Add tab prefix, and replace with `" doc "` hardcoded string

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-10-01 15:51:48 +05:30
Eben van Deventer
2e707c8a33
fix(db_query): Issue with certain DocType Names
The previous update broke systems where DocTypes exist that contains names like Union or Select

(cherry picked from commit f997d40c56d717693c66a8b7e69d12462a673ede)
2025-10-01 15:49:04 +05:30
Soham Kulkarni
c6c91435fb
fix: pass the argument to delete_doc via rename_doc (#34226) 2025-10-01 15:15:27 +05:30
Sagar Vora
3264fb0f12 fix: missing flag 2025-10-01 12:59:48 +05:30