Skip to content
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

fix: handle multiple webform for same doctype #21220

Merged

Conversation

shariquerik
Copy link
Member

@shariquerik shariquerik commented Jun 3, 2023

If you want to create multiple web forms for the same doctype and allow_multiple is not set.
If the user already submitted a web form before and now is asked to submit again for another webform for the same doctype he will not be able to since the old record already exists and it will be displayed if he tries to hit /new

E.g.
We create separate web forms to get a count of employees coming for the company offsite and we store all the data in the same doctype named Offsite.
At the start of the year, we went on our first trip and created a web form named Bhopal Offsite now again at the end of the year we are planning to go for another trip so need to create another web form named Igatpuri Offsite but since each employee have already submitted a response through Bhopal Offsite webform if we create a new web form for same doctype they will be not able to submit a new response since old offsite record already exist.

Now after the fix, we can add a condition in Webform which will be evaluated and if the record does not exist he/she will be able to submit a new response

image

@shariquerik shariquerik requested a review from a team as a code owner June 3, 2023 11:55
@shariquerik shariquerik requested review from phot0n and removed request for a team June 3, 2023 11:55
@github-actions github-actions bot added the add-test-cases Add test case to validate fix or enhancement label Jun 3, 2023
@shariquerik shariquerik added the backport version-14-hotfix backport to version 14 label Jun 3, 2023
@codecov
Copy link

codecov bot commented Jun 3, 2023

Codecov Report

Merging #21220 (38513cc) into develop (cb885a8) will decrease coverage by 0.05%.
The diff coverage is 50.00%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #21220      +/-   ##
===========================================
- Coverage    63.89%   63.85%   -0.05%     
===========================================
  Files          765      765              
  Lines        69326    69323       -3     
  Branches      6261     6261              
===========================================
- Hits         44295    44264      -31     
- Misses       21468    21496      +28     
  Partials      3563     3563              
Flag Coverage Δ
server 68.91% <0.00%> (-0.03%) ⬇️
server-ui 32.21% <50.00%> (+0.03%) ⬆️
ui-tests 51.51% <ø> (-0.10%) ⬇️

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

@shariquerik shariquerik merged commit a049b7f into frappe:develop Jun 3, 2023
20 of 22 checks passed
@shariquerik shariquerik deleted the multiple-webform-for-same-doctype branch June 3, 2023 12:20
shariquerik added a commit that referenced this pull request Jun 3, 2023
…-21220

fix: handle multiple webform for same doctype (backport #21220)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
add-test-cases Add test case to validate fix or enhancement backport version-14-hotfix backport to version 14
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant