Ejaaz Khan
335c0d5f36
fix: refactor code and change field type
2025-09-30 12:38:39 +05:30
Ejaaz Khan
e69b607aab
feat: add validation to prevent changing values on save
2025-09-19 11:21:40 +05:30
Ejaaz Khan
54b34c9535
Merge branch 'develop' into 32489-role-perm-based-masking
2025-09-17 16:17:30 +05:30
Akhil Narang
5b26db7265
Merge pull request #33685 from AMR-Mannesmann/fix(document)-is_child_table_same-for-new-docs
...
fix(document): is_child_table_same for new docs
2025-09-02 11:37:06 +05:30
Ejaaz Khan
590fe7e520
Merge branch 'develop' into 32489-role-perm-based-masking
2025-09-02 10:48:06 +05:30
Akhil Narang
719af6e722
Merge pull request #33815 from raizasafeel/fix/translation-trailing-spaces
...
fix: remove trailing spaces in translatable strings
2025-08-28 16:31:45 +05:30
Raizaaa
aa3bb0e4d7
fix: remove trailing spaces in translatable strings
2025-08-27 13:23:17 +03:00
Mihir Kandoi
c24bda0481
feat: enable non negative validation for Percent type fields
2025-08-26 22:12:23 +05:30
Daniel Radl
99d6e1b381
fix(document): is_child_table_same for new docs
2025-08-20 09:30:26 +00:00
Ejaaz Khan
c2544f9096
refactor: change approach of masking fields
2025-08-18 23:38:18 +05:30
mergify[bot]
c0aa39ee9a
Merge branch 'develop' into 32489-role-perm-based-masking
2025-08-01 05:57:54 +00:00
Raffael Meyer
93b4700899
fix: make labels in error message translatable ( #33166 )
2025-07-23 18:11:51 +05:30
P-Froggy
00a5fde3ad
feat: Enable _doc_before_save for child documents ( #33279 )
...
* Initial Commit
* Apply suggestion from @ankush
* refactor: move unrelated code out of try-except block
* test: child table level value change detection
---------
Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
Co-authored-by: Ankush Menat <ankush@frappe.io>
2025-07-11 12:33:00 +00:00
Ankush Menat
b74b8f16b7
refactor: slim down init.py further ( #33284 )
...
* refactor: move document utils
* test: rewrite init.py test
The LOC is 1000 less than what it used to be.
2025-07-11 15:34:50 +05:30
Sagar Vora
71428b7dcb
feat: utility to commit certain queries after sending response ( #32978 )
...
* feat: utility to commit certain queries after sending response
* fix: add error handling
* refactor: subclass CallbackManager
2025-07-08 05:02:27 +00:00
Akhil Narang
ad948c9b98
Revert "Merge pull request #32327 from akhilnarang/allow-passing-name-in-api"
...
This reverts commit 1e30db26dc , reversing
changes made to 8da72e91e3 .
2025-07-03 17:23:48 +05:30
Sagar Vora
406aae7432
chore: fix typo
2025-07-01 19:43:04 +05:30
Ejaaz Khan
cbcf16440a
refactor: remove masking setting from System Settings
2025-06-26 13:06:44 +05:30
mergify[bot]
0312cb7eb4
Merge branch 'develop' into 32489-role-perm-based-masking
2025-06-25 17:17:30 +00:00
Faris Ansari
09ae9ad086
fix: rename method typing
2025-06-18 15:51:13 +05:30
Sagar Vora
b3e1eda4c8
feat: global frappe.in_test flag ( #32960 )
...
* feat: global `frappe.in_test` flag
* feat: helper utility to toggle `frappe.in_test`
* fix: use `toggle_test_mode` util
* fix: use `frappe.in_test`
* chore: add comment explaining global `in_test`
* chore: ignore commit replacing flag usage
* test: temporarily disable `frappe.in_test`
this worked earlier because flag was set in werkzeug.local which was separate for API test client
* test: add comment explaining change
2025-06-17 19:19:31 +05:30
Sagar Vora
5210348322
perf: assume key to be table fieldname
2025-06-14 01:49:07 +05:30
Sagar Vora
d79ca9560b
chore: revert _init_* methods of document
2025-06-13 22:24:03 +05:30
Ejaaz Khan
2ad1217fb0
Merge branch 'develop' into 32489-role-perm-based-masking
2025-06-11 19:47:48 +05:30
Ankush Menat
b162c0d6ec
fix!: Don't update document from keyword args ( #32898 )
...
Right now if you do this:
`get_doc(doctype, name, field=value)` then it loads document from DB and
then updates field to value.
This is absurd API and I don't think it was ever done intentionally.
2025-06-11 10:15:35 +00:00
Ankush Menat
44681433c9
fix: for_update for lazy loaded documents ( #32897 )
...
* fix: Support for_update on lazy documents
* fix: Pop for_update from arguments
* fix: Don't init empty child tables
2025-06-11 10:02:36 +00:00
Sagar Vora
a6b2f7c991
perf: dont override doc.extend ( #32890 )
2025-06-11 07:26:46 +00:00
Ankush Menat
893a87df86
fix: append and extend without touching attributes
2025-06-11 10:07:48 +05:30
Ankush Menat
10c3c9ea9b
fix: Limit getattr to lazy loaded child tables only
2025-06-11 09:55:45 +05:30
Ankush Menat
5c886ef091
test: test internal implementation of LazyChildTable
2025-06-11 09:55:45 +05:30
Ankush Menat
26cf77562c
refactor: rearrange checks, inline and cast super args
...
Co-authored-by: Sagar Vora <16315650+sagarvora@users.noreply.github.com>
2025-06-11 09:55:45 +05:30
Ankush Menat
e69f79e2ae
fix: Support dict as key ~ filters
...
Triggers full fetch indirectly, but there's no other option for this.
2025-06-11 09:55:45 +05:30
Ankush Menat
bebabc3211
fix: Handle support for DocType and virtual
...
By falling back to original impl with warning.
This is just to allow "fearless usage".
2025-06-11 09:55:45 +05:30
Ankush Menat
49f582ae57
perf: Use lazy doc in a lot more places
2025-06-11 09:55:45 +05:30
Ankush Menat
4d7348d3c0
refactor: avoid code duplication
2025-06-11 09:55:36 +05:30
Ankush Menat
5b8f7bba2b
fix: Ensure some basic checks are present to prevent misuse
2025-06-11 09:55:01 +05:30
Ankush Menat
3e4e944ae9
fix: dont db_update what hasn't changed
2025-06-11 09:55:01 +05:30
Ankush Menat
022dbf444d
fix: make doc.save work and empty tables
2025-06-11 09:55:01 +05:30
Ankush Menat
eb77ddab69
feat: Lazy loaded documents
...
https://docs.python.org/3/howto/descriptor.html#invocation-from-an-instance
After first invokation, object's __dict__ will be used... then we can
assume rest of the code works as expected (?)
2025-06-11 09:55:01 +05:30
Ejaaz Khan
1d96a933cb
Merge branch 'develop' into 32489-role-perm-based-masking
2025-06-10 19:46:20 +05:30
Ejaaz Khan
ed0071df9e
feat: export encrypted data and add system setting
2025-06-10 19:42:49 +05:30
Ankush Menat
e4bc7f361b
Revert: DocRef ( #32866 )
...
- Hardly used anywhere
- Too many hardcoded `__value__` calls without which it's not usable.
- Another type to worry about
2025-06-10 05:20:56 +00:00
Ankush Menat
47a47a9b5d
refactor!: Change internal datastructure of db.value_cache
...
It's now a defaultdictionary of `[doctype][name/filters][fieldname]`
This allows us to implement granular clearing and improve usage of this cache.
2025-06-05 14:46:03 +05:30
Ankush Menat
bc63c17287
perf: don't load doc before save for child tables ( #32770 )
...
Consider this:
```python
for row in doc.get_children():
row.db_set("amount", 0)
```
This sounds like it will do one write query for each row but it does 2
because of this unnecessary locking of child tables.
2025-06-04 07:52:37 +00:00
mergify[bot]
2aacdd8d33
Merge branch 'develop' into 32489-role-perm-based-masking
2025-06-04 07:48:07 +00:00
Ejaaz Khan
a4fbe0160e
feat: show mask data in form, list and report view
2025-05-27 13:16:27 +05:30
Ankush Menat
78f7fa1429
perf: hoist constant computations for child table column order ( #32677 )
...
These don't/shouldn't change during execution of the function.
2025-05-26 19:39:29 +05:30
Ankush Menat
e2d619504f
perf: batch bulk_insert ( #32675 )
...
* fix: reduce bulk insert batch size
Back when this feature was added it used to lazily evaluate the input.
Now the iterator is consumed upfront so large batch sizes == huge memory usage.
* perf: bring back iterator for bulk_insert
Bulk insert used to support iterator for consuming arbitrarily large
amount of data and inserting it. Since child table support was added, it
can't do it anymore because that requires collecting values.
This change now brings back iterators by batching input iterator (by
default 1000) documents.
This is almost as good as original change from design POV. Performance
is still meh for flat documents.
2025-05-26 13:36:53 +00:00
Ankush Menat
9920c8d033
fix: duplicate follow
...
This exists in `doc.insert()` not need to add it here too
2025-05-26 14:43:06 +05:30
Ankush Menat
c2d2fda212
perf: avoid clearing cache for newly imported documents
2025-05-26 14:42:54 +05:30