Commit graph

2403 commits

Author SHA1 Message Date
Jannat Patel
898f982a88
fix: replaced created by with owner in base_document (#25059) 2024-02-26 12:12:26 +00:00
Riandrys Gongora Roman
f992821459
fix: translation get label from fieldname 2024-02-22 16:00:59 -05:00
Akhil Narang
3f1e19de85
refactor(treewide): enable RUF rules
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-21 16:20:28 +05:30
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
Ankush Menat
72c2207e0f refactor: useless use of dict in frappe.get_doc 2024-02-10 12:52:38 +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
Raffael Meyer
833d108614
fix: remove _lt from frappe.model.std_fields (#24662) 2024-02-01 16:05:25 +05:30
Raffael Meyer
b5f3873177
Merge pull request #24465 from barredterra/extract-js-microtemplate 2024-02-01 10:32:42 +01:00
Ankush Menat
ca293c9aa3 fix: Enqueue deletion of dynamic link after comitting 2024-01-31 18:37:12 +05:30
Ankush Menat
2f28a5e224
Merge pull request #23904 from cogk/fix-fieldlevel-access-to-shared-document-list
fix(meta)!: Allow level 0 fields if a doc has been shared with user
2024-01-29 20:17:29 +05:30
Ankush Menat
d2d1b14cc6 fix: Always allow meta/standard fields in perm level
Perm levels CANNOT applied on these fields so these should ALWAYS be allowed.
2024-01-29 20:00:41 +05:30
Ankush Menat
3bea50d519
fix: Return empty result if no perm level access (#24591) 2024-01-29 19:48:19 +05:30
Ankush Menat
797cd696a7 Merge branch 'develop' into fix-fieldlevel-access-to-shared-document-list 2024-01-29 19:39:56 +05:30
Raffael Meyer
aa7e111186
fix: consider only source_doc's no_copy (#24501) 2024-01-25 15:05:41 +05:30
barredterra
cc6ff2994f fix: make render_include work without local object
frappe.throw relies on local, making it impossible to use this function without an active site.
2024-01-19 16:13:09 +01:00
Suraj Shetty
0f4a1d8f10 fix: Handle invalid descendant filter 2024-01-19 15:49:02 +05:30
Ankush Menat
c177431557
perf: Document objects without circular references (#17080)
* perf: `Document` objects without circular references

Circular references are usuallly considered bad for GC, avoiding them
since they don't seem to be necessary.

* fix: explicitly convert to weakref
2024-01-17 17:22:55 +05:30
Ankush Menat
c0cf13b8e8 Revert "fix: search_link fails when txt contains parentheses (#22892)"
This reverts commit 642e9f4ec1.
2024-01-17 12:44:20 +05:30
Sambasiva Suda
642e9f4ec1
fix: search_link fails when txt contains parentheses (#22892)
* fix: search_link fails when txt contains parentheses

* fix: updating regex to replace number params also

* chore: replacing regex with sqlparse

* chore: not including fields like count(1) in asterisk_fields

* fix: owner/module not identified as column

* chore: lint fix and removing exception

* refactor: better function name

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2024-01-16 21:36:45 +05:30
Corentin Flr
f8ff2308e2
Merge branch 'frappe:develop' into fix-fieldlevel-access-to-shared-document-list 2024-01-15 01:32:51 +01:00
Ankush Menat
447f02e8d3
fix!: Remove misleading "raise_exception" (#24266)
frappe.permission.has_permission won't accept raise_exception anymore,
it was extremely misleading argument and actual purpose of the argument
was to print perm check logs.
2024-01-11 08:24:18 +00:00
Ankush Menat
b38199a3b3 fix: pass user to has_perm check 2024-01-11 12:34:15 +05:30
Ankush Menat
9f135e8c1d fix: print perm check logs from DB query
Doing has_permission and then manually raising exception erases the perm check messages.

This causes insane amounts of confusion when perm error says X not
permitted while user is trying to check Y.
2024-01-11 12:27:39 +05:30
Ankush Menat
1f6201b4af feat: lazy global translated strings 2024-01-10 21:28:01 +05:30
Ankush Menat
f7413d74fb
Merge pull request #24243 from ankush/annotate_meta
fix(DX): Type annotations for Meta
2024-01-10 16:45:07 +05:30
Ankush Menat
d09df92497 fix(DX): Type annotations for Meta
`frappe.get_meta` returns which is 90% `DocType` + 10% `Meta` specific
stuff, this hack just allows us to mix both for autocompletions.
2024-01-10 15:58:03 +05:30
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
Ankush Menat
9b8a8c155d
fix: Correct logic for can_cancel (#24196)
You can cancel a document IFF:
- Document has no workflow
- Document has workflow but it doesn't have state with docstatus=2.

closes https://github.com/frappe/frappe/issues/19075
2024-01-08 19:15:19 +05:30
Shariq Ansari
54ecae0656
fix: Allowed standard fields in data export ( creation, owner) (#24187)
Co-authored-by: Pavan Kumar Yekabote <yekabotep@gmail.com>
2024-01-08 17:09:13 +05:30
Ankush Menat
64c221343e
perf: skip ifnull checks on modified field (#24042) 2023-12-30 06:39:32 +00:00
Corentin Flr
42fbb58626
fix(document): Pass parent_doc and parentfield in _set_defaults 2023-12-23 20:40:52 +01:00
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
Ankush Menat
5e2ace4c08
perf: Use set for tracking whitelisted methods (#23905)
List look ups are O(N). This is still a microoptimization at best
considering other overhead.
2023-12-21 23:19:06 +05:30
Corentin Flr
d7026b8a26
fix(meta)!: Allow level 0 fields when a doc has been shared with user 2023-12-21 14:40:44 +01:00
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
bourouffala
3015852ce1
fix: Error when displaying dashboard with number card using average and sum functions (#23883) 2023-12-20 11:13:20 +00:00
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
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