[FIX] stock: prevent serial number deletion on stock.move
authorMohammad Alhashash <alhashash@alhashash.net>
Tue, 11 Nov 2014 12:48:48 +0000 (14:48 +0200)
committerMartin Trigaux <mat@odoo.com>
Thu, 27 Nov 2014 11:47:41 +0000 (12:47 +0100)
commit2461baa0dda461792d5c3f5a72cb8a98bc3877a1
tree2b0f40bd380fcbef117adcc6001774850031fd21
parentf0e331e005d830d8b5aaa4cb5e2824d98bd75b2a
[FIX] stock: prevent serial number deletion on stock.move

prodlot_id field may be required due to constraint `_check_tracking`.
When a stock.production.lot is deleted, the constraint on linked stock.move is
not checked. To avoid inconsistency, restrict the suppression.
To allow the modification of existing stock.move, remove the states attribute on
the field definition.

As removal of serial may impact the traceability, it makes sense on buisness
point of view to force the modification of previous stock.move, even if the
constraint would not have been violated.
The list of linked stock.move is present on the serial form view making
the operation easier.

Fixes #3560, lp:1176912
addons/stock/stock.py