Commit graph

2369 commits

Author SHA1 Message Date
Aarol D'Souza
59b440cb28
fix(search): make QB DB-Aware when using Locate (#35796)
* fix: make QB DB-Aware when choosing Locate

* fix(test): adjust test to check smarter qb choice based on db
2026-01-12 12:06:28 +05:30
Sagar Vora
40c7d27e4f fix!: disallow setting link values not matching filters 2026-01-10 13:25:35 +05:30
Akhil Narang
d02d89436e
fix(qb): support reportview alias format
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2026-01-06 19:30:14 +05:30
AarDG10
8d99bed738 fix(test): maintain sanity to avoid unexpected test failures in postgres 2026-01-03 13:54:27 +05:30
sokumon
fa6744beaa fix(test): note customization yields tuple with 3 values 2026-01-02 18:50:24 +05:30
Kevin Shenk
e2f73318c1
feat: import custom DocType Links on app install/migrate (#34516)
* feat: import custom DocType Links

* fix: add link_fieldname check to doctype link import

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* test: add Doctype Link import test

* chore: fix linter issues

* chore: fix linter issues

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-02 17:39:17 +05:30
Faris Ansari
1f9460f1c2 fix: deduplicate documents in search index while updating 2025-12-31 18:06:44 +05:30
Aarol D'Souza
799123c341
perf(postgres): skip unnecessary migrations due to type mismatch (#34784) 2025-12-29 18:29:22 +05:30
Ejaaz Khan
f09dc7cc07
Merge pull request #34563 from KerollesFathy/ft/add-apply-module-export-filter-on-export-customization
feat: Add Apply Module Export Filter on Export Customization Dialog
2025-12-23 22:16:00 +05:30
Aarol D'Souza
48c8ee9a78
feat(postgres): add unbuffered cursor in postgres (#35016)
* feat(postgres): add unbuffered cursor in postgres

* test: add unbuffered_cursor test for Postgres
2025-12-23 17:21:28 +05:30
Akhil Narang
7aec123a29
chore: drop some version checks
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-12-22 21:06:48 +05:30
Akhil Narang
90a40dbfe0
fix: ruff manual 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
588cb1e44d
refactor: tomli -> tomllib
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-12-22 21:06:48 +05:30
Sagar Vora
a13f02a240
Merge pull request #35343 from neox-d/fix-single-doctype-join 2025-12-22 12:27:59 +05:30
Sagar Vora
2a36631997 test: add tests for child tables of single doctypes 2025-12-22 12:15:23 +05:30
sokumon
dd2dc053ca chore: more renames to /desk 2025-12-18 20:45:04 +05:30
sokumon
709169a538 chore: clean desktop icon controller 2025-12-18 14:20:00 +05:30
Sagar Vora
cc731988ce
Merge pull request #35303 from sagarvora/improve-perm-conds 2025-12-17 22:38:36 +05:30
Sagar Vora
d1ffd99fe8 fix(query): wrap CombinedRawCriterion in parentheses for correct precedence
Without proper grouping, OR conditions from shared docs could bypass WHERE filters:
  WHERE filter=X AND perm_cond OR shared_cond  -- shared_cond ignores filter!

With proper grouping:
  WHERE filter=X AND (perm_cond OR shared_cond)  -- correct behavior
2025-12-17 22:28:52 +05:30
Sagar Vora
b76706ac28 test: improve single query test 2025-12-17 19:30:32 +05:30
Sagar Vora
591d9a3535 fix: update logic for child tables 2025-12-17 19:03:15 +05:30
Ankush Menat
9979314b32 test: commit to trigger sendmail 2025-12-17 16:36:06 +05:30
Ankush Menat
71692b487b fix!: sendmail now=True after current transaction is commited
Sendmail implicitly commits transaction to update status.

Do it after the parent transaction is commited.

closes https://github.com/frappe/frappe/issues/33343
2025-12-17 15:53:16 +05:30
Ankush Menat
02ecb10205
fix!: Remove badly written default portal list views (#35182)
* fix!: Remove badly written default portal list views

* fix!: Remove guest permissions from web form list endpoint

* test: cleanly terminate gunicorn

int sometimes ends up leaving socket open
2025-12-14 07:11:45 +00:00
Raffael Meyer
e9c81f38bc
refactor: remove ignored params from call (#35185) 2025-12-11 12:47:11 +01:00
Abdeali Chharchhodawala
4647986aeb
fix!: Always Bold report header row (#34703)
* fix: Always bold report header row

* fix: update test cases

* refactor: add option to bold filter rows in XLSX output

* chore: minor changes

* chore: rename index variable

* revert: undo bold filters param use

* refactor: remove duplication for building xlsx data

* revert: add has_filters parameter to check for filter row bold

* refactor: add type hints and docstrings for XLSX data handling functions
2025-12-11 15:55:51 +05:30
Sagar Vora
2b9752097f
refactor!: deprecate older web view links (#35150) 2025-12-10 18:12:49 +05:30
Soham Kulkarni
c22a1937b5
Merge pull request #35067 from sokumon/remove-orphans 2025-12-10 18:01:14 +05:30
Akhil Narang
4751bc06d7
Merge pull request #35103 from Z4nzu/fix/email-validation-rfc5322-27337
feat(utils): replace custom email parsing with RFC-compliant validation
2025-12-10 15:54:13 +05:30
KerollesFathy
d07a90092f test: add unit tests for exporting customizations with module filter 2025-12-09 12:30:18 +00:00
Akhil Narang
66ef5bf2ca
Merge pull request #35092 from akhilnarang/return-query-object
feat(qb_query)!: return query object if requested
2025-12-09 12:21:48 +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
Akhil Narang
207ee7a367
fix(query): match between behaviour for datetime fields with db_query
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-12-08 20:06:32 +05:30
sokumon
84f16525e3 fix: add test for removing orphan entity 2025-12-08 16:44:13 +05:30
Hardik Zinzuvadiya
b5f22227ab feat(utils): replace custom email parsing with RFC-compliant validation (fixes #27337)
Replaced the old comma-split based email parsing with `email.utils.getaddresses`
to correctly handle RFC 5322 formatted addresses, including display names
containing commas (e.g. `"Last, First" <email@example.com>`).

The previous implementation incorrectly split on commas and treated parts of
display names as standalone emails, causing valid inputs to fail validation and
breaking Communication creation (e.g. `"Gritton, Howard" <hgrit@example.com>`).

The new validator:
- correctly parses display names with commas
- handles multiple addresses and multiline input
- skips undisclosed recipients
- preserves existing EMAIL_MATCH_PATTERN validation
- returns only the email addresses (same as before)

Added additional test cases covering RFC-compliant inputs and empty-addr scenarios.
Fixes frappe/frappe#27337.
2025-12-07 06:38:12 +00:00
Akhil Narang
da92e7cd36
Merge pull request #35083 from ankush/monitor_test
test: automatically print stuck tests
2025-12-05 14:18:22 +05:30
Ankush Menat
a6db2d0429 test: Dump log for any stuck test 2025-12-05 13:16:24 +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
Aarol D'Souza
cf69e4bed1
fix(postgres): misc query building fixes + CI (#34831)
* fix(query): check standard field definitions

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

* fix(postgres): fix order_by problem in pg

* fix(postgres): fix order_by in get_all for _test_connection_query

* fix: add check to a proper numeric fallback in _get_ifnull_fallback

* test(postgres): fix pg query used in assertion in test_permission_query

* fix(postgres): fix order_by in get_all for possible_link

* fix(postgres): fix order_by in get_all for set_modules

* fix(postgres): fix pg query count *

* fix(postgres): fix order_by in get_all for ask_pass_update

* fix(postgres): fix order_by statement in search_widget

* fix(postgres): fix order_by in get_list for get_stats

* test(postgres): normalize_sql for pg queries in test_arithmetic_operators_in_fields

* test(postgres): normalize_sql for pg queries in test_field_alias_in_group_by

* test(postgres): normalize_sql for pg queries in test_field_alias_permission_check

* test(postgres): fix order_by statement in get_all for test_db_keywords_as_fields

* test(postgres): fix order_by statement in get_all for test_prepare_select_args

* fix(treeview): use 0 instead of false to check since check field is an integer

* fix(postgres): fix order_by in get_all for sync_communication

* fix(postgres): fix order_by in get_all for get_references_across_doctypes_by_dynamic_link_field

* test(postgres): fix order_by in get_all for test_list_summary

* fix(postgres): fix order_by in get_all for email queries

* test(postgres): use order_by none and update assertion for postgres

* fix(postgres): use ILIKE to support case insensitive search in postgres

* test(test_query): update pg specific query assert to use ILIKE

* test(test_query): update test_nested_filters to use ilike instead for PG

* test(postgres): update pg query in assert to test updated qb query

* fix(search): update query to be db-agnostic

* test(postgres): normalize query for pg in test_build_match_conditions

* fix(postgres): suppress ORDER BY when SELECT DISTINCT in query for postgres specific behavior

* fix(postgres): suppress ORDER BY when GROUP BY is explicitly asked for pg specific behavior

* test(postgres): fix test behavior for pg ORDER BY drop when used with GROUP BY

* refactor: reducing noise in code by formatting code

* fix(query): use Star() to handle SQL wildcard character * correctly

* fix(postgres): display warning for ORDER BY fields that will be dropped

---------

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Co-authored-by: Akhil Narang <me@akhilnarang.dev>
2025-12-05 10:30:49 +05:30
Sagar Vora
e5b34d8af3
Merge pull request #35058 from sagarvora/remove-extra-param 2025-12-04 11:18:03 +05:30
Sagar Vora
8b8c2c800e chore: remove extra parameter form_doctype from search_link 2025-12-04 10:51:07 +05:30
Raffael Meyer
93a9f3c41d
test: implement datetime field validation tests (#34912) 2025-12-03 02:48:48 +01:00
Sagar Vora
00dd0ba6c7
fix!: use Field instead of Column for field-to-field comparison in query filters (#35012) 2025-12-02 06:24:41 +00:00
Sagar Vora
de37b8f397
Merge pull request #34995 from sagarvora/fix-search-link 2025-12-01 19:32:06 +05:30
Sagar Vora
d48b0d1632 fix(search)!: validate ignore_user_permissions in link search 2025-12-01 19:03:55 +05:30
Sagar Vora
5bcfa65b9e
Merge pull request #34976 from sagarvora/fix-validate-link-child-table-fetch
fix(client): pass parent_doctype when fetching fields for child table links
2025-12-01 02:07:06 +05:30
Sagar Vora
652cd169de fix(client): pass parent_doctype when fetching fields for child table links 2025-12-01 01:57:03 +05:30
Aarol D'Souza
a7d8495d7b
test: skip DB-specific tests using new unimplemented_for decorator (#34749)
* test: skip DB-specific tests using new unimplemented_for decorator

* test: use unimplemented to skip tests with implementation problems

* test: update unimplemented to consider multi-DBs

* test: skip test_unbuffered_cursor using unimplemented for pg and sqlite

* test: update unimplemented wrapper
2025-11-28 06:51:45 +00:00
Raffael Meyer
3df2721dd7
refactor(test_search): foreign language search tests (#34869) 2025-11-24 19:32:54 +01:00