Skip to content

Fix: Cloning now correctly copies COA values when default COA creation is enabled.#7538

Merged
CarolineDenis merged 3 commits intomainfrom
issue-4825
Nov 25, 2025
Merged

Fix: Cloning now correctly copies COA values when default COA creation is enabled.#7538
CarolineDenis merged 3 commits intomainfrom
issue-4825

Conversation

@Gitesh307
Copy link
Copy Markdown
Contributor

@Gitesh307 Gitesh307 commented Nov 11, 2025

Fixes #4825

Cloning a Collection Object with CO_CREATE_COA_* enabled was creating a new blank CollectionObjectAttribute instead of preserving the original attribute values, which meant cloned COs did not produce an exact copy. The fix updates the auto-creation logic in scoping.ts to only generate a new COA when the record is newly created and has no existing attribute, while skipping COA creation during clone operations. As a result, cloned COs now retain their original CollectionObjectAttribute values, and new COs still automatically receive a COA when appropriate.

Note : Observed in tag v7.10.0; not reproducible on main. Please advise backport to the appropriate v7.10.x or v7.9.x.

Checklist

  • Self-review the PR after opening it to make sure the changes look good and
    self-explanatory (or properly documented)
  • Add relevant issue to release milestone

Testing instructions

  • Verify that cloning a Collection Object with existing COA values retains those values in the cloned record instead of creating a blank attribute irrespective of CO_CREATE_COA in remote preferences.

@github-project-automation github-project-automation bot moved this to 📋Back Log in General Tester Board Nov 11, 2025
@Gitesh307 Gitesh307 changed the title Fix: Cloning now correctly copies COA values when default COA creation is enabled; Fix: Cloning now correctly copies COA values when default COA creation is enabled. Nov 11, 2025
@Gitesh307 Gitesh307 requested review from a team November 18, 2025 14:01
Copy link
Copy Markdown
Member

@grantfitzsimmons grantfitzsimmons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before requesting review, can you make sure to check this?

  • Self-review the PR after opening it to make sure the changes look good and
    self-explanatory (or properly documented)
  • Verify that cloning a Collection Object with existing COA values retains those values in the cloned record instead of creating a blank attribute irrespective of CO_CREATE_COA in remote preferences.

Left is main, right is issue-4825. I was able to recreate the issue on main. Works great!

Screen.Recording.2025-11-18.at.15.55.15.mov

@CarolineDenis CarolineDenis requested a review from a team November 19, 2025 13:24
@CarolineDenis CarolineDenis added this to the 7.12.0 milestone Nov 19, 2025
Copy link
Copy Markdown
Collaborator

@emenslin emenslin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Verify that cloning a Collection Object with existing COA values retains those values in the cloned record instead of creating a blank attribute irrespective of CO_CREATE_COA in remote preferences.

Looks good, COA is properly cloned!

@CarolineDenis CarolineDenis merged commit d7234ad into main Nov 25, 2025
14 checks passed
@CarolineDenis CarolineDenis deleted the issue-4825 branch November 25, 2025 19:22
@github-project-automation github-project-automation bot moved this from 📋Back Log to ✅Done in General Tester Board Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅Done

Development

Successfully merging this pull request may close these issues.

Cloning CO does not create exact copy of record

5 participants