Alphabetical order of Products in Supplier-Order drop-down list

When I make a supplier order, the drop-down list that appears to select a product is not listed alphabetically, not by reference, not by database RowID. The list order is completely nonsense for me:

Is there any way to tell Dolibarr (12.04 in my case) to order this drop down list alphabetically? I know I can make a search in the list to select a product, but sometimes,when you are not sure which product to select it is easier to browse alphabetically the list directly.

Thanks

Hello :grinning:

Can you make some test using phpmyadmin, it is perhaps because a constant value has been placed in llx_const table with this name : PRODUCT_SORT_BY_CATEGORY

or perhaps because you use a special plugin for displaying your products

Good continuation

Thanks for your answer.

I have no table with this name in llx_const.

Those days I made a fresh install of Dolibarr 12.0.4, 12.0.5, 13.0.0 and 13.0.1 only activating the needed modules (all included in the base installation of Dolibarr) and I get the same behavior, no order in the drop-down menu. When I start to add products, at the beginning the are sorted by RowID in inverse order, but after adding some more there is no order again.

I don’t know if it is a PHP version problem (I have 7.2) or Database (Mysql 5.5).

With other installation in other server, with a Bitnami Dolibarr 13.0.0 (PHP 7.3 and Mysql 5.7) the order of the drop-down list is by reference, but in the same server with version 12.0.4 there is no order again.

Very wired everything.

Hello :grinning:

your table containing constant values is probably with a prefix different than “llx_”
you can find it with the menu “Admin tools, About Dolibarr” -> “Utilidades administración, Acerca de Dolibarr”

with phpmyadmin, can you control if PRODUCT_SORT_BY_CATEGORY is set

for example using this query : SELECT * FROM llx_const where name =‘PRODUCT_SORT_BY_CATEGORY’

Good continuation

Thanks again,

I think I did not explain good myself.

The table llx_const is present in my database, but there are no “PRODUCT_SORT_BY_CATEGORY” entry on it, so the query give me no result.

I have created an entry named “PRODUCT_SORT_BY_CATEGORY” playing with the value 1 and 0 but without success.

The only solution I found is just import the Products in this weird order. For instance, the order I get in the drop-down list is Product 51, Product 19, Product 40… so I put my product 1 in the row 51 of an Excel file, Product 2 in the row 19, etc. And doing this manually and importing afterwards this excel file with the complete list of products I get the alphabetically order (by reference) in the dropdown list.

The only problem is that after a while working with my Dolibarr installation, this order changes (who knows why) and the drop-down list starts from Product number 5, or 29. Hopefully the list (starting from 5 or 29 follows alphabetically).

I think it should be a problem of my server. But who knows.