Dolibarr / dolibarr

Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.
https://www.dolibarr.org
GNU General Public License v3.0
5.32k stars 2.75k forks source link

Weird behavior on expedition without stock for warehouse number 1 #27001

Open dbeniamine opened 10 months ago

dbeniamine commented 10 months ago

Bug

If I try to do a delivery without stock (in any warehouse), I have a different behavior depending on the warehouse I use : if I choose warehouse with id == 1 I cannot do the delivery, but with anyother warehouse, I can create the delivery and even choose warehouse 1

Environment Version

18.0.2

Environment OS

Debian 11

Environment Web server

Apache/2.4.54 (Debian)

Environment PHP

7.4.33

Environment Database

15.1 Distrib 10.8.2-MariaDB

Environment URL(s)

/expedition/card.php?action=create&shipping_method_id=&origin=commande&origin_id=&projectid=&entrepot_id=1

Expected and actual behavior

When I create an expedition, here,

image

if I choose the main warehouse I have :

image

And I cannot create the delivery, while if I choose another warehouse, I have :

image

And I can create a delivery. This should be the behavior in both case

Steps to reproduce the behavior

  1. Make sure that negative stocks are allowed
  2. Make sure you have at least 2 warehouses
  3. Create a client order for a product out of stock in all warehouse
  4. Try to create an expedition, works fine with warehouse with id > 1 but not for id == 1

Attached files

No response

jman482002 commented 3 months ago

Same problem here. v19.02

My workaround was to close the old warehouse (ID==1) and transfer all stock to new warehouse. Glad I found this post to confirm the problem and fixed before it caused a huge headache. Please fix!

Thanks