Commit graph

1866 commits

Author SHA1 Message Date
Hussain Nagaria
b9fef7eb8d test: base class update on has web view update 2023-12-29 22:02:38 +05:30
Ankush Menat
4a8fb6c43c style: format 2023-12-28 19:16:11 +05:30
mergify[bot]
a9bb994f15
fix!: deterministic fixture import order (#22210)
* feat: #20753 fixture export prefix and fixture import order

(cherry picked from commit 6a9c56a568e4ccf181fe9cb4153d0b9e4f02ac3d)

* refactor: clarify prefix logic, see c4866921df (r1196249038)

(cherry picked from commit cd2519e71e5545bd4c706369df3ea05843a0bfd9)

* style: format

* refactor: conditionally sort documents when importing

* refactor: simplify code

* feat: Unittest as requested in https://github.com/frappe/frappe/pull/22210#discussion_r1331587501

---------

Co-authored-by: To Finke <tom.finke@webterra.de>
Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-12-28 14:24:45 +05:30
Akhil Narang
70bb2f45bb
Merge pull request #23590 from GursheenK/treeview-filters 2023-12-27 19:03:05 +05:30
Akhil Narang
9bf818eb4a
chore: add in some tests for backup
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-12-26 11:09:08 +05:30
Ankush Menat
4d68a46b10
fix: Set default child table fields on save (#23913)
We set defaults on creation of new doc but when you append a new child
doc on existing document it doesn't seem to set the defaults.

This seems like a bug and not a deliberate choice.
2023-12-22 08:02:36 +00:00
Akhil Narang
ff4dca3e16
fix(redirect): make the status codes a select field instead of int
Drop mandatory, assume sane defaults
The current implementation broke old users of redirects like helpdesk app

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-12-22 12:25:41 +05:30
Ankush Menat
36451b6951
Merge pull request #23765 from akhilnarang/http-307-redirect
feat: allow setting a custom http status code for redirects
2023-12-21 13:53:51 +05:30
Ankush Menat
0fd6f5eed7
Merge pull request #23827 from frappe/api-docs
docs: add Python API missing docstrings / type hints
2023-12-21 12:13:05 +05:30
Akhil Narang
2224d86c94
refactor: cache status code as well
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-12-20 17:47:16 +05:30
Akhil Narang
c8816a8b6a
fix(tests): fix redirect tests by adding new field + add another test scenario
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-12-20 17:36:42 +05:30
Ankush Menat
052a2527dd
Merge pull request #23874 from ankush/del_check_links
fix: don't allow deleting original doc if amendment exists
2023-12-20 14:13:41 +05:30
Ankush Menat
02f3fd8470 test: retry flaky password_strength test thrice 2023-12-20 13:57:48 +05:30
Ankush Menat
b51a479fc2 fix: don't allow deleting original doc if amendment exists 2023-12-20 13:11:34 +05:30
Ankush Menat
5ecacd0cd7
Merge pull request #23865 from ankush/no_virtual_select_star
fix: skip virtual fields in perm level checks during DB Query
2023-12-20 12:15:48 +05:30
Ankush Menat
5deabdde21 fix: skip virtual fields in perm level checks during DB Query
DB Query can't access virtual fields so it should ignore all virtual
fields.
2023-12-20 12:00:08 +05:30
Akhil Narang
178b699466
Merge pull request #23432 from marination/doc-connections
fix: Treat Document Links entries as all non-std fields
2023-12-19 16:05:58 +05:30
Hussain Nagaria
8d2137c265 docs: consistent doc strings 2023-12-18 18:27:39 +05:30
Suraj Shetty
2564d0e939
Merge pull request #23512 from GursheenK/include-filter-values-in-exported-report-excel 2023-12-18 12:40:37 +05:30
Ankush Menat
40e48c9ac4
feat: describe-database-table to get stats about a table (#23813)
* feat: `describe-database-table` to get stats about a table

This provides description of table, indexes, total row count in machine
parseable format.

Towards https://github.com/frappe/press/issues/1265

* Update test_commands.py
2023-12-15 17:53:11 +05:30
Gursheen Anand
796e958910 test: treeview for disabled records 2023-12-15 15:00:36 +05:30
Ankush Menat
b7c2989823
feat: add-database-index command to add and persist custom indexes (#23787) 2023-12-14 15:16:49 +00:00
Ankush Menat
687752359d
perf: Primary key is never nullable (#23788)
People ususally write queries like these...

```
frappe.get_all(doctype, {"name": ("in", list_of_docs))
```

Ocassionally, the `list_of_docs` is empty because it's dynamically
generated and in this case we end up doing full table scan to find... nothing!
2023-12-14 15:01:19 +00:00
marination
c648e4fc9a style: Linter 2023-12-11 18:24:28 +01:00
Shariq Ansari
adbd88d394 test: fixed failing test 2023-12-08 15:20:50 +05:30
Ankush Menat
a1bfdf28a2
Merge pull request #23659 from shariquerik/ar-export-excel-fix
fix: use encoded filename for arabic (latin) language while exporting
2023-12-07 18:10:42 +05:30
Shariq Ansari
f679f65aa5 test: unit test to check arabic filename export 2023-12-07 13:42:24 +05:30
barredterra
c35476256f refactor: simplify conditional logic
Command: `sourcery review --fix --enable de-morgan .`
2023-12-05 11:14:41 +01:00
Bernd Oliver Sünderhauf
2940ae1452
test: Add unittest for translation import & export. (#23570)
* test: Add unittest for translation import & export.

* test: Simplify test_read_language_variant.

* test: read correct path

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-12-03 06:37:57 +00:00
Ankush Menat
1ef44c90e2
Merge pull request #23320 from HarryPaulo/fix-translation-file-path
fix: load languages that have capital letters
2023-12-02 19:58:15 +05:30
Bernd Oliver Sünderhauf
a8e0ea3109 test: Add failing tests for language variant precedence. 2023-12-02 19:57:43 +05:30
ruthra kumar
0a7c0593da refactor: execute the last instance of a webhook in a request 2023-12-01 15:15:43 +05:30
Gursheen Anand
4e382fb217 test: build_xlsx_data with filters 2023-12-01 13:09:31 +05:30
Ankush Menat
957293bd54 fix: Only preload icons for desk 2023-11-29 21:50:18 +05:30
marination
17cd3e9b3e test: Custom doctype links having non std fieldname with dashboard override 2023-11-24 19:19:28 +01:00
Ankush Menat
866a0295e3 fix: bulk submit/cancel/update in background jobs 2023-11-24 16:38:04 +05:30
Ankush Menat
d715b0ad31
Merge pull request #22804 from akhilnarang/non-nullable-fields
feat: allow setting fields as not nullable
2023-11-20 12:46:02 +05:30
Akhil Narang
eb45da3913
feat: Allow usage of print() within safe_exec() (#23084)
* feat(safe_exec): allow usage of `print()`

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

* refactor(system_console): update description to mention `print()` instead of `log()`

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

* feat: unconditionally add debug logs to response if present

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

* chore(safe_exec): add in a test for running `print()` within safe_exec

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

* fix(safe_exec): ignore warning

RestrictedPython warns us if we call `print()` don't use their `printed` variable

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

* feat: store debug logs from scheduled jobs

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

* fix: avoid ignoring warnings, disabled in prod anyway

* chore: remove unnecessary logging

This can be moved to level 2 when required

---------

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-11-20 12:45:41 +05:30
Revant Nandgaonkar
53b8ab9a9d test: fix test auth_hooks 2023-11-17 17:59:13 +05:30
Revant Nandgaonkar
2dd376543a fix: pre-commit errors 2023-11-17 16:27:21 +05:30
Revant Nandgaonkar
29d8f2a568 test: test auth_hooks 2023-11-17 15:56:17 +05:30
Akhil Narang
ea7f611745
fix: adapt tests to actually work
Couldn't seem to sanely get postgres default state

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-11-16 16:14:50 +05:30
Akhil Narang
b88f3597fa
chore: add in tests for non-nullable field
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-11-16 14:51:57 +05:30
Akhil Narang
659cbcb88f
refactor(scheduler): drop unused parameter (#23174)
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-11-11 11:29:12 +05:30
Ankush Menat
3905e8970a test: smtp integration test using smtp4dev 2023-11-04 15:26:40 +05:30
Ankush Menat
4e318a0280 fix: Abort flushing email queue if >50% fail.
When email queue batch failes >33% with >10 count, frappe will now abort
sending emails.

We already notify users via system notification so this
assumes that user will notice it and fix it in sometime.

With previous commits we also prioritize fresh emails over retries.
2023-11-04 11:25:09 +05:30
Ankush Menat
c4815ff987 fix!: Don't silently fail API auth 2023-11-01 17:51:23 +05:30
Ankush Menat
385fa8aaef
fix!: Correct between filtering (#22918)
* fix: Remove incorrect fallback

If you do +1 on date it will also start considering next date. This was
only done to accomodate date filter on datetime fields. Which also
doesn't really work.

* refactor: simplify fieldtype detection

* fix!: Correct datetime fallbacks for between filters

* chore: remove unncessary test

This is very specific and introduces flake when the job tests run before
it.
2023-10-26 06:23:14 +00:00
Ankush Menat
08b92858a3
fix: ignore duplicate perm check on assign hooks (#22832)
* fix: Ignore permissions while assigning if flag set

* fix: Avoid double permission checks on assignment rule

When it's triggered via doc events either:
- Permission check is done or
- Permission checks are not applicable
2023-10-20 06:18:19 +00:00
Ankush Menat
05d6f5cc8a test: Add cold start tests 2023-10-18 17:55:48 +05:30