Fix hooks from supplierorder to supplierinvoice
This commit is contained in:
parent
2f30e769f6
commit
3880013940
@ -255,16 +255,23 @@ class FactureFournisseur extends CommonInvoice
|
||||
$result=$this->update_price();
|
||||
if ($result > 0)
|
||||
{
|
||||
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||
// Actions on extra fields (by external module or standard code)
|
||||
// FIXME le hook fait double emploi avec le trigger !!
|
||||
$hookmanager->initHooks(array('supplierinvoicedao'));
|
||||
$parameters=array('socid'=>$this->id);
|
||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||
if (empty($reshook))
|
||||
{
|
||||
$result=$this->insertExtraFields();
|
||||
if ($result < 0)
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||
{
|
||||
$error++;
|
||||
$result=$this->insertExtraFields();
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if ($reshook < 0) $error++;
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('BILL_SUPPLIER_CREATE',$user);
|
||||
if ($result < 0) $error++;
|
||||
|
||||
@ -1083,7 +1083,7 @@ elseif ($action == 'update_extras')
|
||||
{
|
||||
// Actions on extra fields (by external module or standard code)
|
||||
// FIXME le hook fait double emploi avec le trigger !!
|
||||
$hookmanager->initHooks(array('supplierorderdao'));
|
||||
$hookmanager->initHooks(array('supplierinvoicedao'));
|
||||
$parameters=array('id'=>$object->id);
|
||||
|
||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
Loading…
Reference in New Issue
Block a user