[REF] changes suggested by @guewen

Set a keyword argument on the context to better respect the convention.
Allow the context to contain iterable types supported by the ORM.

Cherry-picked from v7 at 9ab7f78a7f

Conflicts:
	stock_available/product.py
	stock_available_immediately/product.py
This commit is contained in:
Lionel Sausin (Numérigraphe)
2014-12-05 17:25:35 +01:00
committed by Lionel Sausin
parent 99575b0661
commit 5265a9eeb2
2 changed files with 4 additions and 2 deletions

View File

@@ -73,10 +73,12 @@ class product_product(orm.Model):
return res
def _compute_potential_qty_from_bom(self, cr, uid, bom_id, to_uom,
context):
context=None):
"""Compute the potential qty from BoMs with components available"""
bom_obj = self.pool['mrp.bom']
uom_obj = self.pool['product.uom']
if context is None:
context = {}
if 'uom' in context:
context_wo_uom = context.copy()
del context_wo_uom['uom']

View File

@@ -134,7 +134,7 @@ class ProductProduct(orm.Model):
# location
if context.get('location', False):
# Either a single or multiple locations can be in the context
if not isinstance(context['location'], list):
if isinstance(context['location'], (int, long)):
location_ids = [context['location']]
else:
location_ids = context['location']