8000 fix(workflows): populate doc in apply_workflow whitelisted method by this-gavagai · Pull Request #21068 · frappe/frappe · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(workflows): populate doc in apply_workflow whitelisted method #21068

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 24, 2023

Conversation

this-gavagai
Copy link
Contributor

The apply_workflow method in frappe.model.workflow consistently fails right now. The problem is accurately described here: #11883

The fix was applied to the get_transitions method, but it was never applied to apply_workflow. As a consequence, the apply_workflow method sends an "empty" document to get_transitions, which leaves the current workflow state undefined and throws an exception here:

https://github.com/frappe/frappe/blame/c643d4a33cc58d10c0a3d81c9ed9df9bf6cc0776/frappe/model/workflow.py#L57

Asking apply_workflow to load from the db solves this problem.

@this-gavagai this-gavagai requested review from a team and phot0n and removed request for a team May 22, 2023 10:59
@github-actions github-actions bot added the add-test-cases Add test case to validate fix or enhancement label May 22, 2023
@this-gavagai this-gavagai changed the title [fix] Fix apply_workflow whitelisted method fix(workflows): populate doc in apply_workflow whitelisted method May 22, 2023
@codecov
Copy link
codecov bot commented May 22, 2023

Codecov Report

Merging #21068 (7ae7783) into develop (22e3ec8) will increase coverage by 0.19%.
The diff coverage is 100.00%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #21068      +/-   ##
===========================================
+ Coverage    63.76%   63.95%   +0.19%     
===========================================
  Files          764      764              
  Lines        69058    69049       -9     
  Branches      6244     6243       -1     
===========================================
+ Hits         44034    44160     +126     
+ Misses       21412    21342      -70     
+ Partials      3612     3547      -65     
Flag Coverage Δ
server 68.92% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@phot0n phot0n merged commit a182414 into frappe:develop May 24, 2023
@phot0n phot0n added backport version-14-hotfix backport to version 14 and removed add-test-cases Add test case to validate fix or enhancement labels May 24, 2023
mergify bot pushed a commit that referenced this pull request May 24, 2023
phot0n pushed a commit that referenced this pull request May 24, 2023
(cherry picked from commit a182414)

Co-authored-by: PeterG <this-gavagai@users.noreply.github.com>
frappe-pr-bot pushed a commit that referenced this pull request May 30, 2023
# [14.37.0](v14.36.3...v14.37.0) (2023-05-30)

### Bug Fixes

* add selected on current dropdown-item ([6af79f2](6af79f2))
* added left icon option ([dd86670](dd86670))
* allow default for text and long text when altering table ([#21109](#21109)) ([#21124](#21124)) ([b8c6a7b](b8c6a7b))
* allow setting default in longtext and text columns ([#21089](#21089)) ([#21123](#21123)) ([1f477c2](1f477c2))
* clear & add email template using select group btn ([e367821](e367821))
* create private custom html block ([a552ad9](a552ad9))
* don't mutate notification when getting cc and bcc ([82515b2](82515b2))
* ensure correct return value for `get_values_from_single` ([aee1775](aee1775))
* Exclude Geolocation from "hide empty read-only field" ([#21088](#21088)) ([#21096](#21096)) ([8b76dab](8b76dab))
* made a util to create shadow element ([0427ae0](0427ae0))
* make desk css available i shadow html ([1c085a6](1c085a6))
* make dropdown item label bold ([7bda6a1](7bda6a1))
* make option toggle button smaller ([3aed586](3aed586))
* misc form tour fixes (backport [#21151](#21151)) ([#21152](#21152)) ([2411e66](2411e66))
* offset log cleanup to avoid deadlocks ([#21105](#21105)) ([#21106](#21106)) ([4ba4c94](4ba4c94))
* only show public and user's private blocks in dropdown ([cffa676](cffa676))
* removed html message since we no longer have no ristrictions ([b5a714b](b5a714b))
* setup wizard recursion in routing ([#21101](#21101)) ([#21102](#21102)) ([6c3026f](6c3026f))
* skip form tours on mobile ([#21180](#21180)) ([d87c815](d87c815))
* **workflow:** populate doc from db in apply_workflow ([#21068](#21068)) ([#21093](#21093)) ([a447488](a447488))

### Features

* Allow setting cron as Server Script frequency (backport [#21142](#21142)) ([#21161](#21161)) ([ededac7](ededac7))
* Round QB function ([9d9465a](9d9465a))
* select group button ([e9a474c](e9a474c))
* Truncate QB function ([5d24591](5d24591))
* UI onboarding tours [v14] ([#21114](#21114)) ([181f509](181f509))
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport version-14-hotfix backport to version 14
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0