Exemplo n.º 1
0
 /**
  * Function which will specify whether the relation is deletable
  * @return <Boolean>
  */
 public function isDeletable()
 {
     $relatedModuleModel = $this->getRelationModuleModel();
     $relatedModuleName = $relatedModuleModel->get('name');
     $inventoryModulesList = array('Invoice', 'Quotes', 'PurchaseOrder', 'SalesOrder');
     //Inventoty relationship cannot be deleted from the related list
     if (in_array($relatedModuleName, $inventoryModulesList)) {
         return false;
     }
     return parent::isDeletable();
 }
Exemplo n.º 2
0
 /**
  * Function which will specify whether the relation is deletable
  * @return <Boolean>
  */
 public function isDeletable()
 {
     $relatedModuleModel = $this->getRelationModuleModel();
     $relatedModuleName = $relatedModuleModel->get('name');
     $inventoryModulesList = [];
     //Inventoty relationship cannot be deleted from the related list
     if (in_array($relatedModuleName, $inventoryModulesList)) {
         return false;
     }
     return parent::isDeletable();
 }