Merge pull request #7762 from atm-maxime/new_socmerge_cat

NEW merge categories while merging thirdparties
This commit is contained in:
Laurent Destailleur
2017-11-05 18:30:53 +01:00
committed by GitHub

View File

@@ -175,9 +175,14 @@ if (empty($reshook))
}
}
// TODO Merge categories
// Merge categories
$static_cat = new Categorie($db);
$custcats = $static_cat->containing($soc_origin->id, 'customer', 'id');
$object->setCategories($custcats, 'customer');
$suppcats = $static_cat->containing($soc_origin->id, 'supplier', 'id');
$object->setCategories($suppcats, 'supplier');
// Update
$object->update($object->id, $user);
// Move links