|View Issue Details|
|Type||Category||Severity||Reproducibility||Date Submitted||Last Update|
|design defect||[Openbravo ERP] A. Platform||minor||have not tried||2019-07-24 14:04||2019-08-26 08:46|
|Priority||normal||Resolution||open||Fixed in Version|
|Status||new||Fix in branch||Fixed in SCM revision|
|OS Version||Database version||Ant version|
|Product Version||SCM revision|
|Review Assigned To|
|Regression introduced in release|
|Regression introduced by commit|
|Triggers an Emergency Pack||No|
0041444: Delete AD_Preference linked to a property that is deleted
|Description||In Preference window (AD_Preference) you can define preferences linked to a property list (AD_Preference.Property). In this case the list is populated with any value from the "Property Configuration" Reference list (AD_REF_LIST.value).|
Example, I have a property configuration reference called "My preference" with value "MYPREF". When this property is included into a Preference, the AD_Preference.Property will be "MYPREF".
If the reference list property is deleted from the Reference | List Reference tab (AD_REF_LIST), the Preference is not deleted and the Property field in the Preference window shows "*** Not found *" in form view (in grid view you can still see the old name).
Ideally any preference linked to a property list reference that was been deleted should be deleted too, as it has no sense and might be confusing. This is however not possible through a standard "FK on delete cascade", because there is not a unique constraint defined in AD_REF_LIST.value column.
|Steps To Reproduce||As system admin.|
Go to Module window and set as indevelopment the following modules: Core and Advanced Payables and Receivables Mngmt
Go to Preference window and search for preference with property "Implements Payment Monitor management". Keep it open
Go to Reference window and search for "Property Configuration".
Go to List Reference Tab and search for "PaymentMonitor". Delete it.
Go back to Preference window and refresh the record originally linked to the "Implements Payment Monitor management" property. Check the property now shows "*** Not found *" in form view (in grid view you can still see the old name)
|Proposed Solution||Try to create a mechanism to automatically delete any preference linked to a property value that doesn't exist anymore in the AD_REF_LIST for the "Property Configuration" reference.|
|Tags||No tags attached.|
|Attached Files|| notFoundProperty.png [^] (24,864 bytes) 2019-07-24 14:05
dbsourcemanager does something similar for foreign keys, when the referenced AD record is removed, all entries referencing it are automatically removed.
This cannot be done for List reference, since foreign keys cannot be defined because the referencing column stores the search key of the ad_ref_list table, not its primary key.
An alternative would be to define a modulescript that automatically removes references to removed preferences, but for the time being it is not done because:
- It would have to be executed on each update.database (as opposed to most modulescripts that are executed only once)
- It is a partial solution that would require a modulescript per table that references an ad_ref_list bound to be removed.
|2019-07-24 14:04||vmromanos||New Issue|
|2019-07-24 14:04||vmromanos||Assigned To||=> platform|
|2019-07-24 14:04||vmromanos||Modules||=> Core|
|2019-07-24 14:04||vmromanos||Triggers an Emergency Pack||=> No|
|2019-07-24 14:05||vmromanos||File Added: notFoundProperty.png|
|2019-07-24 14:10||vmromanos||Relationship added||blocks 0041445|
|2019-08-26 08:46||AugustoMauch||Note Added: 0114264|
|2019-08-26 08:46||AugustoMauch||Type||defect => design defect|
|Copyright © 2000 - 2009 MantisBT Group|