Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0026176Openbravo ERP02. Master data managementpublic2014-04-04 10:082022-02-01 08:09
jonalegriaesarte 
Triage Platform Base 
highminorhave not tried
acknowledgedopen 
5
 
 
Core
No
0026176: When deleting a business partner with elements related the message shown is not correct
When deleting a business partner with elements related the message shown is not correct
- Create a business partner. Add a location
- Create a sales invoice
- Delete the business partner

Depending on the case the message can be:
Error
ERROR: null value in column "c_bpartner_location_id" violates not-null constraint

or

Error: Document posted/processed
Error message should be standard when the element to delete has elements related
No tags attached.
Issue History
2014-04-04 10:08jonalegriaesarteNew Issue
2014-04-04 10:08jonalegriaesarteAssigned To => pramakrishnan
2014-04-04 10:08jonalegriaesarteModules => Core
2014-04-04 10:08jonalegriaesarteResolution time => 1402869600
2014-04-04 10:08jonalegriaesarteTriggers an Emergency Pack => No
2014-06-16 08:33rafarodaAssigned Topramakrishnan => rafaroda
2014-06-16 08:33rafarodaStatusnew => scheduled
2014-06-19 15:22rafarodaNote Added: 0068171
2014-06-19 16:03rafarodaAssigned Torafaroda => alostale
2014-06-20 10:16alostaleNote Added: 0068211
2014-06-30 10:12jonalegriaesarteResolution time1402869600 =>
2014-06-30 10:12jonalegriaesarteTypedefect => design defect
2014-06-30 13:09jonalegriaesarteTarget VersionPR14Q3 =>
2017-03-31 14:36alostaleStatusscheduled => acknowledged
2017-04-10 14:33alostaleAssigned Toalostale => platform
2022-02-01 08:09alostaleAssigned Toplatform => Triage Platform Base

Notes
(0068171)
rafaroda   
2014-06-19 15:22   
Examples:

1) When trying to delete a Business Partner: Document posted/processed

2014-06-18 19:13:24,127 [http-8787-6] ERROR org.hibernate.util.JDBCExceptionReporter - Batch entry 0 update C_Invoice set Updated='2014-06-18 19:13:23.939000 +02:00:00', C_BPartner_Location_ID=NULL, AD_User_ID=NULL where C_Invoice_ID='02AB2F6DA9714BE4B9687149371EC183' was aborted. Call getNextException to see the cause.
2014-06-18 19:13:24,128 [http-8787-6] ERROR org.hibernate.util.JDBCExceptionReporter - ERROR: @20501@


2) When trying to delete a Price List: This record cannot be deleted because it is associated with other existing elements. Please see Linked Items

2014-06-18 19:14:04,462 [http-8787-5] ERROR org.hibernate.util.JDBCExceptionReporter - Batch entry 0 delete from M_PriceList where M_PriceList_ID='1D8D2464FE974C41812CF0128C160CB3' was aborted. Call getNextException to see the cause.
2014-06-18 19:14:04,462 [http-8787-5] ERROR org.hibernate.util.JDBCExceptionReporter - ERROR: update or delete on table "m_pricelist" violates foreign key constraint "c_invoice_m_pricelist" on table "c_invoice"
  Detail: Key (m_pricelist_id)=(1D8D2464FE974C41812CF0128C160CB3) is still referenced from table "c_invoice".

3) When trying to delete a Product: It is not possible to delete a permanent cost.

2014-06-18 19:12:34,917 [http-8787-3] ERROR org.hibernate.util.JDBCExceptionReporter - Batch entry 0 delete from M_Costing where M_Costing_ID='C045B4CA6EB4406C8ACEA5B3E27434F3' was aborted. Call getNextException to see the cause.
2014-06-18 19:12:34,917 [http-8787-3] ERROR org.hibernate.util.JDBCExceptionReporter - ERROR: @CannotDeletePermanentCost@
(0068211)
alostale   
2014-06-20 10:16   
When a record is deleted it no checks are done at OB level, DAL object is tried to be deleted, at this point Hibernate tries to delete its children executing
delete statement in DB for all of them and finally for parent object.

In case any of these delete statements fails the message is parsed and shown to the user. So if one of the children executes a trigger which sends a message this one is shown and the transaction is aborted.