Skip to content

Commit

Permalink
Merge pull request #7654 from ehuelsmann/fix/1.11/order-deletion-limbo
Browse files Browse the repository at this point in the history
Fix Order/Quote workflows ending in limbo on deletion
ehuelsmann authored Oct 9, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 2766447 + 733e093 commit 2f3f395
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions old/bin/oe.pl
Original file line number Diff line number Diff line change
@@ -1356,10 +1356,15 @@ sub _print_and_save {

sub delete {

my $wf = $form->{_wire}->get('workflows')
->fetch_workflow( 'Order/Quote', $form->{workflow_id} );
$wf->execute_action( 'delete' );
$form->header;
# The actual deletion in executed in the "yes" function below;
# if we execute the "delete" action here, we'll land the order/quote
# in limbo if the "yes" action isn't performed on the UI side (the
# workflow has a DELETED state whereas the quote still exists...)
#
# my $wf = $form->{_wire}->get('workflows')
# ->fetch_workflow( 'Order/Quote', $form->{workflow_id} );
# $wf->execute_action( 'delete' );
# $form->header;

if ( $form->{type} =~ /_order$/ ) {
$msg = $locale->text('Are you sure you want to delete Order Number');
@@ -1398,6 +1403,11 @@ sub delete {

sub yes {

my $wf = $form->{_wire}->get('workflows')
->fetch_workflow( 'Order/Quote', $form->{workflow_id} );
$wf->execute_action( 'delete' );
$form->header;

if ( $form->{type} =~ /_order$/ ) {
$msg = $locale->text('Order deleted!');
$err = $locale->text('Cannot delete order!');

0 comments on commit 2f3f395

Please sign in to comment.