Test if get_supply_dates is defined on PurchaseRequest
The method is defined in stock_supply but the model in purchase_request, so we can have the model without the method. issue6445 review41261002
This commit is contained in:
@@ -57,7 +57,8 @@ class Sale:
|
||||
except KeyError:
|
||||
PurchaseRequest = None
|
||||
|
||||
if PurchaseRequest and product.purchasable:
|
||||
if (getattr(PurchaseRequest, 'get_supply_dates', None)
|
||||
and product.purchasable):
|
||||
return PurchaseRequest.get_supply_dates(product)[0]
|
||||
else:
|
||||
# TODO compute supply date for production
|
||||
|
||||
Reference in New Issue
Block a user