Merge pull request #17744 from fappels/14_fix_trigger_delete_dispatch
Fix dispatch receipt edit and delete
This commit is contained in:
commit
8d5c419f92
@ -333,7 +333,6 @@ class CommandeFournisseurDispatch extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function update($user, $notrigger = 0)
|
public function update($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
@ -411,12 +410,12 @@ class CommandeFournisseurDispatch extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$notrigger) {
|
if (!$notrigger) {
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
// Call triggers
|
||||||
$result = $this->call_trigger('LINERECEPTION_UPDATE', $user);
|
$result = $this->call_trigger('LINERECEPTION_UPDATE', $user);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
//// End call triggers
|
// End call triggers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -444,24 +443,22 @@ class CommandeFournisseurDispatch extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function delete($user, $notrigger = 0)
|
public function delete($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
if (!$notrigger) {
|
if (!$notrigger) {
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
// Call triggers
|
||||||
// want this action calls a trigger.
|
$result = $this->call_trigger('LINERECEPTION_DELETE', $user);
|
||||||
|
if ($result < 0) {
|
||||||
//// Call triggers
|
$error++;
|
||||||
//$result=$this->call_trigger('MYOBJECT_DELETE',$user);
|
}
|
||||||
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
|
// End call triggers
|
||||||
//// End call triggers
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove extrafields
|
// Remove extrafields
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$result = $this->deleteExtraFields();
|
$result = $this->deleteExtraFields();
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
@ -496,7 +493,6 @@ class CommandeFournisseurDispatch extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load an object from its id and create a new one in database
|
* Load an object from its id and create a new one in database
|
||||||
*
|
*
|
||||||
|
|||||||
@ -443,7 +443,7 @@ if ($action == 'updateline' && $user->rights->fournisseur->commande->receptionne
|
|||||||
$product = $supplierorderdispatch->fk_product;
|
$product = $supplierorderdispatch->fk_product;
|
||||||
$price = price2num(GETPOST('price'), '', 2);
|
$price = price2num(GETPOST('price'), '', 2);
|
||||||
$comment = $supplierorderdispatch->comment;
|
$comment = $supplierorderdispatch->comment;
|
||||||
$eatby = $supplierorderdispatch->fk_product;
|
$eatby = $supplierorderdispatch->eatby;
|
||||||
$sellby = $supplierorderdispatch->sellby;
|
$sellby = $supplierorderdispatch->sellby;
|
||||||
$batch = $supplierorderdispatch->batch;
|
$batch = $supplierorderdispatch->batch;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user