Skip to content
Snippets Groups Projects
Commit 45eba9f6 authored by Laurent Destailleur's avatar Laurent Destailleur Committed by GitHub
Browse files

Merge pull request #6420 from fmarcet/4.0

Fix: Bad code makes don't work for external modules numeration model
parents efd2e85f c175dfe6
No related branches found
No related tags found
No related merge requests found
...@@ -1136,14 +1136,9 @@ class Propal extends CommonObject ...@@ -1136,14 +1136,9 @@ class Propal extends CommonObject
} }
$clonedObj->id=0; $clonedObj->id=0;
$clonedObj->ref='';
$clonedObj->statut=self::STATUS_DRAFT; $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 // Clear fields
$clonedObj->user_author = $user->id; $clonedObj->user_author = $user->id;
$clonedObj->user_valid = ''; $clonedObj->user_valid = '';
...@@ -1152,12 +1147,6 @@ class Propal extends CommonObject ...@@ -1152,12 +1147,6 @@ class Propal extends CommonObject
$clonedObj->fin_validite = $clonedObj->date + ($clonedObj->duree_validite * 24 * 3600); $clonedObj->fin_validite = $clonedObj->date + ($clonedObj->duree_validite * 24 * 3600);
if (empty($conf->global->MAIN_KEEP_REF_CUSTOMER_ON_CLONING)) $clonedObj->ref_client = ''; 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 // Create clone
$result=$clonedObj->create($user); $result=$clonedObj->create($user);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment