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.23k stars 2.72k forks source link

Societe tinyint(4) can hold only up to number 126 for link to rowid #29639

Open vsatmydynipnet opened 4 months ago

vsatmydynipnet commented 4 months ago

Bug

I imported payment terms from another erp to Dolibarr. In c_payment_terms rowid grows over 126 due to more than one import aso. The cond_reglement_supplier and cond_reglement are tinyint(4) which created masses of errors in the import script if rowid was above 126 in c_payment_terms.

Found it and resetted the c_payment_terms table, but this costs me 2 hours to find out.

Dolibarr Version

19.0.0

Environment PHP

8.2

Environment Database

No response

Steps to reproduce the behavior and expected behavior

No response

Attached files

No response

Daviid-P commented 2 months ago

Not even imports, I was just testing adding and deleting payment terms inside dolibarr to work out all the options and today I just crossed 127 rowid.

This would've been caught if cond_reglement_supplier, cond_reglement where foreign keys, which I assume would've errored because rowid is INT(11) and not TINYINT(4) (Probably the same problem in llx_c_paiement with mode_reglement and mode_reglement_supplier)