[MERGE] merged a branch with cleaning of stock/wizard/stock_location_product.py. Courtesy of Numerigraphe

bzr revid: qdp-launchpad@openerp.com-20111116132938-yjuhe2i3hlpwha5q
This commit is contained in:
Quentin (OpenERP) 2011-11-16 14:29:38 +01:00
commit 5ec5510474
1 changed files with 8 additions and 6 deletions

View File

@ -34,21 +34,23 @@ class stock_location_product(osv.osv_memory):
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
@param ids: An ID or list of IDs if we want more than one
@param ids: An ID or list of IDs (but only the first ID will be processed)
@param context: A standard dictionary
@return: Invoice type
"""
mod_obj = self.pool.get('ir.model.data')
for location_obj in self.read(cr, uid, ids, ['from_date', 'to_date'], context=context):
if context is None:
context = {}
location_products = self.read(cr, uid, ids, ['from_date', 'to_date'], context=context)
if location_products:
return {
'name': False,
'view_type': 'form',
'view_mode': 'tree,form',
'res_model': 'product.product',
'type': 'ir.actions.act_window',
'context': {'location': context['active_id'],
'from_date': location_obj['from_date'],
'to_date': location_obj['to_date']},
'context': {'location': context.get('active_id'),
'from_date': location_products[0]['from_date'],
'to_date': location_products[0]['to_date']},
'domain': [('type', '<>', 'service')],
}