Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0016831Openbravo ERP07. Sales managementpublic2011-04-15 15:142011-05-05 10:07
jonalegriaesarte 
dalsasua 
immediatemajoralways
closedfixed 
5
2.50MP28 
2.50MP293.0RC7 
Core
No
0016831: A trigger condition in c_orderline has been added and can cause problems in special conditions
This piece of code has been added to src-db/database/model/triggers/C_ORDLINE_CHK_RESTRICTIONS_TRG.xml:
IF(UPDATING OR INSERTING) THEN
    IF (:NEW.C_BPARTNER_ID IS NOT NULL AND :NEW.C_BPARTNER_LOCATION_ID IS NULL) THEN
      RAISE_APPLICATION_ERROR(-20000, '@LocationNotNullConstraint@');
    END IF;
END IF;

This piece of code is trying to simulate the old behavior when the line is not a discount. This piece of code is wrong because in some special conditions the user can not insert lines or modify existing lines where this field is null. The original bug is solved without this change in the trigger.

Remove the Business Partner Address field from the purchase order line windows.
Create a purchase order; fill in all the necessary fields.
Create a line for the order; fill in all the necessary fields.
Save the line.
Trigger restriction makes the save to fail.
This piece of code must be deleted.
Regression
related to defect 0016321 closed adrianromero Not possible to modify available fields of Discount line when order is processed 
depends on backport 00168322.50MP29 closed dalsasua A trigger condition in c_orderline has been added and can cause problems in special conditions 
Issue History
2011-04-15 15:14jonalegriaesarteNew Issue
2011-04-15 15:14jonalegriaesarteAssigned To => dalsasua
2011-04-15 15:14jonalegriaesarteModules => Core
2011-04-15 15:15jonalegriaesarteRelationship addeddepends on 0015594
2011-04-15 15:15jonalegriaesarteTag Attached: Regression
2011-04-15 15:18dalsasuaStatusnew => scheduled
2011-04-15 15:18dalsasuafix_in_branch => pi
2011-04-15 15:42dalsasuaRelationship deleteddepends on 0015594
2011-04-15 15:43dalsasuaRelationship addedrelated to 0016321
2011-04-15 16:43dalsasuafix_in_branchpi =>
2011-04-15 16:43dalsasuaDescription Updatedbug_revision_view_page.php?rev_id=1855#r1855
2011-04-15 16:43dalsasuaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=1857#r1857
2011-04-15 16:50hgbotCheckin
2011-04-15 16:50hgbotNote Added: 0035999
2011-04-15 16:50hgbotStatusscheduled => resolved
2011-04-15 16:50hgbotResolutionopen => fixed
2011-04-15 16:50hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/df01c4ee458e92cd5a6159ed7418ff24f705358a [^]
2011-05-05 10:06jonalegriaesarteNote Added: 0036379
2011-05-05 10:07jonalegriaesarteStatusresolved => closed
2011-05-05 10:07jonalegriaesarteFixed in Version => 3.0RC7

Notes
(0035999)
hgbot   
2011-04-15 16:50   
Repository: erp/devel/pi
Changeset: df01c4ee458e92cd5a6159ed7418ff24f705358a
Author: David Alsasua <david.alsasua <at> openbravo.com>
Date: Fri Apr 15 15:23:27 2011 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/df01c4ee458e92cd5a6159ed7418ff24f705358a [^]

Fixes issue 16831: A trigger condition in c_orderline has been added.
The condition in the trigger is removed

---
M src-db/database/model/triggers/C_ORDLINE_CHK_RESTRICTIONS_TRG.xml
---
(0036379)
jonalegriaesarte   
2011-05-05 10:06   
Verified