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.27k stars 2.73k forks source link

Exception occurs when searching on extrafield on command list #19228

Closed daxitsolutions closed 2 years ago

daxitsolutions commented 2 years ago

Bug

An exception occurs when searching for extrafield on the command list

Environment

Expected and actual behavior

search on the extrafield without exception

Steps to reproduce the behavior

Add an extrafield to the command object (selection list) Go to the command list Add the extrafield to the column shown on the list Search by using a list of value

Debug message / Exception received

`Dolibarr a détecté une erreur technique. Voici les informations qui pourront aider au diagnostic (Vous pouvez fixer l'option $dolibarr_main_prod sur '1' pour supprimer quelques notifications): Date: 20211027232126 Dolibarr: 13.0.3 - https://www.dolibarr.org Niveau de fonctionnalités: 0 PHP: 7.3.31-1~deb10u1 Server: Apache/2.4.38 (Debian) OS: Linux production-wittamer 4.19.0-17-cloud-amd64 #1 SMP Debian 4.19.194-3 (2021-07-18) x86_64 UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:93.0) Gecko/20100101 Firefox/93.0

Url sollicitée: /commande/list.php Referer: https://sakura-erp.com/commande/list.php?leftmenu=orders Gestionnaire de menu: eldy_menu.php

Modules/Applications: syslog, user, api, societe, commande, expedition, product, service, stock, variants, bom, mrp, barcode, categorie, export, import, workflow, facture, banque, cron Type gestionnaire de base de données: pgsql Requête dernier accès en base en erreur: SELECT s.rowid as socid, s.nom as name, s.name_alias, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client, typent.code as typent_code, state.code_departement as state_code, state.nom as state_name, c.rowid, c.ref, c.total_ht, c.tva as total_tva, c.total_ttc, c.ref_client, c.fk_user_author, c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multicurrency_total_ht, c.multicurrency_total_tva as multicurrency_total_vat, c.multicurrency_total_ttc, c.date_valid, c.date_commande, c.note_public, c.note_private, c.date_livraison as date_delivery, c.fk_statut, c.facture as billed, c.date_creation as date_creation, c.tms as date_update, c.date_cloture as date_cloture, p.rowid as project_id, p.ref as project_ref, p.title as project_label, u.login, ef.cmdposname as options_cmdposname, ef.a001 as options_a001, ef.l001 as options_l001, ef.nom_vendeuse as options_nom_vendeuse, ef.cmdsn1 as options_cmdsn1 FROM llx_societe as s LEFT JOIN llx_c_country as country on (country.rowid = s.fk_pays) LEFT JOIN llx_c_typent as typent on (typent.id = s.fk_typent) LEFT JOIN llx_c_departements as state on (state.rowid = s.fk_departement), llx_commande as c LEFT JOIN llx_commande_extrafields as ef on (c.rowid = ef.fk_object) LEFT JOIN llx_projet as p ON p.rowid = c.fk_projet LEFT JOIN llx_user as u ON c.fk_user_author = u.rowid WHERE c.fk_soc = s.rowid AND c.entity IN (1) AND (ef.cmdposname = "WIT_SAB_1") ORDER BY c.ref DESC LIMIT 26 Code retour dernier accès en base en erreur: DB_ERROR_NOSUCHFIELD Information sur le dernier accès en base en erreur: ERROR: 42703: column "WIT_SAB_1" does not exist\nLINE 1: ... s.rowid AND c.entity IN (1) AND (ef.cmdposname = "WIT_SAB_1...\n ^\nLOCATION: errorMissingColumn, parse_relation.c:3294 `

Attached files (Screenshots, screencasts, dolibarr.log, debugging informations…)

[Files] Configuration_du_module_Commandes

Liste_des_commandes exception

daxitsolutions commented 2 years ago

Really wierd because the statemenet SELECT s.rowid as socid, s.nom as name, s.name_alias, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client, typent.code as typent_code, state.code_departement as state_code, state.nom as state_name, c.rowid, c.ref, c.total_ht, c.tva as total_tva, c.total_ttc, c.ref_client, c.fk_user_author, c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multicurrency_total_ht, c.multicurrency_total_tva as multicurrency_total_vat, c.multicurrency_total_ttc, c.date_valid, c.date_commande, c.note_public, c.note_private, c.date_livraison as date_delivery, c.fk_statut, c.facture as billed, c.date_creation as date_creation, c.tms as date_update, c.date_cloture as date_cloture, p.rowid as project_id, p.ref as project_ref, p.title as project_label, u.login, ef.cmdposname as options_cmdposname, ef.a001 as options_a001, ef.l001 as options_l001, ef.nom_vendeuse as options_nom_vendeuse, ef.cmdsn1 as options_cmdsn1 FROM llx_societe as s LEFT JOIN llx_c_country as country on (country.rowid = s.fk_pays) LEFT JOIN llx_c_typent as typent on (typent.id = s.fk_typent) LEFT JOIN llx_c_departements as state on (state.rowid = s.fk_departement), llx_commande as c LEFT JOIN llx_commande_extrafields as ef on (c.rowid = ef.fk_object) LEFT JOIN llx_projet as p ON p.rowid = c.fk_projet LEFT JOIN llx_user as u ON c.fk_user_author = u.rowid WHERE c.fk_soc = s.rowid AND c.entity IN (1) AND (ef.cmdposname = "WIT_GRA_1") ORDER BY c.ref DESC LIMIT 26 Looks pretty decent and well formatted and not linked with the error given by psql..

ksar-ksar commented 2 years ago

Hello,

Try to upgrade to v13.0.5

daxitsolutions commented 2 years ago

Update to 14.X fix the issue. Thanks