Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0017199Openbravo ERPA. Platformpublic2011-05-17 13:022011-05-31 10:02
rgoris 
shuehner 
urgentminorhave not tried
closedfixed 
5
pi 
3.0MP0 
Core
No
0017199: Error message when trying to delete a header with lines
You are supposed to be able to delete a header when it has lines (especially when it is draft without dependencies). Today this does not work.
Create header sales order
Create a line
Back to header
Click delete button
Error appear

Only on Postgresql!
No tags attached.
related to feature request 0003310 closed rgoris Document cascade deletion. 
related to feature request 0000365 acknowledged rgoris AT240alpha - Linked Items have not enough info about cascade deletion 
related to defect 00169343.0MP0 closed alostale Extend delete-record warning message in case of children 
has duplicate defect 00172703.0RC7 closed mtaal You cannot delete a sales order (happens across the ERP) when it has lines 
has duplicate defect 00168783.0MP0 closed marvintm Remove a sales order using DAL doesn't work properly 
png post.PNG (99,049) 2011-05-17 13:02
https://issues.openbravo.com/file_download.php?file_id=4019&type=bug
png
Issue History
2011-05-17 13:02rgorisNew Issue
2011-05-17 13:02rgorisAssigned To => alostale
2011-05-17 13:02rgorisFile Added: post.PNG
2011-05-17 13:02rgorisModules => Core
2011-05-17 13:03rgorisRelationship addedrelated to 0003310
2011-05-17 13:03rgorisRelationship addedrelated to 0000365
2011-05-17 13:04rgorisRelationship addedrelated to 0016934
2011-05-19 14:15alostalePriorityhigh => immediate
2011-05-19 14:15alostaleAssigned Toalostale => mtaal
2011-05-19 14:17alostaleStatusnew => scheduled
2011-05-19 14:17alostalefix_in_branch => pi
2011-05-19 16:03dmitry_mezentsevRelationship addedhas duplicate 0017270
2011-05-23 13:37psarobeRelationship addedhas duplicate 0016878
2011-05-25 12:56dmitry_mezentsevPriorityimmediate => urgent
2011-05-25 12:56dmitry_mezentsevfix_in_branchpi =>
2011-05-27 16:33shuehnerNote Added: 0037672
2011-05-30 12:26iperdomoAssigned Tomtaal => shuehner
2011-05-30 13:10shuehnerNote Added: 0037720
2011-05-30 17:02hgbotCheckin
2011-05-30 17:02hgbotNote Added: 0037746
2011-05-30 17:02hgbotStatusscheduled => resolved
2011-05-30 17:02hgbotResolutionopen => fixed
2011-05-30 17:02hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/be3c8b49c1194d896deffba3f2428e9a8f38e74d [^]
2011-05-31 09:45hudsonbotCheckin
2011-05-31 09:45hudsonbotNote Added: 0037803
2011-05-31 10:02rgorisStatusresolved => closed

Notes
(0037672)
shuehner   
2011-05-27 16:33   
Some extra info after short debugging:

hibernate seems to cascade into child-records for the deletion in the following sequence
select children from table a (if exists)
select children from table b (if exists)
...

delete from table a
delete from table b
...

Problem is now if a trigger for table a already remove the related entry in table b -> the second delete fails and hibernate doesn'T recheck if the records to be deleted still exist

From pgsql-log in this case:

delete from C_OrderLine where C_OrderLine_ID=$1
delete from C_OrderTax where C_OrderTax_ID=$1
ROLLBACK

Checking the trigger C_ORDERLINETAX_TRG.xml it seems to delete c_ordertax entries on delete in some cases
(0037720)
shuehner   
2011-05-30 13:10   
Windows affected (at least): sales order, purchase order, sales invoice, purchase invoice
(0037746)
hgbot   
2011-05-30 17:02   
Repository: erp/devel/pi
Changeset: be3c8b49c1194d896deffba3f2428e9a8f38e74d
Author: Stefan Hühner <stefan.huehner <at> openbravo.com>
Date: Mon May 30 17:00:15 2011 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/be3c8b49c1194d896deffba3f2428e9a8f38e74d [^]

Fixed 17199: Fixed deletions of orders & invoices
Work around interaction between hibernate cascading delets and triggers attached
to c_order & c_invoice subtables.
Added interceptor of onDelete requests for c_order & c_invoice tables which does
excplicitely first issue deletes of c_ordertax or c_invoicetax (for this _id).

---
A modules/org.openbravo.client.application/src/org/openbravo/client/application/event/ReorderCascadingChildDeletionsHandler.java
---
(0037803)
hudsonbot   
2011-05-31 09:45   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/ea275e03a164 [^]

Maturity status: Test