Bug 459378

Summary: Merging imported operation with an existing one fails when both have the same property
Product: [Applications] skrooge Reporter: kde <kde>
Component: generalAssignee: Stephane MANKOWSKI <stephane>
Status: RESOLVED FIXED    
Severity: normal CC: stephane
Priority: NOR    
Version: Trunk from git   
Target Milestone: 25.1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description kde@dunklau.fr 2022-09-19 09:23:57 UTC
SUMMARY

When merging an imported operation with an existing one, there is a an integrity error from the underlying DB if both have a property of the same name on it.
It seems that the import function tries to copies the properties from the imported operation into the underlying one, which is not possible as it is not allowed to have two properties with the same name on the same operation.

STEPS TO REPRODUCE
1. Create an operation, and set a property on it
2. Import an operation and set a property of the same name on it
3. Try to merge them

OBSERVED RESULT
The operations are not merged, as an error is displayed with regards to a unique constraint being violated.

EXPECTED RESULT
New properties are attached to the existing operations, while existing ones follow the same rules as any fields.
Comment 1 Stephane MANKOWSKI 2022-10-01 09:14:31 UTC
Git commit 021ee4060172045408568952adb63629d6c88dd6 by Stephane Mankowski.
Committed on 01/10/2022 at 09:14.
Pushed by smankowski into branch 'master'.

Merging imported operation with an existing one fails when both have the same property

M  +1    -0    CHANGELOG
M  +1    -0    skgbankmodeler/skgoperationobject.cpp
M  +4    -0    tests/skgbankmodelertest/skgtestoperation.cpp

https://invent.kde.org/office/skrooge/commit/021ee4060172045408568952adb63629d6c88dd6
Comment 2 kde@dunklau.fr 2022-10-10 09:21:57 UTC
Thank you for taking care of this so quickly.
I can confirm that the fix does what I expected.