Community mailing list archives
Re: Invoice can be deleted but not recreatedby
The problem is that today, you cannot stop the user from deleting a document, if he thinks the document is totally wrong. A delete function should always check different statuses and reset them, to be correct. A delete function that deletes only the document without any warning and any rollback is not a properly defined function.
For user, the situation as it is now, is not tolerable, as there is no way to retrace what really happened...
What is even stranger is that, this happens only for the control on PO lines. If you delete an invoice for control on PO, the PO goes into exception. At least the system should have a mechanism to recreate the invoice based on PO lines, or any way to correct what was done wrong. This is basically the issue here. The user has no way of acting...and you cannot expect from each user to go into the database and start playing with the data to put the proper status for the PO.
On 22 Apr 2015, at 17:22, Dominique Chabord <firstname.lastname@example.org> wrote:2015-04-22 18:02 GMT+02:00 Jordi Ballester Alomar <email@example.com>: > > > On Wed, Apr 22, 2015 at 5:48 PM, Dominique Chabord > <firstname.lastname@example.org> wrote: >> > >> > These situations should be prevented. Possibly by making sure that an >> > invoice cannot be deleted once it has been referenced. >> >> This would be a deep change in Odoo. What if you just modify the >> invoice ? The basic workflow is at stake, I think. > > Not sure why it would be a big change. Any simple solution would be good news. > When the user attempts to delete, the > system checks if there's a PO that references this invoice. If there is, you > stop the user from doing so. Preventing to delete a draft would probably lead to side effects, I don't know. If it depends on a specific workflow, or a predefined set of modules, it limits its validity as a general solution. What if you modify the lines of the invoice ? You must be allowed to do so and you may mess everything with no reverse path. Shouldn't you also block lines editing ? and wouldn't that be worse than the today behavior ?