Bug 459378 - Merging imported operation with an existing one fails when both have the same property
Summary: Merging imported operation with an existing one fails when both have the same...
Status: RESOLVED FIXED
Alias: None
Product: skrooge
Classification: Applications
Component: general (show other bugs)
Version: Trunk from git
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Stephane MANKOWSKI
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-19 09:23 UTC by kde@dunklau.fr
Modified: 2022-10-10 09:21 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.