odoo/industry#2173

Created by vvro
Merged at 118b31bcf42eb0ffa1ee2a822a6adaa41c1cd204

Statuses:

label
Corvanis:fix-duplicate-work-item
head
c9569c9baeb1140b5fe2ea697a54131549e6a731
merged
5 days ago by Industry, Vallaeys Valentin (vava)
odoo/industry
19.0 #2173
saas-19.1 #2179
saas-19.2 #2181
saas-19.3 #2183
master #2184

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

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.