Commit graph

262 commits

Author SHA1 Message Date
Shubh Doshi
9c663fcdf0 refactor: update prompt message 2026-02-27 15:34:18 +05:30
Shubh Doshi
9751b86837 refactor: include doctype name in DocStatus reset message and change fallback for state with no label 2026-02-26 20:04:46 +05:30
Shubh Doshi
26cb0c1622 fix: check all states at once in workflow-builder 2026-02-26 20:04:46 +05:30
Shubh Doshi
9dcc97cb26 refactor: updated is_doc_status_readonly condition 2026-02-26 20:04:46 +05:30
Shubh Doshi
675b23c47c fix: validate doc_status for non-submittable doctypes in workflow 2026-02-26 20:04:46 +05:30
Suraj Shetty
947b63d4f2
Merge pull request #36995 from frappe/34570-bug-workflow-action---expired-link---wrong-information-displayed 2026-02-25 17:14:49 +05:30
Sumit Jain
7758bc49fe fix(workflow): improve user retrieval for workflow state changes 2026-02-25 11:22:41 +05:30
Aarol D'Souza
c55ff193a6
fix: add type hints to whitelisted methods 3 (#37149)
* fix(apps): add type hints to whitelisted methods

* fix(recorder): add type hints to whitelisted methods

* fix(comments): add type hints to whitelisted methods

* fix(oauth2): add type hints to whitelisted methods

* fix(google_calendar): add type hints to whitelisted methods

* fix(print): add type hints to whitelisted methods

* fix(print_format_builder): add type hints to whitelisted methods

* refactor(network_printer_settings): remove unused args

* fix(document): add type hints to whitelisted methods

* fix(user_settings): add type hints to whitelisted methods

* fix(mapper): add type hints to whitelisted methods

* fix(connected_app): add type hints to whitelisted methods

* fix(google_contacts): add type hints to whitelisted methods

* fix(frappecloud_billing): add type hints to whitelisted methods

* test: rewrite test to fit the strict type check

* fix(social_login_key): add type hints to whitelisted methods

* fix(share): add type hints to whitelisted methods

* fix(webhook): add type hints to whitelisted methods

* fix(workflow): add type hints to whitelisted methods

* fix(workflow main): add type hints to whitelisted methods

* fix(workflow_action): add type hints to whitelisted methods

* fix: flexible type hint

* fix(client): add type hints to whitelisted methods

* fix: fix some of the tighter types

* fix(frappecloud_billing): add str typehint to whitelisted endpoint

* fix: target_doc can be dict/json string

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2026-02-20 06:50:19 +00:00
Sumit Jain
8e3bd72ef7 fix(workflow): add function to retrieve user who set workflow state 2026-02-12 12:37:53 +05:30
UmakanthKaspa
6bb584f725
feat: Support dynamic expressions in workflow update_value field (#34354)
* feat: add dynamic value support for workflow update_value field

* feat: add evaluate as expression checkbox to workflow states

* test: add tests for dynamic workflow update_value expression

* fix: use description field instead of sender in workflow
  tests

* chore: fix typo

---------

Co-authored-by: UmakanthKaspa <kaspaumakanth1999@gmail.com>
Co-authored-by: Akhil Narang <me@akhilnarang.dev>
2025-12-30 15:58:43 +05:30
sokumon
dd2dc053ca chore: more renames to /desk 2025-12-18 20:45:04 +05:30
El-Shafei H.
fb28f5289f
fix: Typo message (#35060) 2025-12-04 12:11:29 +05:30
Akhil Narang
90ed0502fa
refactor: support new function style
- Migrate all SQL function usage from string format to dict format
- Old: fields=['count(*) as count']
- New: fields=[{'COUNT': '*', 'as': 'count'}]
- Add `NULLIF`

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-11-19 21:15:57 +05:30
sokumon
7883897119 chore: rename app to desk 2025-11-14 23:05:14 +05:30
theerayut
c1e42a6a50 fix: update code from develop branch 2025-10-12 13:26:53 +07:00
Aarol D'Souza
79eb78db10
fix: update modified timestamp when Workflow Action is completed (#34298) 2025-10-08 11:03:43 +05:30
theerayut
18a83f426b fix: remove enable_action_confirmation on workflow transition 2025-09-05 08:03:07 +07:00
theerayut
ac3ae547e8 feat: add enable_action_confirmation on workflow doctype 2025-09-02 09:28:58 +07:00
theerayut
bf4472865e refactor: change field's description 2025-07-31 13:55:36 +07:00
Theerayut A.
1b962c8569 Merge branch 'develop' into add-action-confirm-on-workflow 2025-07-29 23:47:19 +07:00
theerayut
85a5f05b80 feat: Add action confirm on Workflow
imp: move Action Confirmation into transitions level
2025-07-29 23:36:58 +07:00
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
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
Ankush Menat
8088bd3891
chore: Drop empty UnitTestCases (#32867)
Next to zero adoption after introduction, just noise in codebase.

I don't see any point in arguing about purity of test cases when
existence and quality of test cases is usually the bigger problem.

Dropped using semgrep
2025-06-10 05:28:53 +00:00
rehansari26
70a3eb986c fix: remove unnecessary clear_cache call 2025-04-29 11:49:50 +05:30
rehansari26
bd055ab78c fix: create custom field when doctype is changed 2025-04-28 16:41:53 +05:30
rehansari26
ca812bb307 fix: ensure workflow state field is created post-validation 2025-04-25 17:51:48 +05:30
sokumon
0a4293c49f fix: add control on workflow state to alllow sending emails 2025-04-02 01:03:33 +05:30
sokumon
1320c97a4b fix: set default to not send email to self 2025-03-24 12:11:18 +05:30
sokumon
216223abc8 fix: typo 2025-03-24 02:57:53 +05:30
sokumon
0bc2e197b2 fix: configure if email is sent to creator 2025-03-24 02:29:27 +05:30
Corentin Forler
f72dc93446
fix(workflow_action): Pass context as dict to render template 2025-02-21 14:47:28 +01:00
Sumit Bhanushali
b335abb6aa fix: use get_email_template to support html template in workflow email 2024-10-24 14:43:39 +05:30
David Arnold
0204db6547
chore: move to use new test record api (#28105) 2024-10-12 23:13:41 +00:00
David Arnold
443c38daa9
refactor: toml test records for readability (#28065)
* refactor: toml test records for readability

* fix: maintain backwards compatibility

* refactor: transform in-tree records

* chore: don't use deprecated functions (treewide)

* chore: revert migration of tests which depend on old test records list

* feat: add cls.globalTestRecords on IntegrationTestCase
2024-10-10 13:24:02 +02:00
David Arnold
c114e5fae8
refactor: unit vs integration treewide (#27992)
* refactor: constitute unit test case

* fix: docs and type hints

* refactor: mark presumed integration test cases explicitly

At time of writing, we now have at least two base test classes:

- frappe.tests.UnitTestCase
- frappe.tests.IntegrationTestCase

They load in their perspective priority queue during execution.

Probably more to come for more efficient queing and scheduling.

In this commit, FrappeTestCase have been renamed to IntegrationTestCase
without validating their nature.

* feat: Move test-related functions from test_runner.py to tests/utils.py

* refactor: add bare UnitTestCase to all doctype tests

This should teach LLMs in their next pass that the distinction matters
and that this is widely used framework practice
2024-10-06 09:43:36 +00:00
Akhil Narang
346082643b
chore: format
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-09-13 18:23:00 +05:30
Lyes7
9b89eba337 fix: workflow typos 2024-09-12 10:18:49 +01:00
Ankush Menat
e5271bc034
fix: use document language for workflow action (#26138) 2024-04-24 13:46:25 +05:30
Ankush Menat
3896296c6f fix: update sort order in doctypes 2024-03-27 11:18:28 +05:30
Ankush Menat
b1a8bc9312
fix: Export None as type if select as no options (#25211)
Select options can be dynamic, in that case we should at least the
default value `None` as a value `DF.Literal` otherwise is invalid type
annotation.
2024-03-04 06:42:41 +00:00
Ankush Menat
64a5ebb112
refactor!: Drop user based workflow action compatibility (#24956)
* test: run workflow actions in tests

* test: fix workflow action tests

* refactor!: Remove compatibility with `user` based workflow action

* test: cleanup test cleanups

* fix: restore form dict after printing

* test: patch printing during workflow tests
2024-02-20 14:37:13 +00:00
Nihantra C. Patel
15eb1bf839
fix: send_workflow_action_email (#24929)
* fix: send_workflow_action_email

* fix: send_workflow_action_email
2024-02-19 06:37:20 +00:00
Ankush Menat
8c5aaeb437 test: avoid fiddling with workflow action columns 2024-02-12 12:38:05 +05:30
Ankush Menat
140a01e2cf perf: cache permission results
For each transition, we end up redoing perm check. Nothing has really changed there though.
2024-02-12 11:32:38 +05:30
Ankush Menat
b0a4425230 perf: process workflow email receipients from background 2024-02-12 11:20:17 +05:30
Ankush Menat
8344bce09a refactor: remove needless coupling of return values 2024-02-12 11:14:57 +05:30
Ankush Menat
16fa5ec9bd fix: enqueue_after_commit instead of instantly 2024-02-12 10:51:11 +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