mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[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:
committed by
Lionel Sausin
parent
99575b0661
commit
5265a9eeb2
@@ -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']
|
||||
|
||||
@@ -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']
|
||||
|
||||
Reference in New Issue
Block a user