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.31k stars 2.75k forks source link

llx_receptiondet_batch_rowid_seq does not exist when creating reception #31228

Open GMellar opened 3 hours ago

GMellar commented 3 hours ago

Bug

When creating a new reception from a purchase order I get an error since update to 20.0.0 from version 19.0.3:

ERROR: 42P01: relation "llx_receptiondet_batch_rowid_seq" does not exist LINE 1: SELECT currval('llx_receptiondet_batch_rowid_seq') ^ LOCATION: RangeVarGetRelidExtended, namespace.c:433

Dolibarr Version

20.0.0

Environment PHP

8.2

Environment Database

postgresql 15

Steps to reproduce the behavior and expected behavior

1) Create purchase order and make that order 2) Create a reception and force to a specific warehouse

Attached files

No response

GMellar commented 2 hours ago

Possible solution for postgresql is to re/create the sequence manually:


CREATE SEQUENCE llx_receptiondet_batch_rowid_seq OWNED BY llx_receptiondet_batch.rowid;
ALTER TABLE llx_receptiondet_batch ALTER COLUMN rowid SET DEFAULT nextval('llx_receptiondet_batch_rowid_seq');
SELECT setval('llx_receptiondet_batch_rowid_seq', MAX(rowid)) FROM llx_receptiondet_batch;

I still don't know why this sequence was deleted during upgrade.