Commit graph

43694 commits

Author SHA1 Message Date
Ankush Menat
0b0b7f7f60 test: check that document actually got deleted 2023-10-16 18:12:53 +05:30
Ankush Menat
f9e120c104 refactor: remove unnessary manual commits 2023-10-16 18:12:53 +05:30
Ankush Menat
b6b4b98c0f refactor(APIv2): message -> data 2023-10-16 18:12:53 +05:30
Ankush Menat
26b3f6ae96 fix: pass on custom responses as is without any post processing 2023-10-16 18:12:53 +05:30
Ankush Menat
507343f4f6 fix: double response processing 2023-10-16 18:12:53 +05:30
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
e0f87dc4e1 refactor!: move OAuth and token auth code to auth.py
This doesn't belong in api.py
2023-10-16 18:12:53 +05:30
Ankush Menat
b064d12440 feat: Shorthand for whitelisted function call in controllers
```diff
- GET /api/method/frappe.core.doctype.user.user.get_timezones
+ GET /api/method/User/get_timezones
```
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
5f32952b30 feat(APIv2): Execute doc method using API
e.g. `POST /api/v2/resource/Sales Order/SO-0001/submit`
2023-10-16 18:12:53 +05:30
Ankush Menat
1b51914a83 refactor: create two API versions 2023-10-16 18:12:53 +05:30
Ankush Menat
5af6624cce refactor: Use werkzeug router for API routing 2023-10-16 18:12:53 +05:30
Ankush Menat
c7338f5a83 chore: deprecate form_dict.cmd, globals() 2023-10-16 18:12:53 +05:30
ruthra kumar
d06a5808cc
fix: validation permission on tag creation (#22753)
* fix: validation permission on `tag` creation

* refactor: apply checks on all operations

Add/remove both are controlled by update

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-10-16 12:38:00 +00:00
Ankush Menat
db3e4c9cfc
fix: Check if note has permission (#22750) 2023-10-16 16:43:47 +05:30
Ankush Menat
3effd9e101 test: fix test failure from parallel merge 2023-10-16 16:42:46 +05:30
Ankush Menat
21a0dabdb2 test: increase wait
field value isn't updated and cypress attempt to save
2023-10-16 15:41:31 +05:30
Ankush Menat
c476c5e6d7
refactor!: Link field search (#22745)
* refactor!: Drop handling for SQL queries

This hasn't been supported in really long time, no need to check that
use cases.

It will still fail but with no special error message.

* fix: Catch all import related errors

* fix!: Use last query from hooks

* refactor!: Return search results like any other function

Search results are returned in `results` key which is incosistent from
most other functions

* refactor: simplify search_link
2023-10-16 15:41:02 +05:30
Corentin Flr
89aab5d748
fix(query_doctypes): Allow search in translated name (#22590)
* fix(query_doctypes): Allow search in translated name

* test: Add test for DocType search in foreign language
2023-10-16 15:13:57 +05:30
Sagar Vora
3829232201
Merge pull request #22744 from resilient-tech/perf-event-save 2023-10-16 13:02:00 +05:30
Sagar Vora
258c175982 perf: defer db query when saving Event 2023-10-16 12:59:30 +05:30
Anand Chitipothu
aff3f66366
fix: work-around to fix issue with syncing Google Contacts (#22649)
Issue #22648
2023-10-16 12:29:49 +05:30
Maharshi Patel
bbf91b8afc
fix: sync doctype layout on update standard field (#22699)
* fix: sync doctype layout on update standard field

When standard field is deleted & it is not updated in the doctype layout,
Error occurs as it will try to render fields that doesn't exist
and layout won't render.

to fix this, sync doctype layout on update standard field

* refactor: use savepoint decorator

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-10-16 12:19:17 +05:30
Ankush Menat
29cd096e13
Merge pull request #22729 from ankush/search_relevance
fix(UX): Improve search relevance for link field
2023-10-16 12:08:37 +05:30
Sayed Ayman
94263bf4f2
feat (notificaion): email from 'Table Multiselect' field (#22733)
* feat (notificaion): table multiselect field

* refactor: use model.table_fields instead of duplicating

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-10-16 12:02:19 +05:30
Ankush Menat
55a444959e fix: Make search_link query postgres compatible 2023-10-16 11:51:51 +05:30
Ankush Menat
fec7759d00 fix: Give idx higher preference than meta order
Meta order in most cases is default "modified" which doesn't quite help.

idx is # of times a document is referred to somewhere else, which is
more likely to be relevant.
2023-10-16 10:50:57 +05:30
Ankush Menat
31444228c3 fix: Improve search relevance for search_link
When `locate` returns 0 it's shown on top instead it should be shown
last or not shown at all.

This is math hack to avoid using any complex SQL functionality which
isn't allowed in DB query.
2023-10-16 10:46:47 +05:30
Ankush Menat
e20d79bc28
Merge pull request #22730 from nabinhait/server-script-fix
fix: Delete from cache after deleting a server script
2023-10-16 10:22:20 +05:30
Nabin Hait
04c2944886 fix: Delete from cache after deleting a server script 2023-10-15 19:16:13 +05:30
Ankush Menat
e9629bc04e
Merge pull request #22700 from akhilnarang/failed-email-notification
fix(UX): send out a system notification when email sending + retries fail
2023-10-14 13:15:39 +05:30
Ankush Menat
fb34d49703
Merge pull request #22724 from ankush/oauth_signups_exc
feat: let social login keys control signups
2023-10-14 13:07:10 +05:30
Ankush Menat
e1f2f4bb54 fix: Let social login key control signups
There are cases where certain social login keys

- Should not allow signups at all and only allow logins. E.g. social media login keys.
- Should allow signups even if global sign ups are disabled. e.g. internal SSO like setups.
2023-10-14 12:43:48 +05:30
Ankush Menat
65455ffa89 fix(DX): Add simple cron explanation next to cron fields
closes https://github.com/frappe/frappe/issues/21166
2023-10-14 11:27:18 +05:30
Akhil Narang
41d524c9a0
chore: add in a test for failed email notification
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-10-13 18:16:32 +05:30
Ankush Menat
c6f7c1f709
Merge pull request #22720 from cogk/fix-dont-mutate-df-in-frappe-format
fix: Don't mutate `df` object in frappe.format
2023-10-13 17:56:28 +05:30
Corentin Forler
7c9954e724
fix: Don't mutate df object in frappe.format
When customizing the **Communication** DocType by setting the property `in_list_view` for the field `_user_tags` to `1`, the *fieldtype* of the `_user_tags` docfield can be mutated to `"Tag"` by the `frappe.format` function called during the list view rendering. Then, when opening a Communication form view, the layout tries to render the `_user_tags` field which has the invalid fieldtype `"Tag"`, which crashes the rendering of the form.
2023-10-13 12:16:57 +02:00
Ankush Menat
083aa8a11c
Merge pull request #22659 from barredterra/like-in-list
feat(listview): move likes to the right
2023-10-13 15:40:34 +05:30
Ankush Menat
29544fb971
Merge pull request #22650 from barredterra/form-sidebar-stats
fix: like/comment icons and count
2023-10-13 15:39:30 +05:30
Ankush Menat
52d6bd67e4 fix: Always return document from doc.insert 2023-10-13 15:34:03 +05:30
Ankush Menat
e72b03adaf refactor: handle notification failure 2023-10-13 14:59:00 +05:30
Ankush Menat
497807cbbc
Merge pull request #22713 from akhilnarang/fix-docstring
fix(model/document): add missing parameters to docstring and fix return type annotation
2023-10-13 14:53:42 +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
Ankush Menat
ce0c2fc41b
Merge pull request #22716 from akhilnarang/hide-image-upload-if-no-permission
fix: hide `sidebar-image-actions` if the user doesn't have write permission
2023-10-13 14:47:28 +05:30
mergify[bot]
0934f05cb6
Merge pull request #22714 from akhilnarang/type-exporter-cleanup
fix: method name typo and return type annotation
2023-10-13 04:25:50 +00:00
Akhil Narang
8b3359520a
fix: hide sidebar-image-actions if the user doesn't have write permission
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-10-12 18:50:01 +05:30
Akhil Narang
85c3be814d
fix(exporter): some methods had the wrong return types
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-10-12 13:57:48 +05:30
Akhil Narang
92218e443b
chore(exporter): fix typo in method name
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-10-12 13:57:48 +05:30
Akhil Narang
65d6c20d9e
feat: send out a system notification when email sending + retries fail
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-10-12 13:34:50 +05:30
mergify[bot]
c9bba3c1b2
Merge pull request #22705 from akhilnarang/drop-deprecated-method
chore: drop usage of the deprecated `distutils.version.LooseVersion`
2023-10-11 15:04:34 +00:00