# When you delete the supplier invoice, the products are not deleted from stock

**URL:** <https://www.dolibarr.org/forum/t/when-you-delete-the-supplier-invoice-the-products-are-not-deleted-from-stock/24605>\
**Category:** Maintaining my Dolibarr\
**Tags:** Stock, Supplier-Invoices\
**Created:** [November 25, 2023, 1:28pm UTC](https://www.dolibarr.org/forum/t/when-you-delete-the-supplier-invoice-the-products-are-not-deleted-from-stock/24605 "2023-11-25T13:28:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![driss.benchekroun](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/d/c67d28/32.png) [@driss.benchekroun](https://www.dolibarr.org/forum/u/driss.benchekroun)\
**Post date:** [November 25, 2023, 1:28pm UTC](https://www.dolibarr.org/forum/t/when-you-delete-the-supplier-invoice-the-products-are-not-deleted-from-stock/24605/1 "2023-11-25T13:28:16Z")

</div>

Hello team,

I am on version 18.0.3 of Dolibarr,

I have the option : Decrement physical stocks upon validation of customer invoices/credit notes activated

when I delete a supplier invoice, the products which are on the invoice are not deleted from the stock, and on the movements of the product the quantity remains positive so if we re-enter the invoice we have a duplicate product quantity on the stock!

please assist, thanks and regards

---

<div class="post-metadata">

**Author:** ![sonikf](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/s/97f17d/32.png) [@sonikf](https://www.dolibarr.org/forum/u/sonikf)\
**Post date:** [November 25, 2023, 2:02pm UTC](https://www.dolibarr.org/forum/t/when-you-delete-the-supplier-invoice-the-products-are-not-deleted-from-stock/24605/2 "2023-11-25T14:02:17Z")

</div>

Hi @driss.benchekroun  
Deleting validated customer or supplier invoices is a bad practice!  
You have to manually decrease stock for each product in the supplier invoice you deleted from each products card.

---

<div class="post-metadata">

**Author:** ![driss.benchekroun](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/d/c67d28/32.png) [@driss.benchekroun](https://www.dolibarr.org/forum/u/driss.benchekroun)\
**Post date:** [November 26, 2023, 12:15pm UTC](https://www.dolibarr.org/forum/t/when-you-delete-the-supplier-invoice-the-products-are-not-deleted-from-stock/24605/3 "2023-11-26T12:15:29Z")

</div>

hi dear @sonikf and thank you for your reply,

"Currently, deleting a customer invoice triggers stock movements without any issues. However, the problem arises specifically when deleting a supplier invoice. Since we operate on Dolibarr as a team, it becomes challenging to have a good stock in case other people delete supplier invoice.

The standard procedure dictates that when an invoice is deleted, there should be a corresponding decrease in stock. In programming terms, an automatic devalidation process should be initiated."

---

<div class="post-metadata">

**Author:** ![sonikf](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/s/97f17d/32.png) [@sonikf](https://www.dolibarr.org/forum/u/sonikf)\
**Post date:** [November 26, 2023, 1:58pm UTC](https://www.dolibarr.org/forum/t/when-you-delete-the-supplier-invoice-the-products-are-not-deleted-from-stock/24605/4 "2023-11-26T13:58:01Z")

</div>

Hi @driss.benchekroun  
I just saw this [pull request](https://github.com/Dolibarr/dolibarr/pull/26852) that may solve your problem!

---

<div class="post-metadata">

**Author:** ![nurfz](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/n/bbe5ce/32.png) [@nurfz](https://www.dolibarr.org/forum/u/nurfz)\
**Post date:** [November 26, 2023, 5:46pm UTC](https://www.dolibarr.org/forum/t/when-you-delete-the-supplier-invoice-the-products-are-not-deleted-from-stock/24605/5 "2023-11-26T17:46:59Z")

</div>

Just a question from a newbie…

My sample supplier invoice doesn’t even has a Approve or Disapprove button. After it’s validated, it only has Delete, Create Credit Note, and Classify Abandoned.

So how is it it supposed to increment or decrement the stock? Isn’t it done via Create Reception?

---

<div class="post-metadata">

**Author:** ![driss.benchekroun](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/d/c67d28/32.png) [@driss.benchekroun](https://www.dolibarr.org/forum/u/driss.benchekroun)\
**Post date:** [November 27, 2023, 11:31am UTC](https://www.dolibarr.org/forum/t/when-you-delete-the-supplier-invoice-the-products-are-not-deleted-from-stock/24605/6 "2023-11-27T11:31:51Z")

</div>

thanks @sonikf for this,  
this topic is about “supplier order disapproval”, and on this version, the disapproval is ok, I checked, for me when I click on invoice disapproval, the stock is moved out!

the problem I have is the same but with the “supplier order deletion”
