Merge pull request #12839 from atm-gauthier/10.0_fix_importSocieteWithExtrafields

FIX : We want to be able to import data for extrafields of entity 0 too
This commit is contained in:
Laurent Destailleur 2020-01-15 13:12:56 +01:00 committed by GitHub
commit 0a1a07aa22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -449,7 +449,7 @@ class modSociete extends DolibarrModules
's.multicurrency_code' => 'MulticurrencyCurrency'
);
// Add extra fields
$sql = "SELECT name, label, fieldrequired FROM " . MAIN_DB_PREFIX . "extrafields WHERE elementtype = 'societe' AND entity = " . $conf->entity;
$sql = "SELECT name, label, fieldrequired FROM " . MAIN_DB_PREFIX . "extrafields WHERE elementtype = 'societe' 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)
{