Merge lp:~openerp-dev/openobject-addons/6.0-opw-591314-rha into lp:openobject-addons/6.0

Proposed by Rifakat Husen (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-opw-591314-rha
Merge into: lp:openobject-addons/6.0
Diff against target: 16 lines (+4/-2)
1 file modified
mrp/mrp.py (+4/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-opw-591314-rha
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+159555@code.launchpad.net

Description of the change

Manufacturing neither consider the activation of a bill attached to produceable product nor
check validity time period/activation time period of the particular bill(Valid From-Valid Until).

Deactivated bill of material(BoM) or the bills which does not belong to validity period should be
restricted to be used in a manufacturing process.

I enhance checking. Restrict deactivated and invalid BoM in MO.

To post a comment you must log in.

Unmerged revisions

5467. By Rifakat Husen (OpenERP)

[FIX] mrp: allow only those bills which are active and not expired(belongs to specific period) in manufacturing

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 2013-03-26 08:08:25 +0000
3+++ mrp/mrp.py 2013-04-18 06:01:34 +0000
4@@ -284,8 +284,10 @@
5 @param properties: List of related properties.
6 @return: False or BoM id.
7 """
8- cr.execute('select id from mrp_bom where product_id=%s and bom_id is null order by sequence', (product_id,))
9- ids = map(lambda x: x[0], cr.fetchall())
10+ domain = [('product_id', '=', product_id), ('bom_id', '=', False), '&',
11+ '|', ('date_start', '=', False), ('date_start', '<=', time.strftime('%Y-%m-%d %H:%M:%S')),
12+ '|', ('date_stop', '=', False), ('date_stop', '>=', time.strftime('%Y-%m-%d %H:%M:%S'))]
13+ ids = self.search(cr, uid, domain, order='sequence')
14 max_prop = 0
15 result = False
16 for bom in self.pool.get('mrp.bom').browse(cr, uid, ids):