can merge products but experimental

This commit is contained in:
Frédéric FRANCE 2021-11-23 21:52:40 +01:00
parent d601f62194
commit c56f180515
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
2 changed files with 19 additions and 2 deletions

View File

@ -1078,6 +1078,23 @@ class BOM extends CommonObject
}
}
}
/**
* Function used to replace a product id with another one.
*
* @param DoliDB $db Database handler
* @param int $origin_id Old product id
* @param int $dest_id New product id
* @return bool
*/
public static function replaceProduct(DoliDB $db, $origin_id, $dest_id)
{
$tables = array(
'bom_bomline'
);
return CommonObject::commonReplaceProduct($db, $origin_id, $dest_id, $tables);
}
}

View File

@ -318,7 +318,7 @@ if (empty($reshook)) {
'Commande' => '/commande/class/commande.class.php',
'Facture' => '/compta/facture/class/facture.class.php',
'FactureRec' => '/compta/facture/class/facture-rec.class.php',
// 'Mo' => '/mrp/class/mo.class.php',
'Bom' => '/bom/class/bom.class.php',
'Contrat' => '/contrat/class/contrat.class.php',
'Expedition' => '/expedition/class/expedition.class.php',
'Fichinter' => '/fichinter/class/fichinter.class.php',
@ -2679,7 +2679,7 @@ if ($action == 'merge') {
'name' => 'product_origin',
'label' => $langs->trans('MergeOriginProduct'),
'type' => 'other',
'value' => $form->select_produits('', 'product_origin', '', 0, 0, 1, 2, '', 1, array(), 0, 1, 0, '', 0, '', null, 1),
'value' => $form->select_produits('', 'product_origin', '', 0, 0, 1, 2, '', 1, array(), 0, 1, 0, 'minwidth200', 0, '', null, 1),
)
);
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("MergeProducts"), $langs->trans("ConfirmMergeProducts"), "confirm_merge", $formquestion, 'no', 1, 250);