When duplicating a picking, the default values of the new moves should be done in stock_move.copy_data
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Committed
|
Low
|
OpenERP Publisher's Warranty Team | ||
OpenERP Community Backports (Addons) |
New
|
Undecided
|
Unassigned |
Bug Description
As you can see here:
http://
`stock_
It should be replaced by a correct inheritance of the `stock_
The current implementation has possible side effects, as the moves are first copied with the fields, and then they are emptied. Even if this happens in the same transaction, code could not work as we would expect with the copy method.
A good demonstration is to add such a constraint that ensures that a pack cannot be shared between pickings:
class stock_move(
_inherit = 'stock.move'
def _check_
for move in self.browse(cr, uid, ids, context=context):
if not move.tracking_id:
if any(tm.picking_id != picking for
return True
'The tracking cannot be shared accross '
]
Now f I create a picking OUT/00015 with:
- move 1
- move 2
And put the moves in new packs:
- 1: 00000017
- 2: 00000024
And I duplicate the picking OUT/00015, `stock_
- 1copy: 00000017
- 2copy: 00000024
***
And then it empties the `tracking_id` field so we have:
- 1copy:
- 2copy:
But we never reach this final state, because the constraint is raised where I wrote ***.
Related branches
- OpenERP Core Team: Pending requested
-
Diff: 33 lines (+6/-7)1 file modifiedstock/stock.py (+6/-7)
- Leonardo Pistone: Approve (code review)
- Yannick Vaucher @ Camptocamp: Approve (code review, no tests)
- Holger Brunn (Therp): Approve (code review)
-
Diff: 33 lines (+6/-7)1 file modifiedstock/stock.py (+6/-7)
Changed in openobject-addons: | |
assignee: | nobody → OpenERP Publisher's Warranty Team (openerp-opw) |
tags: | added: maintenance |
Changed in openobject-addons: | |
importance: | Undecided → Low |
status: | New → Fix Committed |
I I'm not mistaken this is fixed in trunk-wms.