Commit graph

2480 commits

Author SHA1 Message Date
David
fe73c9f1aa
feat: add value tracer for test debugging 2024-09-05 21:58:19 +02:00
gavin
8aed92d569
Merge pull request #27618 from barredterra/refactor-data-field-validation
refactor: data field validation
2024-09-05 11:43:12 +02:00
marination
a893341f95 fix: get_valid_fields excludes show_on_timeline, breaking migrations
Co-authored-by: Gavin <gavin.dsouza@switchup.de>
2024-09-02 17:27:50 +02:00
barredterra
6ba7e8e11d fix: skip all validation if there's no data 2024-09-02 15:49:41 +02:00
barredterra
8836978b86 refactor: import validation utils 2024-09-02 15:49:08 +02:00
Gavin D'souza
074da5c553
fix: Separate meta.get_valid_fields from *columns 2024-08-28 18:12:42 +02:00
Gavin D'souza
151de897f1
fix: Use doc.get to safely check for attr
This bypasses the bungle during site creations when meta isn't present in
the database yet
2024-08-28 11:59:25 +02:00
Gavin D'souza
12e3cee4a6
fix!: Skip virtual fields in meta.get_valid_columns 2024-08-28 11:42:43 +02:00
Ninad1306
827acd2975 fix: update child table value from the last doc 2024-08-23 12:47:08 +05:30
Sagar Vora
3eeeab72a2
Merge pull request #27346 from Ninad1306/before_mapping
fix: Before Mapping the Doc run `before_mapping` hook
2024-08-22 15:11:33 +05:30
Akhil Narang
00401f741f
Merge pull request #27205 from barredterra/strings-in-validate_value
fix: translatable strings in doc.validate_value
2024-08-20 17:12:00 +05:30
Ninad1306
19ded8361b fix: before mapping the doc run before_mapping hook 2024-08-08 17:54:09 +05:30
Rushabh Mehta
774d86f642 feat: Workspace Settings - allow enabling and disabling of workspaces during setup 2024-08-04 13:41:08 +05:30
barredterra
4f3b096f64 fix: translatable strings in doc.validate_value 2024-07-24 18:38:22 +02:00
Akhil Narang
5e95e51219
fix: don't trigger Value Change notifications for deleted documents
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-07-16 18:07:15 +05:30
Akhil Narang
f2d418ce43
Merge pull request #27100 from gavindsouza/misc-fixes-12_07_24
fix: Misc fixes
2024-07-15 17:50:11 +05:30
Gavin D'souza
84919bfe8e
fix: Typing hint for Document.get_doc_before_save 2024-07-15 09:25:08 +02:00
mahsem
2910ac65cb fix: translation in document.py
fix: translation in document.py
2024-07-11 12:03:15 +00:00
Raffael Meyer
fd9e80e364
feat: nudge for all DocTypes that can be disabled, not deleted (#27067)
Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
2024-07-11 05:18:19 +00:00
Markus Lobedann
8badd16f1f
fix: don't run setattr for a virtual (read-only) field (#26365) 2024-07-03 16:27:27 +02:00
gavin
e19634fba2
fix: bulk_insert child tables malformed (#26876)
Generator within generator caused something funky to happen which meant wrong values being stitched together as one document, sometimes(?)

Via https://github.com/frappe/frappe/pull/22114
2024-06-27 15:58:29 +02:00
Gursheen Anand
8bfb213481 fix: syntax error for link field query 2024-06-25 18:46:41 +05:30
Ankush Menat
820a6edae8
fix: Skip virtual fields in all select queries (#26700) 2024-06-06 09:43:36 +00:00
Ankush Menat
005e74b20d
perf: Avoid coalesce for between filters (#26531)
- Avoid on `between` + date
- Avoid on timestamp fields
- Avoid on `>` and `>=` comparisons
2024-05-22 09:32:59 +00:00
Ankush Menat
025727674f
fix: scheduled type syncing (#26490)
- Scheduled Job sync when type was changed from scheduled to some other
  type didn't work.
- It updates on every save with message, bad DX IMO (can't save script
  and edit without dismissing)
- This was because of complex walrus which was triggering rest of code
  even when nothing changed. Maybe walrus opponents were onto something.
- `Truthy` couples two different operations and hence makes code
  complicated. In most cases where these checks are required it's not
  performance critical, we can do 1 more function call to avoid this
  coupling of change + actual value.
2024-05-20 13:43:20 +00:00
Ankush Menat
803f7b3990
fix: Don't fiddle with child table indexes (#26450)
- Link fields when referred to increase idx
- This is used in search.py to rank most referred documents higher than
- This doesn't make for child table links at all.
2024-05-16 17:09:56 +05:30
Ankush Menat
bbf18d39cc
Merge pull request #26369 from gavindsouza/refactor-scheduled-server_script
refactor!: Server Script (Scheduler Event) & misc APIs
2024-05-13 20:25:29 +05:30
Raffael Meyer
da740081c6
fix: make rename_doc work pre_model_sync (#26419) 2024-05-13 13:32:23 +05:30
Ankush Menat
53517630ae
fix: Increase folder link field size (#26381)
* fix: increase folder length to 255

File `name` is 255 because it's bootstrapped using mariadb.sql, so users
can create 255 char long folders but can't store anything in it.

* fix(UX): slightly better character len message

Highlight field by making it bold.
2024-05-09 12:10:21 +05:30
Gavin D'souza
ffbf7fb9d1
fix!: Document.has_value_changed returns Truthy or False
- Return changed value to avoid re-accessing previous object & it's
   attribute
 - Wrap returned value as Truthy to avoid breaking change in API
2024-05-07 17:29:48 +02:00
Ankush Menat
ff31290d33
Merge pull request #25971 from rutwikhdev/discard-transactions
feat: Discard transactions
2024-04-29 16:08:37 +05:30
Ankush Menat
7b0074e059
refactor!: override_doctype -> Must extend base class (#26152)
* fix: pointless conditions about systemd/supervisor

What does this have to do with hostname?

* fix!: Overriden doctypes must inherit same base class

There is almost never a real need to completely override a class. After
this change we'll only allow extending and not overriding completely.
2024-04-29 10:21:53 +00:00
Ankush Menat
1e4c182b52
fix: retry count per doc instead of global (#26159) 2024-04-25 09:34:52 +00:00
Rutwik Hiwalkar
657faea60d chore: drop dead comment 2024-04-23 21:11:55 +05:30
Rutwik Hiwalkar
fa18de6302 chore: check_if_latest for discard action 2024-04-23 20:35:36 +05:30
Kareem Kouddous
27948bccc7
fix: Renaming when doctype is used as a virtual link docfield fails (#26025) 2024-04-23 11:35:30 +00:00
Rutwik Hiwalkar
5335d6c19c chore: revert transition rule for 0 to 2
doing explicit transition check for discard because,
* there's only one transition check that is required
* draft(0) > cancelled(2) and submitted(1) > cancelled(2) are valid
  checkes for save so it doesn't make sense editing
  check_docstatus_transition
2024-04-17 20:51:04 +05:30
Rutwik Hiwalkar
82d61b32e4 fix: misc fixes for discard action
* use write perms instead of cancel
* update docstring
* remove discard from global namespace
2024-04-17 12:32:34 +05:30
Rutwik Hiwalkar
b274c45992 feat: discard draft transactions 2024-04-16 19:46:34 +05:30
Akhil Narang
23be301046
Merge pull request #25902 from akhilnarang/minor-cleanup
chore: minor code cleanup
2024-04-12 11:21:38 +05:30
Akhil Narang
306c923986
chore: minor code cleanup
- Use walrus operator where possible
- Drop redundant checks - we anyway can't iterate over an empty list

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-04-10 17:22:45 +05:30
Ankush Menat
caf7aec286
feat(APIv2): Add comment via REST API (#25889)
```
POST /document/Sales Order/S0-123/add_comment
{
    text: "Comment"
}
```
2024-04-10 10:53:22 +00:00
Revant Nandgaonkar
7e16e902d9
feat: allow wildcard for doctype in permission hooks (#25729)
* feat: allow wildcard for doctype in permission hooks

* fix: pass doctype to permission query

* fix: combine methods instead of alternate

* test: wildcard has_permssion hook

* test: wildcard has_permssion make note public

* fix: fetch list of hooks once
2024-04-10 11:44:37 +05:30
Ankush Menat
b493bfe7c2 fix(DX): annotate chainable methods with Self return 2024-04-06 11:04:55 +05:30
Ankush Menat
30f00fd5f3 fix: invlaid integer validations for biging
closes https://github.com/frappe/frappe/issues/25566
2024-04-06 11:04:55 +05:30
Ankush Menat
1ec4d658fc fix: Allow setting UUID to application code 2024-03-29 19:02:28 +05:30
Ankush Menat
6c79a13641 feat: UUID naming support 2024-03-29 19:02:28 +05:30
Ankush Menat
87ffe25e71
fix: reserved keywords as col name (#25718) 2024-03-29 15:43:33 +05:30
Ankush Menat
23204c0c05
Merge pull request #25256 from ankush/no_commit_doc_events
fix: disable transaction commits during doc events
2024-03-28 12:28:12 +05:30
Ankush Menat
f66b23b96d fix: handle nested event calls
Treat disable_transaction_control as a stack incr/decr when moving in
and out of context.
2024-03-28 11:27:24 +05:30