Fix: Bad code makes don't work for external modules numeration model

This commit is contained in:
fmarcet 2017-02-14 18:55:39 +01:00 committed by Ferran Marcet
parent 25e8caa64e
commit e903bf2b5c

View File

@ -1138,12 +1138,6 @@ class Propal extends CommonObject
$clonedObj->id=0;
$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 +1146,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);