FIX Update extrafields on warehouse
This commit is contained in:
parent
afe8f76a4a
commit
3e91d77920
@ -68,8 +68,6 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
// Load object
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
$ret = $object->fetch($id, $ref);
|
||||
// if ($ret > 0)
|
||||
// $ret = $object->fetch_thirdparty();
|
||||
if ($ret <= 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = '';
|
||||
|
||||
@ -135,6 +135,8 @@ $usercanread = $user->rights->stock->mouvement->lire;
|
||||
$usercancreate = $user->rights->stock->mouvement->creer;
|
||||
$usercandelete = $user->rights->stock->mouvement->creer;
|
||||
|
||||
$error = 0;
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -178,6 +180,25 @@ if (empty($reshook))
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
}
|
||||
|
||||
if ($action == 'update_extras') {
|
||||
$tmpwarehouse = new Entrepot($db);
|
||||
$tmpwarehouse->fetch($id);
|
||||
|
||||
$tmpwarehouse->oldcopy = dol_clone($tmpwarehouse);
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $tmpwarehouse, GETPOST('attribute', 'none'));
|
||||
if ($ret < 0) $error++;
|
||||
if (!$error) {
|
||||
$result = $tmpwarehouse->insertExtraFields();
|
||||
if ($result < 0) {
|
||||
setEventMessages($tmpwarehouse->error, $tmpwarehouse->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
if ($error) $action = 'edit_extras';
|
||||
}
|
||||
|
||||
// Correct stock
|
||||
if ($action == "correct_stock")
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user