Skip to content

[19.0] [FIX] construction_developer: correctly duplicate work items on SO#2183

Closed
fw-bot wants to merge 1 commit into
odoo:saas-19.3from
odoo-dev:saas-19.3-fix-duplicate-work-item-527433-fw
Closed

[19.0] [FIX] construction_developer: correctly duplicate work items on SO#2183
fw-bot wants to merge 1 commit into
odoo:saas-19.3from
odoo-dev:saas-19.3-fix-duplicate-work-item-527433-fw

Conversation

@fw-bot
Copy link
Copy Markdown

@fw-bot fw-bot commented May 18, 2026

Fixes #2172.

When a sale.order is duplicated, the Many2one references are copied natively, meaning both the old and new sale.order.line referenced the exact same x_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=False to the field definition in Studio (ir_model_fields.xml), the work item reference is appropriately stripped upon duplication. This subsequently triggers the existing standard automation base_automation_sol_on_write to re-instantiate a fresh Work Item directly from the product template.

Forward-Port-Of: #2173

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
@robodoo
Copy link
Copy Markdown
Collaborator

robodoo commented May 18, 2026

Pull request status dashboard

@fw-bot
Copy link
Copy Markdown
Author

fw-bot commented May 18, 2026

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>
@robodoo robodoo closed this May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants