Production lots (serial numbers) can be deleted even if it has stock moves
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Committed
|
Medium
|
OpenERP R&D Addons Team 2 |
Bug Description
To replicate, create a new production lot, create and process a reception or delivery using that lot. Then delete the lot. The deletion is successful! and the serial number in product move is removed even if the move state is done and serial number is required for that product!
The main problem is that the default value for 'ondelete' field attribute is 'set null' and it is not defined for 'prodlot_id' field in 'stock.move' model. It should be defined as 'restricted'.
I believe the default value for ondelete should be 'no action' as this is the default behavior of PostgreSQL and every other database I used before. 'cascade' and 'set null' should be always explicitly declared in field definition.
Regards,
Mohammad Alhashash
Related branches
- Amit Parik (community): Approve
- OpenERP Core Team: Pending requested
-
Diff: 12 lines (+1/-1)1 file modifiedstock/stock.py (+1/-1)
summary: |
- Production lots (serial numbers) can be deleted even if the have stock + Production lots (serial numbers) can be deleted even if it has stock moves |
description: | updated |
Changed in openobject-addons: | |
assignee: | nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2) |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in openobject-addons: | |
status: | Confirmed → In Progress |
Hello,
It has been fixed in https:/ /code.launchpad .net/~openerp- dev/openobject- addons/ trunk-bug- 1176912- nco branch.
Revision No: 8708.
Revision ID: <email address hidden>
Thank You !