Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0015494Openbravo ERP00. Application dictionarypublic2010-12-20 18:452022-02-01 08:08
tgarcia 
Triage Platform Base 
highmajoralways
acknowledgedopen 
30Ubuntu 10.10
2.50MP24 
 
Core
No
0015494: Merge modules verifys inactive dependencys
When creating a merge, inactive dependencies are taken into account and thus merge is not allowed in situation where it should be
- Create module A and B, and make A depend on B.
- Make that dependecy not active
- Make module C and make it merge A
- Merge cannot be saved
-- Function: ad_module_merge_trg()

-- DROP FUNCTION ad_module_merge_trg();

CREATE OR REPLACE FUNCTION ad_module_merge_trg()
  RETURNS trigger AS
$BODY$ DECLARE

  /*************************************************************************
  * The contents of this file are subject to the Openbravo Public License
  * Version 1.0 (the "License"), being the Mozilla Public License
  * Version 1.1 with a permitted attribution clause; you may not use this
  * file except in compliance with the License. You may obtain a copy of
  * the License at http://www.openbravo.com/legal/license.html [^]
  * Software distributed under the License is distributed on an "AS IS"
  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
  * License for the specific language governing rights and limitations
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
  * All portions are Copyright (C) 2010 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s): ______________________________________.
  ************************************************************************/

  v_Aux NUMERIC;
   
BEGIN

  IF AD_isTriggerEnabled()='N' THEN IF TG_OP = 'DELETE' THEN RETURN OLD; ELSE RETURN NEW; END IF;
  END IF;
  
  SELECT COUNT(*)
    INTO v_Aux
    FROM AD_MODULE_DEPENDENCY
   WHERE AD_Dependent_Module_ID = new.Merged_Module_UUID
   AND AD_MODULE_DEPENDENCY.ISACTIVE = 'Y';
   
  IF v_aux>0 THEN
    RAISE EXCEPTION '%', '@CannotMergeDependency@'; --OBTG:-20000--
  END IF;

IF TG_OP = 'DELETE' THEN RETURN OLD; ELSE RETURN NEW; END IF;

END

; $BODY$
  LANGUAGE plpgsql VOLATILE
  COST 100;
ALTER FUNCTION ad_module_merge_trg() OWNER TO tad;
No tags attached.
Issue History
2010-12-20 18:45tgarciaNew Issue
2010-12-20 18:45tgarciaAssigned To => alostale
2010-12-20 18:45tgarciaModules => Core
2010-12-27 07:29alostaleStatusnew => scheduled
2010-12-27 07:29alostalefix_in_branch => pi
2012-03-23 12:11alostaleNote Added: 0046677
2012-03-23 12:11alostaleTypedefect => design defect
2012-03-23 12:11alostalefix_in_branchpi =>
2012-09-24 23:23AugustoMauchNote Added: 0052461
2012-09-24 23:23AugustoMauchPrioritynormal => high
2017-03-31 14:36alostaleStatusscheduled => acknowledged
2017-04-10 14:34alostaleAssigned Toalostale => platform
2022-02-01 08:08alostaleAssigned Toplatform => Triage Platform Base

Notes
(0046677)
alostale   
2012-03-23 12:11   
All checks for activeness need to be verified.
(0052461)
AugustoMauch   
2012-09-24 23:23   
Effort: 2
Impact: low
Plan: short