[FIX] mrp_operations,mrp_repair, stock: Fixed errors.

bzr revid: uco@tinyerp.com-20101004071036-3kah01azasv4k86o
This commit is contained in:
uco (Open ERP) 2010-10-04 12:40:36 +05:30
parent f1f4724479
commit f69cf2457e
3 changed files with 15 additions and 14 deletions

View File

@ -68,7 +68,7 @@ class mrp_production_workcenter_line(osv.osv):
@return: Dictionary of values.
"""
ops = self.browse(cr, uid, ids, context=context)
date_and_hours_by_cal = [(op.date_planned, op.hour, op.workcenter_id.calendar_id.id) for op in ops]
date_and_hours_by_cal = [(op.production_id.date_planned, op.hour, op.workcenter_id.calendar_id.id) for op in ops]
intervals = self.pool.get('resource.calendar').interval_get_multi(cr, uid, date_and_hours_by_cal)
res = {}

View File

@ -687,7 +687,7 @@ class mrp_repair_line(osv.osv, ProductChangeMixin):
if type == 'add':
stock_id = self.pool.get('stock.location').search(cr, uid, [('name','=','Stock')])[0]
to_invoice = False
if guarantee_limit and date.today() > datetime.strptime(guarantee_limit, '%Y-%m-%d'):
if guarantee_limit and datetime.today() > datetime.strptime(guarantee_limit, '%Y-%m-%d'):
to_invoice=True
return {'value': {
'to_invoice': to_invoice,

View File

@ -128,18 +128,19 @@ class stock_location(osv.osv):
c['location'] = loc_id
for prod in product_product_obj.browse(cr, uid, product_ids, context=c):
for f in field_names:
if f == 'stock_real':
result[loc_id][f] += prod.qty_available
elif f == 'stock_virtual':
result[loc_id][f] += prod.virtual_available
elif f == 'stock_real_value':
amount = prod.qty_available * prod.standard_price
amount = currency_obj.round(cr, uid, currency, amount)
result[loc_id][f] += amount
elif f == 'stock_virtual_value':
amount = prod.virtual_available * prod.standard_price
amount = currency_obj.round(cr, uid, currency, amount)
result[loc_id][f] += amount
if loc_id in result.keys():
if f == 'stock_real':
result[loc_id][f] += prod.qty_available
elif f == 'stock_virtual':
result[loc_id][f] += prod.virtual_available
elif f == 'stock_real_value':
amount = prod.qty_available * prod.standard_price
amount = currency_obj.round(cr, uid, currency, amount)
result[loc_id][f] += amount
elif f == 'stock_virtual_value':
amount = prod.virtual_available * prod.standard_price
amount = currency_obj.round(cr, uid, currency, amount)
result[loc_id][f] += amount
return result