Improve _get_products_key.

This commit refs #16996
This commit is contained in:
Sergio Morillo 2021-01-15 00:40:02 +01:00
parent f2fe932b99
commit 3349a9e3ca
1 changed files with 2 additions and 1 deletions

View File

@ -953,7 +953,8 @@ class TransportReportMixin(object):
cat_weight = Modeldata.get_id('product', 'uom_cat_weight')
kg_uom = Uom(Modeldata.get_id('product', 'uom_kilogram'))
if product_key[0].default_uom.category.id != cat_weight:
product = origins and origins[0].product or None
if product.default_uom.category.id != cat_weight:
return None
if origins[0].__name__ == 'stock.unit_load':
res = sum(Uom.compute_qty(