Commit graph

2315 commits

Author SHA1 Message Date
Ankush Menat
d5a21a2676 fix: rename type validation
`None` can be passed which is acceptable here.

TODO: Make slackdict accept none as bool and convert to False
2023-10-16 18:12:53 +05:30
Ankush Menat
11dd961d81 refactor!: Method whitelisting
Document.whitelist doesn't work, no idea why it's doing all weird
`__func__` business.

`@frappe.whitelist()` works just fine.
2023-10-16 18:12:53 +05:30
Ankush Menat
52d6bd67e4 fix: Always return document from doc.insert 2023-10-13 15:34:03 +05:30
Akhil Narang
1482ad68c9 fix(model/document): add missing parameters to docstring
[skip ci]

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-10-13 14:51:39 +05:30
Akhil Narang
b601131d8f
fix: don't allow setting an invalid rating (#22633)
* feat: don't allow setting an invalid rating

Convert anything <0 to 0, and anything >1 to 1

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

* chore: add in tests for rating

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

---------

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-10-10 15:38:58 +05:30
Ankush Menat
cc292d6789 fix!: Last overriden method should be considered
Following same principle of last writer wins everywhere
2023-09-25 16:35:12 +05:30
Ankush Menat
6a2bfbf61d
fix: Ignore perm while updating module onboarding (#22448)
* fix: Ignore perm while updating module onboarding

* fix: incorrect error message
2023-09-18 09:00:53 +00:00
Ankush Menat
b409a05e8e fix: Ignore all non-import exceptions 2023-09-15 16:22:09 +05:30
Ankush Menat
c189b7e622 revert: syncing of report and pages 2023-09-15 16:22:06 +05:30
Ankush Menat
662b07170c test: orpahned doctype check after patch test 2023-09-15 16:18:25 +05:30
Ankush Menat
b9ee6827b4 refactor: stale object removal
- Do it after migration, post migration might use some old doctype.
- stale -> orpahn
- dont commit changes individually
- Remove table doctype too
2023-09-15 16:18:25 +05:30
14987
2937ba38db fix: Update get_doc filter 2023-09-15 16:18:25 +05:30
14987
31a1d37f0a refactor: Fix ambigious var name 2023-09-15 16:18:25 +05:30
14987
b9449a4f13 fix: Delete stale doctypes, reports and pages 2023-09-15 16:18:25 +05:30
Deepesh Garg
b3742b45a8
Merge pull request #22104 from GursheenK/doc-comparator
feat: audit trail
2023-09-13 14:04:15 +05:30
Gursheen Anand
177955a12f fix: check label for fields 2023-09-11 11:06:01 +05:30
Sagar Vora
bcc7cc9a3d
style: use functools.cached_property (#22304) 2023-09-04 16:50:25 +05:30
Ankush Menat
04b2c42778
Merge pull request #22239 from ankush/reveal_missing_perm
fix(UX): Highlight which permission is missing
2023-08-29 20:25:12 +05:30
Ankush Menat
edfeb0d932 fix(UX): Highlight which permission is missing 2023-08-29 19:11:58 +05:30
Ankush Menat
5fd0dfb163 fix: dont allow rename+merge for case changes 2023-08-29 18:03:16 +05:30
Ankush Menat
730e906dfd
refactor!: remove implicit primary key from logs (#22209) 2023-08-26 16:01:47 +05:30
mergify[bot]
fdcfb82f47
Merge pull request #22114 from gavindsouza/doc-bulk_insert-include_child
fix: Handle child record insertions via bulk_insert
2023-08-25 13:57:38 +00:00
Gavin D'souza
6b1609d277
fix: Cast documents iterable to list in db_insert 2023-08-25 16:12:48 +05:30
mergify[bot]
d6d82eb581
Merge pull request #22110 from resilient-tech/perf-as_dict-2
perf: undo regression in `as_dict` performance
2023-08-21 06:10:54 +00:00
Sagar Vora
7dc67f2feb chore: add back getattr for virtual docfields which get value from a property 2023-08-18 21:51:56 +05:30
Gavin D'souza
a996ff7f5b fix: Handle child record insertions via bulk_insert 2023-08-18 14:17:19 +00:00
Ankush Menat
d1495bb991 perf: ignore log links and disable in background jobs
Scheduled job type keeps getting updated for every scheduled job. This
is not required at all and not triggered by user.

This feature is for prioritizing user selected links, background jobs
should be ignored.
2023-08-18 17:47:58 +05:30
Sagar Vora
928bc46be3 perf: undo regression in as_dict performance 2023-08-18 17:44:45 +05:30
Gursheen Anand
0d80ffc988 fix: return df label only when not none 2023-08-18 11:01:55 +05:30
Ankush Menat
c7847395da
fix: remove thread-unsafe class attributes (#22097)
The problem is same as mutable defaults. Container type class attributes
are mutable and shared between all objects.

```python
class CLS:
    attr = {}
    ...

a = CLS()
b = CLS()

a.attr is b.attr  # => True
```
2023-08-17 20:11:20 +05:30
Ankush Menat
79392260d4
fix: autoincr caching and clear site cache after restore (#22079)
* fix: remove hazardous cache for autoincr

* fix: move cache to redis

* fix: clear all redis cache after restoring a site
2023-08-17 11:11:27 +05:30
mergify[bot]
fd10ab25cc
Merge pull request #22003 from gavindsouza/refactor-doc-bits
refactor: Use single query to delete child rows on doc.save
2023-08-11 06:45:07 +00:00
Ankush Menat
02e1311b3a build: pin typing_extensions to major version 2023-08-11 11:54:09 +05:30
Gavin D'souza
84f134a683
fix: Add "better" typing hints 2023-08-11 11:45:47 +05:30
Gavin D'souza
5554707148 refactor: Use single query to delete child rows 2023-08-10 06:29:18 +00:00
Ankush Menat
58568115a9
Merge pull request #21955 from barredterra/refactor-with-sourcery
refactor: run sourcery on all files
2023-08-10 10:11:20 +05:30
Ankush Menat
94e522185d
fix: configurable rename job queue (#21996)
This is useful for doctypes like company where very large number of
documents will be affected on a large DB.

original change:

fix: move rename enqueue action to long queue

When trying to rename company the job constantly fails.

possibly alternate fix to https://github.com/frappe/frappe/pull/21995

Job timed out because of 300 seconds timeout, no amount of optimization
will fix this because it's rewriting practically every row in
transactions.
2023-08-10 10:02:16 +05:30
barredterra
88c8baa9ee refactor: for append to extend, merge list extend
Replace a for append loop with list extend.
Create the list with values instead of creating
an empty list and extending it with another list.
2023-08-09 13:25:39 +02:00
barredterra
b553ed98d8 refactor: inline immediately returned variable
Inline a variable to a return in the case when the
variable being declared is immediately returned
2023-08-08 18:09:49 +02:00
Ankush Menat
f6326b6145
fix: check before deleting prepared report (#21950) 2023-08-07 14:00:34 +05:30
Raffael Meyer
5fce1a57c0
fix: validate fieldname in get_group_by_count (#21932)
* fix: validate fieldname in get_group_by_count

* test: call get_group_by_count with invalid field

* test: is_default_field
2023-08-06 17:33:34 +05:30
Ankush Menat
8817c228a2 fix: filter schema name on mariadb 2023-08-04 14:33:17 +05:30
Ankush Menat
fd15ab5329 fix: revert pg incompatible change 2023-08-04 14:13:36 +05:30
Ankush Menat
c4230f8760
fix: autoincr status per doctype (#21918)
* fix: autoincr status per doctype

closes https://github.com/frappe/frappe/issues/21386

* chore: Check autoincremented on the database currently being used.

* refactor: Styling and space fix

---------

Co-authored-by: Athul Cyriac Ajay <athul8720@gmail.com>
2023-08-04 13:59:39 +05:30
Raffael Meyer
dc0a8c5ccb
fix: keep privacy setting of attachments on amend (#21911) 2023-08-03 15:33:39 +05:30
Shariq Ansari
e1c1e256ef
Merge pull request #21798 from pps190/frappe/fix/ambigus-table-join 2023-07-28 12:28:04 +05:30
Ankush Menat
c40faddac7
perf: skip reset_seen for new doc (#21832)
The query is fired but document doesn't exist yet, so it does nothing really.

[skip ci]
2023-07-27 16:07:22 +05:30
Ankush Menat
8930d4b5e1
perf: drop ifnull from IS SET filter (#21822)
- Kinda confuses query planner (idk why it's not smart enough to
  understand but there are probably edge cases where it can't be done)
- `null != null` and `'' != null` both yield `null` which is falsy and
  won't be shown in results.

Alternate fix to https://github.com/frappe/frappe/pull/21817
2023-07-27 10:58:20 +05:30
Devin Slauenwhite
7a3e7b7eb2 Merge remote-tracking branch 'frappe/develop' into frappe/fix/ambigus-table-join 2023-07-24 14:23:28 -04:00
Ankush Menat
0bc5d1dc3b feat(DX): type annotated python controllers 2023-07-24 15:32:46 +05:30