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

lp bug: https://launchpad.net/bugs/1049415 fixed

bzr revid: rha@tinyerp.com-20130415093513-wq98pv62sywys134
This commit is contained in:
Rifakat 2013-04-15 15:05:13 +05:30
parent af5892458b
commit 0b7f30af8b
1 changed files with 4 additions and 2 deletions

View File

@ -295,8 +295,10 @@ class mrp_bom(osv.osv):
"""
if properties is None:
properties = []
cr.execute('select id from mrp_bom where product_id=%s and bom_id is null order by sequence', (product_id,))
ids = map(lambda x: x[0], cr.fetchall())
domain = [('product_id', '=', product_id), ('bom_id', '=', False), '&',
'|', ('date_start', '=', False), ('date_start', '<=', time.strftime('%Y-%m-%d %H:%M:%S')),
'|', ('date_stop', '=', False), ('date_stop', '>=', time.strftime('%Y-%m-%d %H:%M:%S'))]
ids = self.search(cr, uid, domain, order='sequence')
max_prop = 0
result = False
for bom in self.pool.get('mrp.bom').browse(cr, uid, ids):