lims_production: fix error when no purchase module installed

This commit is contained in:
Sebastián Marró 2020-04-30 12:02:11 -03:00
parent 3a1642735a
commit d42dc7e0c3

View file

@ -433,7 +433,8 @@ class Lot(metaclass=PoolMeta):
if not values.get('category'):
product = Product(values['product'])
lot_category_id = None
if (product.purchasable and not product.salable):
if (hasattr(product, 'purchasable') and
product.purchasable and not product.salable):
lot_category_id = (config.lot_category_input_prod.id
if config.lot_category_input_prod else None)
elif (not product.purchasable and product.salable):