Merge pull request #6420 from fmarcet/4.0

Fix: Bad code makes don't work for external modules numeration model
This commit is contained in:
Laurent Destailleur 2017-02-17 10:33:48 +01:00 committed by GitHub
commit 45eba9f62e

View File

@ -1136,14 +1136,9 @@ class Propal extends CommonObject
}
$clonedObj->id=0;
$clonedObj->ref='';
$clonedObj->statut=self::STATUS_DRAFT;
if (empty($conf->global->PROPALE_ADDON) || ! is_readable(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php"))
{
$this->error='ErrorSetupNotComplete';
return -1;
}
// Clear fields
$clonedObj->user_author = $user->id;
$clonedObj->user_valid = '';
@ -1152,12 +1147,6 @@ class Propal extends CommonObject
$clonedObj->fin_validite = $clonedObj->date + ($clonedObj->duree_validite * 24 * 3600);
if (empty($conf->global->MAIN_KEEP_REF_CUSTOMER_ON_CLONING)) $clonedObj->ref_client = '';
// Set ref
require_once DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.'.php';
$obj = $conf->global->PROPALE_ADDON;
$modPropale = new $obj;
$clonedObj->ref = $modPropale->getNextValue($objsoc,$clonedObj);
// Create clone
$result=$clonedObj->create($user);