Could you describe "it generates me wrong lines and total values on the invoices" ??
Maybe a solution to avoid the grouping error is to save the first invoice in case None is found, so for the next runs the invoices will be already grouped. Altought your case only is reproducible when deleting I image the behaviour will be also wrong when processing two sales that generate a grouped invoice in a single call as the first invoice won't be saved, so the second sale will create another one.
I do not think
update_taxes should be called as its already called for each created invoice. If there is some issues on grouping we just need to take care to return any invoice that will be modified which should already be the case.
|2022-09-05 15:53:55||pokoli||set||messageid: <1662386035.657886.UOWC7Q3ME5AHZUKA.firstname.lastname@example.org>|
|2022-09-05 15:53:55||pokoli||set||recipients: + ced, acaubet|
|2022-09-05 15:53:55||pokoli||link||issue11685 messages|
Showing 10 items. Show all history (warning: this could be VERY long)