Merge remote-tracking branch 'origin/3.7' into 3.8

Conflicts:
	htdocs/core/class/commonobject.class.php
This commit is contained in:
Laurent Destailleur 2016-02-15 01:18:59 +01:00
commit c85b7932a9
2 changed files with 4 additions and 2 deletions

View File

@ -286,7 +286,7 @@ if (empty($reshook))
{ {
$db->begin(); $db->begin();
// Si on a selectionne une propal a copier, on realise la copie // If we select proposal to clone during creation (when option PROPAL_CLONE_ON_CREATE_PAGE is on)
if (GETPOST('createmode') == 'copy' && GETPOST('copie_propal')) if (GETPOST('createmode') == 'copy' && GETPOST('copie_propal'))
{ {
if ($object->fetch(GETPOST('copie_propal')) > 0) { if ($object->fetch(GETPOST('copie_propal')) > 0) {
@ -314,7 +314,8 @@ if (empty($reshook))
$object->fk_incoterms = GETPOST('incoterm_id', 'int'); $object->fk_incoterms = GETPOST('incoterm_id', 'int');
$object->location_incoterms = GETPOST('location_incoterms', 'alpha'); $object->location_incoterms = GETPOST('location_incoterms', 'alpha');
$id = $object->create_from($user); // the create is done below and further more the existing create_from function is quite hilarating
//$id = $object->create_from($user);
} else { } else {
setEventMessage($langs->trans("ErrorFailedToCopyProposal", GETPOST('copie_propal')), 'errors'); setEventMessage($langs->trans("ErrorFailedToCopyProposal", GETPOST('copie_propal')), 'errors');
} }

View File

@ -1048,6 +1048,7 @@ class Propal extends CommonObject
*/ */
function create_from($user) function create_from($user)
{ {
// i love this function because $this->products is not used in create function...
$this->products=$this->lines; $this->products=$this->lines;
return $this->create($user); return $this->create($user);