OpenUpgrade icon indicating copy to clipboard operation
OpenUpgrade copied to clipboard

[FIX][12.0 -> 13.0]Duplicate move when invoice is draft

Open dansanti opened this issue 2 years ago • 3 comments

In some cases, when the invoice is in draft status and has an associated move line, the previous code associated the invoice with the invoice ID. This fix associates the invoice with the associated move line's move_id. to reproduce:

  • create invoice in draft
  • create a move in draft
  • create a move line for this move
  • reference that line to draft invoice

dansanti avatar Dec 10 '23 13:12 dansanti

By definition, a draft invoice can't have an associated move, so that should be a customization on your end, so you should handle this on your side.

pedrobaeza avatar Dec 10 '23 15:12 pedrobaeza

The original code try to support that case, so this means that is not a customization, I only fix the reference, because originally reference to invoice_id, but must be referenced to move id,, maybe happens when a invoice is open and late was closed.

With the original code, get not found id or is associate to another record (because invoice_id)

dansanti avatar Dec 10 '23 23:12 dansanti

Well, unless you put some clear steps to reproduce the problem, this code has been working since a lot without issues reported, so if it's something without extra custom flows, nobody has seen it.

pedrobaeza avatar Dec 11 '23 07:12 pedrobaeza