Merge lp:~openerp-dev/openobject-addons/trunk-bug-1297736-hsa into lp:openobject-addons

Proposed by Hardik Sanchawat (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1297736-hsa
Merge into: lp:openobject-addons
Diff against target: 17 lines (+6/-1)
1 file modified
mrp/mrp.py (+6/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1297736-hsa
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+216421@code.launchpad.net

Description of the change

Hello,

I fixed this issue in trunk.

Issue Scenario :
When I try to delete the Bill of meterial I can successfully delete it even I have the manufacturing order for that same product with any state. It should not be allow to delete it .
After that If I have any manufacturing order in "ready to produce" state and I deleted the BOM then after If I try to produce the product it doesn't allow me beccuase bom_id is required field on mrp.production.

I fixed this bug lp:1297736

Thanks,
-HSA

To post a comment you must log in.
9363. By Hardik Sanchawat (OpenERP)

[IMP]update the code

Unmerged revisions

9363. By Hardik Sanchawat (OpenERP)

[IMP]update the code

9362. By Hardik Sanchawat (OpenERP)

[FIX] MRP: Deleting Bill of Material when there are Manufacturing orders

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mrp/mrp.py'
2--- mrp/mrp.py 2014-03-11 14:52:05 +0000
3+++ mrp/mrp.py 2014-04-18 09:54:27 +0000
4@@ -376,7 +376,12 @@
5 bom_data = self.read(cr, uid, id, [], context=context)
6 default.update(name=_("%s (copy)") % (bom_data['name']), bom_id=False)
7 return super(mrp_bom, self).copy_data(cr, uid, id, default, context=context)
8-
9+
10+ def unlink(self, cr, uid, ids, context=None):
11+ product_ids = self.pool.get('mrp.production').search(cr, uid, [('bom_id','in',ids)])
12+ if product_ids:
13+ raise osv.except_osv(_('Warning!'),_("You can not delete BOM because already assigned in Manufacturing Order."))
14+ return super(mrp_bom,self).unlink(cr, uid, ids, context)
15
16 def rounding(f, r):
17 # TODO for trunk: log deprecation warning

Subscribers

People subscribed via source and target branches

to all changes: