Fix: Import don't work if extrafield is separator

This commit is contained in:
Ferran Marcet
2021-10-29 12:39:22 +02:00
parent 7393abea8f
commit 9f23528ccd
10 changed files with 17 additions and 17 deletions

View File

@@ -462,7 +462,7 @@ class modService extends DolibarrModules
if (!empty($conf->global->PRODUCT_USE_UNITS)) $this->import_fields_array[$r]['p.fk_unit'] = 'Unit';
// Add extra fields
$import_extrafield_sample = array();
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product' AND entity IN (0,".$conf->entity.")";
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'product' AND entity IN (0,".$conf->entity.")";
$resql = $this->db->query($sql);
if ($resql) // This can fail when class is used on old database (during migration for example)
{