Production lots (serial numbers) can be deleted even if it has stock moves

Bug #1176912 reported by Mohammad Alhashash
12
This bug affects 2 people
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

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
Amit Parik (amit-parik)
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
Revision history for this message
Nimesh Contractor(Open ERP) (nco-openerp) wrote :

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 !

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Mohammad Alhashash (alhashash) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.