Bug 27550

Summary: "Duplicate budget" does not keep users associated with the funds
Product: Koha Reporter: Julien Sicot (Univ. Rennes 2) <julien.sicot>
Component: AcquisitionsAssignee: Julian Maurice <julian.maurice>
Status: CLOSED FIXED QA Contact: Katrin Fischer <katrin.fischer>
Severity: normal    
Priority: P5 - low CC: arthur.suzuki, jeremy.breuillard, jonathan.druart, julian.maurice, lucas, mathsabypro, samu.heiskanen, severine.queune, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Users linked to funds in acquisitions will now be kept when a budget and fund structure is duplicated.
Version(s) released in:
22.11.00, 22.05.07, 21.11.14
Attachments: Bug 27550: "Duplicate budget" does not keep users associated with that budget
Bug 27550: "Duplicate budget" does not keep users associated with that budget
Bug 27550: "Duplicate budget" does not keep users associated with that budget
Bug 27550: Add unit test for CloneBudgetHierarchy
Bug 27550: "Duplicate budget" does not keep users associated with that budget
Bug 27550: Add unit test for CloneBudgetHierarchy

Description Julien Sicot (Univ. Rennes 2) 2021-01-26 08:24:10 UTC
Hi,

In More > Administration > Acquisitions > Budgets, it could be great when you choose to duplicate a budget from one year to the next, to be able to keep the users(aqbudgetborrowers) associated with that budget.

Users are useful in particular to receive orders from a particular fund.

Currently, this functionality retrieves only the owner and funds associated with a budget.

This enhancement could be optionnal using a checkbox in the "duplicate budget" view to enable/disable the copy of user ?

What do you think about it ?

Thanks,

Best,
Julien Sicot
Université Rennes 2
Comment 1 Katrin Fischer 2021-01-31 15:09:59 UTC
I like the idea of a checkbox, but feel that the current behaviour could also be seen as a bug!
Comment 2 Jérémy Breuillard 2021-11-05 16:54:03 UTC
Created attachment 127400 [details]
Bug 27550: "Duplicate budget" does not keep users associated with that budget

Once a budget is duplicated, all the parameters are copied except the
Users

Test plan :
Home > Administration > Budgets
1)Create a budget to allow (active or inactive)
2)Give it some funds by filling up the form, especially Owner and
User(s)
3)Submit then you go back to the Budgets dashboard
4)Duplicate the Budget and click on its name
5)Edit it and notice that User(s) is empty
6)Apply the patch
7)Repeat from 1) to 5)
Comment 3 Jérémy Breuillard 2021-11-24 13:39:36 UTC
Created attachment 127975 [details] [review]
Bug 27550: "Duplicate budget" does not keep users associated with that budget

When a budget is duplicated, Owner is copied but not Users

Test plan :
Home > Administration > Budgets
1)Create a budget to allow (active or inactive)
2)Give it some funds by filling up the form, especially Owner and
User(s)
3)Submit then go back to the Budgets dashboard
4)Duplicate the Budget and click on its name
5)Edit it and notice that User(s) is empty
6)Apply the patch
7)Repeat from 1) to 5)
Comment 4 Samu Heiskanen 2021-11-26 19:08:06 UTC
The patch works as expected.
Comment 5 Samu Heiskanen 2021-11-26 20:37:10 UTC Comment hidden (obsolete)
Comment 6 Samu Heiskanen 2021-11-27 00:21:32 UTC
Created attachment 128050 [details] [review]
Bug 27550: "Duplicate budget" does not keep users associated with that budget

When a budget is duplicated, Owner is copied but not Users

Test plan :
Home > Administration > Budgets
1)Create a budget to allow (active or inactive)
2)Give it some funds by filling up the form, especially Owner and
User(s)
3)Submit then go back to the Budgets dashboard
4)Duplicate the Budget and click on its name
5)Edit it and notice that User(s) is empty
6)Apply the patch
7)Repeat from 1) to 5)

Signed-off-by: Samu Heiskanen <samu.heiskanen@hypernova.fi>
Comment 7 Jonathan Druart 2021-12-01 14:33:10 UTC
Missing test coverage.
Comment 8 Katrin Fischer 2022-01-09 00:09:58 UTC
Would someone be willing to step up and write the necessary tests here so we can get this bug fixed?
Comment 9 Julian Maurice 2022-09-08 10:21:25 UTC
Created attachment 140334 [details] [review]
Bug 27550: Add unit test for CloneBudgetHierarchy
Comment 10 Katrin Fischer 2022-09-11 13:47:05 UTC
(In reply to Julian Maurice from comment #9)
> Created attachment 140334 [details] [review] [review]
> Bug 27550: Add unit test for CloneBudgetHierarchy

Thank you, Julian :)
Comment 11 Katrin Fischer 2022-09-11 13:55:33 UTC
Created attachment 140400 [details] [review]
Bug 27550: "Duplicate budget" does not keep users associated with that budget

When a budget is duplicated, Owner is copied but not Users

Test plan :
Home > Administration > Budgets
1)Create a budget to allow (active or inactive)
2)Give it some funds by filling up the form, especially Owner and
User(s)
3)Submit then go back to the Budgets dashboard
4)Duplicate the Budget and click on its name
5)Edit it and notice that User(s) is empty
6)Apply the patch
7)Repeat from 1) to 5)

Signed-off-by: Samu Heiskanen <samu.heiskanen@hypernova.fi>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Katrin Fischer 2022-09-11 13:55:38 UTC
Created attachment 140401 [details] [review]
Bug 27550: Add unit test for CloneBudgetHierarchy

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 13 Tomás Cohen Arazi 2022-09-22 11:24:44 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 14 Lucas Gass 2022-10-31 22:55:35 UTC
Backported to 22.05.x for upcoming 22.05.07 release
Comment 15 Arthur Suzuki 2022-11-14 16:51:21 UTC
applied to 21.11 for 21.11.14
Comment 16 Victor Grousset/tuxayo 2022-11-26 03:56:52 UTC
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed.

Nothing to document it seems, marking resolved.