[19.0] [FIX] construction_developer: correctly duplicate work items on SO#2183
Closed
fw-bot wants to merge 1 commit into
Closed
[19.0] [FIX] construction_developer: correctly duplicate work items on SO#2183fw-bot wants to merge 1 commit into
fw-bot wants to merge 1 commit into
Conversation
When duplicating a sale order, the work items attached to its lines were shared rather than duplicated because Many2one fields have copy=True by default. Setting copied=False on the field correctly clears the reference, causing the existing automation to generate a fresh instance. X-original-commit: 118b31b
Collaborator
Author
|
This PR targets saas-19.3 and is part of the forward-port chain. Further PRs will be created up to master. More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port |
robodoo
pushed a commit
that referenced
this pull request
May 18, 2026
When duplicating a sale order, the work items attached to its lines were shared rather than duplicated because Many2one fields have copy=True by default. Setting copied=False on the field correctly clears the reference, causing the existing automation to generate a fresh instance. closes #2183 X-original-commit: 118b31b Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #2172.
When a sale.order is duplicated, the
Many2onereferences are copied natively, meaning both the old and new sale.order.line referenced the exact samex_work_item. Modifying the work item on the new duplicate altered the pricing on the original SO.This uses the Odoo Online compatible XML approach. By adding
copied=Falseto the field definition in Studio (ir_model_fields.xml), the work item reference is appropriately stripped upon duplication. This subsequently triggers the existing standard automationbase_automation_sol_on_writeto re-instantiate a fresh Work Item directly from the product template.Forward-Port-Of: #2173