Skip to content

[FIX] helpdesk_mgmt: Prevent duplicate ticket submission#1036

Open
shirashi3771 wants to merge 1 commit into
OCA:17.0from
APSL:17.0-fix-helpdesk_mgmt
Open

[FIX] helpdesk_mgmt: Prevent duplicate ticket submission#1036
shirashi3771 wants to merge 1 commit into
OCA:17.0from
APSL:17.0-fix-helpdesk_mgmt

Conversation

@shirashi3771

Copy link
Copy Markdown

Prevent duplicate ticket submissions by disabling the submit button after the first click.

cc https://github.com/APSL 48227

@mpascuall @lbarry-apsl @miquelalzanillas @peluko00 @BernatObrador @cubells @palomagrc93 @ppyczko @isugac @javierobcn @LlucSG please review.

@peluko00

Copy link
Copy Markdown

Hi @shirashi3771, could you please add tests for this case?

@ppyczko ppyczko left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @shirashi3771

I've tested this in Runboat and, at the moment, it isn't possible to create a ticket from the portal.

When pressing the "Submit Ticket" button, by the time _onSubmit is executed, btn.disabled is already true, so this block is triggered:

Image

As a result, the form submission is prevented and no POST request is sent.

This is probably due to your code conflicting with this change: https://github.com/OCA/helpdesk/pull/948/changes

This inline onsubmit disables the button before your _onSubmit runs, therefore, interprets the very first submission as a duplicate submission and cancels it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants