Modify invoice using Workflow duplicates Line Items on Invoice

Hello to everyone
I am new here so please help me … i’m going crazy about this :woohoo:

I use SuiteCRM
Version 7.1.1
Sugar Version 6.5.16 (Build 1082)

I am trying to modify an invoice based on a value of certain fields on the invoice using WorkFlow.
However, if the trigger fields are changed at the time of invoice creation,workflow duplicate line items on the invoice.
If the invoice is already saved line items on invoice dont duplicate.
Why is this happening? Can anyone help me?

below is a printscreen of my WorkFlow rules and an invoice modified using workflow

i tried a fresh install of suitecrm with no custom fields but this behaviour happens every time when using
workflow with invoice.
PLEASE HELP.

Hi there,

This is a bug. Thank you for highlighting this.

Regards,

Will.

Try chnaging the following code in ‘modules/AOS_Products_Quotes/AOS_Products_Quotes.php’ at about line 56 :-


$product_quote->parent_type = $parent->object_name;
$product_quote->save();
}

to


$product_quote->parent_type = $parent->object_name;
$product_quote->save();
$_POST[$key.'id'][$i] = $product_quote->id;
}

Thank you Will for your very fast reply.

Can you guide me how to correct this Bug ?
I really need to automatically mark invoices as payd if payed amount is greater or equal to invoice grand total , using workflow.

Thank you in advance !!!

THANK YOU MATT !!!
IT WORKED LIKE A CHARM !!!

I WILL TEST THIS FURTHER.

after testing, i think it’s safe to say that this bug is fixed :slight_smile:
thank you again !