Merge pull request #32210 from atm-maxime/detect_country_code

NEW : auto-detect country from code in creation
This commit is contained in:
Laurent Destailleur 2024-12-05 16:28:33 +01:00 committed by GitHub
commit 458579342a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1010,6 +1010,11 @@ class Societe extends CommonObject
$this->fk_multicurrency = 0;
}
if (empty($this->country_id) && !empty($this->country_code)) {
$country_id = getCountry($this->country_code, '3');
$this->country_id = is_int($country_id) ? $country_id : 0;
}
dol_syslog(get_class($this)."::create ".$this->name);
$now = dol_now();