From cf11ecd0859a2867a1f2c691d61ae7a8564ff375 Mon Sep 17 00:00:00 2001 From: Bahfir Abbes Date: Sun, 9 Jul 2023 15:11:16 +0200 Subject: [PATCH 1/9] Fix:warehouses table name is entrepot which does not hold an fk_soc field, so _checkAccessToResource returns always false and must be disabled before fix. (#25135) * Fix:warehouses table name is entrepot which does not hold an fk_soc field, so _checkAccessToResource returns always false and must be disabled before fix. * Fix:warehouses table name is entrepot which does not hold an fk_soc field, so _checkAccessToResource returns always false and must be disabled before fix. * Fix check params It is sufficient to fix check parameters to get it working * Update api_warehouses.class.php --------- Co-authored-by: Laurent Destailleur --- htdocs/product/stock/class/api_warehouses.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/class/api_warehouses.class.php b/htdocs/product/stock/class/api_warehouses.class.php index eb6a03c7d45..fcaf40826e3 100644 --- a/htdocs/product/stock/class/api_warehouses.class.php +++ b/htdocs/product/stock/class/api_warehouses.class.php @@ -71,7 +71,7 @@ class Warehouses extends DolibarrApi throw new RestException(404, 'warehouse not found'); } - if (!DolibarrApi::_checkAccessToResource('warehouse', $this->warehouse->id)) { + if (!DolibarrApi::_checkAccessToResource('stock', $this->warehouse->id, 'entrepot')) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } From a9db2f6dba8429baadeeb3eaca9666ca82176c37 Mon Sep 17 00:00:00 2001 From: Vincent Penel Date: Mon, 9 Mar 2026 00:37:22 +0100 Subject: [PATCH 2/9] Fix ticket categories dictionay (#37434) --- htdocs/core/modules/modTicket.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php index 5228cd1ae74..08414da0dc6 100644 --- a/htdocs/core/modules/modTicket.class.php +++ b/htdocs/core/modules/modTicket.class.php @@ -148,13 +148,13 @@ class modTicket extends DolibarrModules 'tabsql' => array( 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM '.MAIN_DB_PREFIX.'c_ticket_type as f', 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM '.MAIN_DB_PREFIX.'c_ticket_severity as f', - 'SELECT f.rowid as rowid, f.entity, f.code, f.pos, f.label, f.active, f.use_default, f.public, f.fk_parent FROM '.MAIN_DB_PREFIX.'c_ticket_category as f', + 'SELECT f.rowid as rowid, f.entity, f.code, f.pos, f.label, f.active, f.use_default, f.public, f.fk_parent,entity FROM '.MAIN_DB_PREFIX.'c_ticket_category as f', 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM '.MAIN_DB_PREFIX.'c_ticket_resolution as f' ), 'tabsqlsort' => array("pos ASC", "pos ASC", "pos ASC", "pos ASC"), 'tabfield' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public,fk_parent", "code,label,pos,use_default"), - 'tabfieldvalue' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public,fk_parent", "code,label,pos,use_default"), - 'tabfieldinsert' => array("code,label,pos,use_default", "code,label,pos,use_default", "entity, code,label,pos,use_default,public,fk_parent", "code,label,pos,use_default"), + 'tabfieldvalue' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public,fk_parent,entity", "code,label,pos,use_default"), + 'tabfieldinsert' => array("code,label,pos,use_default", "code,label,pos,use_default", "entity, code,label,pos,use_default,public,fk_parent,entity", "code,label,pos,use_default"), 'tabrowid' => array("rowid", "rowid", "rowid", "rowid"), 'tabcond' => array($conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled && getDolGlobalString('TICKET_ENABLE_RESOLUTION')), 'tabhelp' => array( From 6689f5bb52fff4072947462a46bef967171a925d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Mar 2026 11:36:05 +0100 Subject: [PATCH 3/9] Test --- .github/workflows/pr-18-testldr.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-18-testldr.yaml b/.github/workflows/pr-18-testldr.yaml index 6babdf86b76..7d9cd432864 100644 --- a/.github/workflows/pr-18-testldr.yaml +++ b/.github/workflows/pr-18-testldr.yaml @@ -46,11 +46,15 @@ jobs: GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} prid: ${{ github.event.pull_request.number }} prid2: ${{ github.event.pull_request_target.number }} + prref: ${{ github.event.pull_request.ref }} + prref2: ${{ github.event.pull_request_target.ref }} url: ${{ github.event.pull_request.html_url }} url2: ${{ github.event.pull_request_target.html_url }} run: | echo "env.prid=${{env.prid}}" - echo "env.prid=${{env.prid2}}" + echo "env.prid2=${{env.prid2}}" + echo "env.prref=${{env.prref}}" + echo "env.prref2=${{env.prref2}}" echo "env.url=${{env.url}}" echo "env.url2=${{env.url2}}" gh pr edit "${{env.prid}}" --add-label "Issue for v18 maintenance Team" From 3016301ae817d8f9bea2a92fddc941b669954783 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Mar 2026 11:40:07 +0100 Subject: [PATCH 4/9] Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 --- .github/workflows/pr-18-testldr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-18-testldr.yaml b/.github/workflows/pr-18-testldr.yaml index 7d9cd432864..32abe8e7e8e 100644 --- a/.github/workflows/pr-18-testldr.yaml +++ b/.github/workflows/pr-18-testldr.yaml @@ -75,7 +75,7 @@ jobs: echo "reviewers=$(IFS=, ; echo "${FINAL_REVIEWERS[*]}")" >> $GITHUB_OUTPUT - name: Assign reviewers - if: steps.set-reviewers.outputs.reviewers != '' + if: steps.set-reviewers.outputs.reviewers != '' && ${{env.prid}} != '' env: GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} prid: ${{ github.event.pull_request.number }} From ea60298eebf97bb111515cfc45a819e95cd332e8 Mon Sep 17 00:00:00 2001 From: lvessiller-opendsi Date: Thu, 12 Mar 2026 13:46:23 +0100 Subject: [PATCH 5/9] FIX show export full documents checkbox on change format in accountancy export (#37468) * FIX show export full documents checkbox on change format in accountancy export * FIX remove unused var --- htdocs/accountancy/bookkeeping/export.php | 35 +++++++++++++++++------ 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/export.php b/htdocs/accountancy/bookkeeping/export.php index 665111dc394..9966e665fdf 100644 --- a/htdocs/accountancy/bookkeeping/export.php +++ b/htdocs/accountancy/bookkeeping/export.php @@ -764,16 +764,35 @@ if ($action == 'export_file') { } // add documents in an archive for accountancy export (Quadratus) - if (getDolGlobalString('ACCOUNTING_EXPORT_MODELCSV') == AccountancyExport::$EXPORT_TYPE_QUADRATUS) { - $form_question['notifiedexportfull'] = array( - 'name' => 'notifiedexportfull', - 'type' => 'checkbox', - 'label' => $langs->trans('NotifiedExportFull'), - 'value' => 'false', - ); - } + $exportTypesWithDocs = array( + AccountancyExport::$EXPORT_TYPE_QUADRATUS, + ); + $form_question['notifiedexportfull'] = array( + 'name' => 'notifiedexportfull', + 'type' => 'checkbox', + 'label' => $langs->trans('NotifiedExportFull'), + 'value' => 'false', + ); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").'...', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 420, 600); + $formconfirm .= ''; } // Print form confirm From ff204097e328fa4f78bdc07a1f9f35b8642a064f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Mar 2026 14:14:17 +0100 Subject: [PATCH 6/9] Revert "Fix ticket categories dictionay (#37434)" This reverts commit a9db2f6dba8429baadeeb3eaca9666ca82176c37. --- htdocs/core/modules/modTicket.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php index 08414da0dc6..5228cd1ae74 100644 --- a/htdocs/core/modules/modTicket.class.php +++ b/htdocs/core/modules/modTicket.class.php @@ -148,13 +148,13 @@ class modTicket extends DolibarrModules 'tabsql' => array( 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM '.MAIN_DB_PREFIX.'c_ticket_type as f', 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM '.MAIN_DB_PREFIX.'c_ticket_severity as f', - 'SELECT f.rowid as rowid, f.entity, f.code, f.pos, f.label, f.active, f.use_default, f.public, f.fk_parent,entity FROM '.MAIN_DB_PREFIX.'c_ticket_category as f', + 'SELECT f.rowid as rowid, f.entity, f.code, f.pos, f.label, f.active, f.use_default, f.public, f.fk_parent FROM '.MAIN_DB_PREFIX.'c_ticket_category as f', 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM '.MAIN_DB_PREFIX.'c_ticket_resolution as f' ), 'tabsqlsort' => array("pos ASC", "pos ASC", "pos ASC", "pos ASC"), 'tabfield' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public,fk_parent", "code,label,pos,use_default"), - 'tabfieldvalue' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public,fk_parent,entity", "code,label,pos,use_default"), - 'tabfieldinsert' => array("code,label,pos,use_default", "code,label,pos,use_default", "entity, code,label,pos,use_default,public,fk_parent,entity", "code,label,pos,use_default"), + 'tabfieldvalue' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public,fk_parent", "code,label,pos,use_default"), + 'tabfieldinsert' => array("code,label,pos,use_default", "code,label,pos,use_default", "entity, code,label,pos,use_default,public,fk_parent", "code,label,pos,use_default"), 'tabrowid' => array("rowid", "rowid", "rowid", "rowid"), 'tabcond' => array($conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled && getDolGlobalString('TICKET_ENABLE_RESOLUTION')), 'tabhelp' => array( From e29b74195866ac97e6571ee6065a782312c838fb Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 12 Mar 2026 14:40:36 +0100 Subject: [PATCH 7/9] Fix : disabled extrafield should not appear on PDF (#37442) --- htdocs/core/class/commondocgenerator.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 1d7008aae59..a333a0b5fc2 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -1453,8 +1453,12 @@ abstract class CommonDocGenerator foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label) { // Enable extrafield ? $enabled = 0; + if (!empty($extrafields->attributes[$object->table_element]['enabled'][$key])) { + $enabled = (int) dol_eval((string) $extrafields->attributes[$object->table_element]['enabled'][$key], 1, 1, '2'); + } + $disableOnEmpty = 0; - if (!empty($extrafields->attributes[$object->table_element]['printable'][$key])) { + if ($enabled && !empty($extrafields->attributes[$object->table_element]['printable'][$key])) { $printable = intval($extrafields->attributes[$object->table_element]['printable'][$key]); if (in_array($printable, $params['printableEnable']) || in_array($printable, $params['printableEnableNotEmpty'])) { $enabled = 1; From f23b1801e5605f52970c24e8ae394f74c6c0a07a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Mar 2026 21:42:20 +0100 Subject: [PATCH 8/9] Revert "Revert "Fix ticket categories dictionay (#37434)"" This reverts commit ff204097e328fa4f78bdc07a1f9f35b8642a064f. --- htdocs/core/modules/modTicket.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php index 5228cd1ae74..08414da0dc6 100644 --- a/htdocs/core/modules/modTicket.class.php +++ b/htdocs/core/modules/modTicket.class.php @@ -148,13 +148,13 @@ class modTicket extends DolibarrModules 'tabsql' => array( 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM '.MAIN_DB_PREFIX.'c_ticket_type as f', 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM '.MAIN_DB_PREFIX.'c_ticket_severity as f', - 'SELECT f.rowid as rowid, f.entity, f.code, f.pos, f.label, f.active, f.use_default, f.public, f.fk_parent FROM '.MAIN_DB_PREFIX.'c_ticket_category as f', + 'SELECT f.rowid as rowid, f.entity, f.code, f.pos, f.label, f.active, f.use_default, f.public, f.fk_parent,entity FROM '.MAIN_DB_PREFIX.'c_ticket_category as f', 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM '.MAIN_DB_PREFIX.'c_ticket_resolution as f' ), 'tabsqlsort' => array("pos ASC", "pos ASC", "pos ASC", "pos ASC"), 'tabfield' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public,fk_parent", "code,label,pos,use_default"), - 'tabfieldvalue' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public,fk_parent", "code,label,pos,use_default"), - 'tabfieldinsert' => array("code,label,pos,use_default", "code,label,pos,use_default", "entity, code,label,pos,use_default,public,fk_parent", "code,label,pos,use_default"), + 'tabfieldvalue' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public,fk_parent,entity", "code,label,pos,use_default"), + 'tabfieldinsert' => array("code,label,pos,use_default", "code,label,pos,use_default", "entity, code,label,pos,use_default,public,fk_parent,entity", "code,label,pos,use_default"), 'tabrowid' => array("rowid", "rowid", "rowid", "rowid"), 'tabcond' => array($conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled && getDolGlobalString('TICKET_ENABLE_RESOLUTION')), 'tabhelp' => array( From 1582f1afb9ab9676d902aa7c8704abc953ab878f Mon Sep 17 00:00:00 2001 From: Vincent Maury Date: Thu, 12 Mar 2026 22:10:36 +0000 Subject: [PATCH 9/9] Fix Inventory bugs #33192 and #35207 (#37405) * Fix Inventory bugs #33207 and #33292 : when click on "validate and generate movements" quantities not still recorded are not recorded * Fix Inventory bugs #33207 and #33292 : when click on "validate and generate movements" quantities not still recorded are not recorded * Fix Inventory bugs #33207 and #33292 : when click on "validate and generate movements" quantities not still recorded are not recorded --------- Co-authored-by: vmaury --- htdocs/product/inventory/inventory.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 1bd941aa1fe..c459f375df9 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -43,7 +43,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'inventorycard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); $listoffset = GETPOST('listoffset', 'alpha'); -$limit = GETPOST('limit', 'int') > 0 ?GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOST('limit', 'int') > 0 ? GETPOST('limit', 'int') : $conf->liste_limit; $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); if (empty($page) || $page == -1) { $page = 0; @@ -259,7 +259,7 @@ if (empty($reshook)) { } // Save quantity found during inventory (when we click on Save button on inventory page) - if ($action =='updateinventorylines' && $permissiontoadd) { + if ($action == 'updateinventorylines' && $permissiontoadd) { $sql = 'SELECT id.rowid, id.datec as date_creation, id.tms as date_modification, id.fk_inventory, id.fk_warehouse,'; $sql .= ' id.fk_product, id.batch, id.qty_stock, id.qty_view, id.qty_regulated'; $sql .= ' FROM '.MAIN_DB_PREFIX.'inventorydet as id'; @@ -1051,7 +1051,7 @@ if ($resql) { if (isModEnabled('productbatch') && $product_static->hasbatch()) { $valuetoshow = $product_static->stock_warehouse[$obj->fk_warehouse]->detail_batch[$obj->batch]->qty; } else { - $valuetoshow = $product_static->stock_warehouse[$obj->fk_warehouse]->real; + $valuetoshow = !empty($product_static->stock_warehouse[$obj->fk_warehouse]->real) ? $product_static->stock_warehouse[$obj->fk_warehouse]->real : 0; } } print price2num($valuetoshow, 'MS'); @@ -1215,10 +1215,11 @@ print ''; @@ -1315,4 +1318,4 @@ function updateTotalValuation() { // End of page llxFooter(); -$db->close(); +$db->close(); \ No newline at end of file