Akhil Narang
84ef6ec677
refactor: fixup with ruff 0.8.1
...
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-12-04 13:18:04 +05:30
l0gesh29
35d8ff40ec
feat: validate amended from record docstatus
2024-11-28 17:04:44 +05:30
David Arnold
6f35a554a5
fix: make read only mode thread safe ( #28359 )
...
* fix: Apply read_only_method decorator to Document methods
* fix: update tests for read-only document context manager
* refactor: place mappers into read-only mode
Reapply "refactor: place mappers into read-only mode"
This reverts commit a8208d57069c63f0982bf2881bcad28a4b349f3c.
read-only mode is now thread safe
2024-11-18 15:00:50 +01:00
Raffael Meyer
69a8a362f6
fix: improve permission error message ( #28292 )
2024-11-06 12:28:09 +01:00
David Arnold
d5fd8d7c20
chore(docref): fix circular imports ( #28282 )
2024-10-24 22:31:12 +02:00
David Arnold
90e44d950e
fix: hashable is enough to serve as (composite) cache key ( #28189 )
2024-10-19 23:19:48 +02:00
David Arnold
2abba7b51b
fix: don't force values into the string type ( #28185 )
2024-10-19 19:00:25 +00:00
David Arnold
7348572af8
feat: docref identifier / proxy ( #27973 )
...
* feat: add DocRef
* feat: Add comprehensive test cases for DocRef functionality
* chore(db): add field type hints
* fix: ensure document stringer fulfills the DocRef contract
2024-10-19 09:40:26 +05:30
Gavin D'souza
b1d96dd532
refactor: Move children load db into separate method
...
Signed-off-by: Gavin D'souza <gavin.dsouza@switchup.de>
2024-10-17 19:18:59 +02:00
David Arnold
0204db6547
chore: move to use new test record api ( #28105 )
2024-10-12 23:13:41 +00:00
David Arnold
5d3697500e
refactor: improve maintainability with a simple dispatcher ( #27975 )
...
* refactor: improve maintainability with a simple dispatcher
* refactor: improve maintainability with a init dispatcher on Document
* refactor: improve maintainability with an init dispatcher on meta
2024-10-06 16:56:40 +00:00
Mohamud Amin Ali
e6223b04fc
refactor: Explicit feedback to timestamp mismatch errror
...
Not necessarily a needed improvement but it adds explicitness to the feedback.
fix: text order
fix: type
2024-10-04 11:46:39 +02:00
David
1c4a0fe54f
feat: add read only document mode
2024-10-02 12:02:52 +02:00
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
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
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
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
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
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
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
Ankush Menat
b493bfe7c2
fix(DX): annotate chainable methods with Self return
2024-04-06 11:04:55 +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
Ankush Menat
f6e58f229c
fix: child table rating fields ( #25433 )
2024-03-14 09:19:29 +00:00
Ankush Menat
8a3dd85503
Merge pull request #25295 from ankush/virtual-doctype-dx
...
fix(DX)!: virtual doctype APIs
2024-03-11 18:37:20 +05:30
Ankush Menat
b8c4eff68a
fix: Skip child table management for children of virt doctypes
2024-03-11 18:15:25 +05:30
Ankush Menat
68a78d33d3
fix!: Enqueue action after commit
2024-03-11 14:19:59 +05:30
Ankush Menat
638dbb6bcd
fix: disable transaction commits during doc events
...
- Events like doc.save and doc.submit need to be atomic
- Document hooks can make it not so atomic.
This is extending server script behaviour where server script hooks are
not allowed to commit/rollback.
2024-03-06 14:53:00 +05:30
Jannat Patel
898f982a88
fix: replaced created by with owner in base_document ( #25059 )
2024-02-26 12:12:26 +00:00
Ankush Menat
beb75ef66e
Merge pull request #24919 from scdanieli/fix-has-value-changed
...
fix: ensure has_value_changed works for Datetime, Date and Time fields
2024-02-19 10:54:45 +05:30
Ankush Menat
0d847439b6
test: add more tests for has_value_changed
2024-02-19 10:42:21 +05:30
scdanieli
a1cb19c820
fix: ensure has_value_changed works for datetime, date and timedelta fields
2024-02-18 16:05:31 +01:00
Raffael Meyer
fc64e8a0fb
feat: pass doctype as context when translating label ( #24903 )
2024-02-18 19:42:15 +05:30
Akhil Narang
26ae0f3460
fix: ruff fixes
...
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-07 17:04:31 +05:30
Ankush Menat
d89e0e7e4c
feat: let users unlock stuck documents
2024-02-06 12:55:31 +05:30
Ankush Menat
d616341ad4
fix: Auto delete very old document locks
...
locks older than 12 hours are most likely from dead processes. They can be (mostly) safely ignored.
2024-02-06 12:28:05 +05:30
Ankush Menat
1f9efb7b3f
fix: better file locking
2024-02-06 11:55:30 +05:30
Ankush Menat
de9ac89748
style: re-format with ruff
2024-02-05 18:53:33 +05:30
Raffael Meyer
6c8a08d955
refactor: skip permlevel check if all levels are 0 ( #24727 )
...
* refactor: skip permlevel check if all levels are 0
* chore: fix outdated docstring
* chore: equality instead of le
2024-02-05 05:19:09 +00:00
Ankush Menat
914406d31b
feat: extend perm debugging to popular controllers
...
- [x] File
- [x] Communication
2024-01-10 15:16:52 +05:30
Sagar Vora
417fce091a
fix: delete existing children first to avoid UniqueValidationError ( #24140 )
2024-01-08 22:00:54 +05:30
Corentin Flr
42fbb58626
fix(document): Pass parent_doc and parentfield in _set_defaults
2023-12-23 20:40:52 +01:00