Commit graph

6165 commits

Author SHA1 Message Date
Akhil Narang
7c0500f560
Merge pull request #33657 from Rl0007/fix/module-profile-sync
fix: sync user block_modules on update
2025-08-19 15:03:32 +05:30
Bhushan Barbuddhe
70dc9b83ab
refactor(hook): Execute send_sms hooks before receiver_list validation (#33649)
* feat: add hook for custom SMS OTP sender (mobile_otp_sms_sender) in 2FA

* [ADD]: Hooks for send SMS

* [fix]: Hook changed to send token.

* chore: remove unnecessary comment

* refactor(hook): Execute send_sms hooks before receiver_list validation
2025-08-18 13:53:01 +05:30
Rahul Agrawal
71a8a6f7c1 test: remove unneccssary if condition 2025-08-17 13:25:50 +05:30
Rahul Agrawal
8d04ecba9e ci: add unit tests 2025-08-17 10:29:10 +05:30
Rahul Agrawal
2dcee71150 fix: remove unneccssary condition 2025-08-16 13:41:04 +05:30
Rahul Agrawal
7166caf9be fix: disable module checkbox if module profile is selected 2025-08-16 13:36:48 +05:30
Rahul Agrawal
f711e52fc9 fix: sync user block_modules on update 2025-08-16 09:20:01 +05:30
Elton Lobo
86e38ecade
fix: invitation user relation (#33603)
* fix(user-invitation): unlink user from invitations on delete

* fix(user-invitation): disallow inviting disabled users

* style(user-invitation): format code

* test(user-invitation): correct tests after invitation user relation fix

* test(user-invitation): add invite by email api's disabled user test

* docs(user-invitation): mention disabled users processing

* refactor(user-invitation): add `User invitation` doctype to `ignore_links_on_delete`

* Revert "refactor(user-invitation): add `User invitation` doctype to `ignore_links_on_delete`"

This reverts commit a70e4800c8182ea562b28a65239c82e1bed5e612.
2025-08-14 16:26:23 +05:30
Hussain Nagaria
6e880bdcfe
fix: version diff for empty datetime fields (#33605)
* fix: version diff for empty datetime fields

* fix: remove debug print
2025-08-11 11:49:21 +00:00
Hussain Nagaria
fd2068b6e1
fix: show null as string if value is null (#33577)
* fix: show `null` as string if value is null

* refactor: DRY up formatting
2025-08-08 07:46:37 +00:00
Hussain Nagaria
873d020ced
Merge pull request #32638 from Abdeali099/new-ui-for-api-key 2025-08-05 14:07:36 +05:30
Hussain Nagaria
ee43c1b063
fix: improve copy for token based auth docs link
Co-authored-by: Ejaaz Khan <67804911+iamejaaz@users.noreply.github.com>
2025-08-05 12:24:46 +05:30
Hussain Nagaria
7070eeb8c8
fix: improve warning message copy
Co-authored-by: Ejaaz Khan <67804911+iamejaaz@users.noreply.github.com>
2025-08-05 12:24:14 +05:30
Hussain Nagaria
ec6460924d chore: UI cleanup 2025-08-01 16:45:23 +05:30
Bhushan Barbuddhe
7df795cf99
feat: Add hooks for custom SMS and OTP SMS sending (#33444)
* feat: add hook for custom SMS OTP sender (mobile_otp_sms_sender) in 2FA

* [ADD]: Hooks for send SMS

* [fix]: Hook changed to send token.

* chore: remove unnecessary comment
2025-07-30 16:47:12 +05:30
RitvikSardana
7b71c3aeb7
Merge pull request #33389 from RitvikSardana/auto-append-email-account
feat: Auto append email account name to 'append_to' doctype
2025-07-29 13:03:48 +05:30
Ayush Chaudhari
761751f269
feat: App-Defined Workflow Tasks and Server Scripts on Transition (#33255)
* feat: add workflow task doctypes

* chore: add Workflow Task to Script Type of Server Scripts

* chore: add description for Workflow Tasks

* feat: fetch dotted paths and corresponding names from hooks

* fix: use Select field instead of Autocomplete

* feat: execute tasks in the background on state transition

* fix: throw error when task not found

* fix: naming for transition task set by user

* fix: child table views

* feat: support for server scripts

* chore: comments and description

* fix: change the casing of docevent options

* fix: change test casing

* feat: Add Workflow Transition field to webhooks

* fix: temporarily remove filter

* feat: add webhooks as workflow actions

* test: test execution of synchronous app-defined methods and server scripts

* chore: shorten the description and change the fieldname of the field 'execute_asynchronously' to 'asynchronous'

* test: server script executipn

* fix: add field to UI

* test: change customer to domain

* test: change Customer to Domain

* fix: patch for change in webhook fields

* chore: fetch only used fields in get_all

* fix: don't run test logic in application code 🙂

* test: separate tests for workflow tasks

* Revert "fix: patch for change in webhook fields"

This reverts commit 2e9c51c43ca2b3698991fbe75cc4032368ab174c.

* chore: break into smaller functions

* test: webhooks with workflow tasks

isolate mock responses to test_sync_tasks

* Revert "fix: change test casing"

This reverts commit e2bad96ed01dea0a26d002ea44a1e0175525ed31.

* Revert "fix: change the casing of docevent options"

This reverts commit ddfc81bf775fad74225f25815b8e3e7b255dc9eb.

* fix: webhook casing

* fix: type hint for doc
2025-07-29 11:01:44 +05:30
Elton Lobo
6d1008933f
feat: add user invitation doctype & related public methods (#33308)
* feat: add user invitation doctype & related public methods

* style(user-invitation): execute formatters & add semgrep comments

* refactor(user-invitation): use `is` to compare `None` values

* fix(user-invitation): skip fetching `after_accept` for default app

* fix(user-invitation): translate email templates

* fix(user-invitaton): return pending invites from invite by email api

* refactor(user-invitation): improve code quality

* fix(user-invitation): translate all error messages

* refactor(user-invitation): improve security & readability

Improvements:
- move invite expiration check to `daily_maintenance`
- explicitly import all of the used packages
- specify methods for all security-critical endpoints
- improve error messages and give them suitable titles
- remove unnecessary utility functions
- make invitation key management secure
- translate all of the subjects of the sent emails
- use the `app_title` hook to create email titles
- commit the work done after each iteration of the background invitation
  expiry checker
- restructure code to improve readability
- use `user.reset_password` to generate the target link
- use clear long names to name identifiers
- add document states with relevant colors (User Invitation doctype)
- differ `sendmail` emails whenever possible
- send an email to the invitation creator instead of the invitee after
  the invite has expired
- remove `User Invitation Manager` role

* fix(user-invitation): use valid emails to test doctype & related code

* feat(user-invitation): support adding multiple roles

* refactor(user-invitation): mark relevant fields `set only once`

* feat(user-invitation): add `Cancelled` status

* test(user-invitation): correct broken tests

* test(user-invitation): form valid f-strings & run code formatter

* feat(user-invitation): make doctype usable from desk

* fix(user-invitation): remove delete permission from invitation doctype

* feat(user-invitation): pass user inserted info to `after_accept` hook

* refactor(user-invitation): improve custom action methods & errors

Improvements:
- trigger actions only when the invitation is in the `Pending` state
- use lowercase letters to start error messages
- handle cases where `user_invitation_hook` is not defined

* refactor(user-invitation): remove site name from email templates

* docs(user-invitation): add internal documentation

* feat(user-invitation): add 'get pending' & cancel invites apis

* fix(user-invitation): make invitation app specific

* refactor(user-invitation): avoid mixing function programming

* fix(user-invitation): make apis usable for app specific valid users

* fix(user-invitation): allow app specific invites

* feat(user-invitation): make list view & permission checks app specific

* refactor(user-invitation): convert class methods to static when possible

* feat(user-invitation): add `app_only_for` method to the doc

* fix(user-invitation): f-string syntax error in `get_permission_query_conditions`

* docs(user-invitation): add examples & improve the internal doc

* refactor: rename method name

static_ is unnecessary
only_for doesn't make sense in this context when arguments are not roles

* fix: Support POST request too

We dont follow REST semantics 100%, anything that modifies something
should ideally be doable with POST too.

* chore: cap

* fix: Avoid ignore_permissions as user arg

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2025-07-28 16:25:53 +05:30
Soham Kulkarni
64db88228f
refactor: seperate blogs into a seperate app (#32737)
* fix: remove doctypes,workspace blocks, files

* fix: minor python tests and UI tests

* fix: remove blog post from tests

* fix: remove blogger as role for tests

* fix: add check for if doctype exists

* fix: ui test

* fix: more cleanup

* fix: cleanup comments and fix test_query

* fix: resolve conflicts

* fix: add warning and handle comments
2025-07-28 14:35:02 +05:30
Raffael Meyer
6cb5f7287a
feat: allow user to change timezone (#33419) 2025-07-22 19:50:12 +02:00
Ritvik Sardana
b3afe4f4f1 chore: rename email account field 2025-07-19 12:26:36 +05:30
Ritvik Sardana
daf8f55458 feat: auto append email account to the document 2025-07-19 11:59:10 +05:30
Corentin Forler
0235d8fc61
fix(user): Destroy sessions after rename (#32253) 2025-07-15 12:27:22 +05:30
sokumon
ef77a68a32 fix: set max-width for image preview 2025-07-14 17:59:55 +05:30
El-Shafei H.
272abfbd4c
fix: add Translator role to Translation DocType (#33297) 2025-07-14 06:55:06 +00:00
Akhil Narang
0322b014c2
fix(data_import): only convert link values to lowercase for mariadb
We use a case-insensitive collation there, but PostgreSQL and SQLite are case sensitive

Followup to #33196

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-07-11 17:11:46 +05:30
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
Ankush Menat
1ed2447f6b
fix!: Always cast db.get_value for singles (#33276) 2025-07-11 07:32:41 +00:00
Ankush Menat
1fa97d404a
fix: Handle case differences while sending email to a document (#33270)
This fails for doctypes where name isn't title case.

E.g. `HD Ticket` becomes `Hd Ticket`.
2025-07-10 04:43:46 +00:00
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
Abdeali Chharchhoda
363c20b2ea Merge branch 'develop' into new-ui-for-api-key 2025-07-07 12:04:34 +05:30
Ankush Menat
1a7da4f025
fix: keep setup_complete in sync with rest (#33215)
For backward compatbility of whatever reads System Settings.
2025-07-03 18:19:23 +05:30
Akhil Narang
a1dae98560
fix(data_import): make our link field checks case-insensitive (#33196)
MariaDB query is case insensitive, so our check should be as well, else we get warnings that aren't real.

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-07-03 14:41:55 +05:30
Rohit Waghchaure
5fe780dfd5 fix: setup wizard broken during site restoration (v14->v15) 2025-06-30 20:17:00 +05:30
rohitwaghchaure
c21ac6030c
fix: setup wizard broken during site restoration (#33161) 2025-06-30 11:14:33 +00:00
Sagar Vora
e01b6ff4ec test: improve report custom permission test 2025-06-27 14:35:34 +05:30
Sagar Vora
1812cdb613 test: improve report permission test 2025-06-27 14:30:52 +05:30
Ankush Menat
9e437cd071
fix: Git branch is not mandatory (#33131)
You can have an app without git repo 🤷
2025-06-27 04:43:30 +00:00
Sagar Vora
23becc0aa7 fix: hide Allow Import option for single doctypes 2025-06-24 17:25:29 +05:30
Soham Kulkarni
92adc5a3a0
Merge pull request #33055 from sokumon/prevent-recursion
fix: increment retry_count first to prevent recursion
2025-06-24 16:22:19 +05:30
sokumon
baf29c896c fix: remove like logic from permission query 2025-06-24 16:04:31 +05:30
Akhil Narang
60dd0377e8
refactor: store hide_descendants within user permissions data
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-06-24 11:18:23 +05:30
Ejaaz Khan
a723876bfb
Merge pull request #33052 from iamejaaz/37997-fix-linking-document
fix: unscrub after quote
2025-06-23 13:58:50 +05:30
Ejaaz Khan
acdc54ce8b fix: unscrub after quote 2025-06-23 13:44:41 +05:30
Ejaaz Khan
c4a5582985
Merge pull request #33037 from iamejaaz/37997-fix-linking-document
fix(email): resolve case mismatch in auto-linking from email address
2025-06-21 15:11:10 +05:30
Ejaaz Khan
73cf975a9a fix(email): resolve case mismatch in auto-linking from email address 2025-06-21 14:30:51 +05:30
Ankush Menat
18ecd6603b
perf: ~2x faster scheduling (#33027)
* perf: Use cached settings

* perf: Cache parsed crons, ~2x faster scheduling
2025-06-20 12:43:22 +00:00
Ankush Menat
02d72d2bbb
perf: faster gzip compression (#33014)
Same as https://github.com/frappe/press/pull/2400
2025-06-19 12:52:58 +00:00
Sagar Vora
e355a175d8
fix: always defer access log insertion (#32976) 2025-06-18 07:03:11 +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