Debug cloning of BOMs
This commit is contained in:
parent
f060ef1018
commit
e17cc5b2e5
@ -294,12 +294,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
{
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
|
||||
}
|
||||
$formconfirm = '';
|
||||
|
||||
// Confirmation to delete
|
||||
if ($action == 'delete') {
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 1);
|
||||
}
|
||||
|
||||
// Confirmation of validation
|
||||
if ($action == 'validate')
|
||||
|
||||
@ -240,9 +240,10 @@ class BOM extends CommonObject
|
||||
unset($object->import_key);
|
||||
|
||||
// Clear fields
|
||||
$object->ref = "copy_of_".$object->ref;
|
||||
$object->title = $langs->trans("CopyOf")." ".$object->title;
|
||||
|
||||
$object->ref = empty($this->fields['ref']['default']) ? $langs->trans("copy_of_").$object->ref: $this->fields['ref']['default'];
|
||||
$object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label: $this->fields['label']['default'];
|
||||
$object->status = self::STATUS_DRAFT;
|
||||
// ...
|
||||
// Clear extrafields that are unique
|
||||
if (is_array($object->array_options) && count($object->array_options) > 0)
|
||||
{
|
||||
|
||||
@ -7476,6 +7476,7 @@ abstract class CommonObject
|
||||
{
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET ref = '(PROV".$this->id.")' WHERE ref = '(PROV)' AND rowid = ".$this->id;
|
||||
$resqlupdate = $this->db->query($sql);
|
||||
|
||||
if ($resqlupdate===false)
|
||||
{
|
||||
$error++;
|
||||
|
||||
@ -283,8 +283,9 @@ class MyObject extends CommonObject
|
||||
|
||||
|
||||
// Clear fields
|
||||
$object->ref = "copy_of_".$object->ref;
|
||||
$object->title = $langs->trans("CopyOf")." ".$object->title;
|
||||
$object->ref = empty($this->fields['ref']['default']) ? "copy_of_".$object->ref: $this->fields['ref']['default'];
|
||||
$object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label: $this->fields['label']['default'];
|
||||
$object->status = self::STATUS_DRAFT;
|
||||
// ...
|
||||
// Clear extrafields that are unique
|
||||
if (is_array($object->array_options) && count($object->array_options) > 0)
|
||||
|
||||
@ -246,10 +246,10 @@ class Mo extends CommonObject
|
||||
unset($object->fk_user_creat);
|
||||
unset($object->import_key);
|
||||
|
||||
|
||||
// Clear fields
|
||||
$object->ref = "copy_of_".$object->ref;
|
||||
$object->title = $langs->trans("CopyOf")." ".$object->title;
|
||||
$object->ref = empty($this->fields['ref']['default']) ? "copy_of_".$object->ref: $this->fields['ref']['default'];
|
||||
$object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label: $this->fields['label']['default'];
|
||||
$object->status = self::STATUS_DRAFT;
|
||||
// ...
|
||||
// Clear extrafields that are unique
|
||||
if (is_array($object->array_options) && count($object->array_options) > 0)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user