From c0c64a7fe5b7ae5772740eaa4a4543945662ba4e Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Tue, 20 Oct 2015 12:22:06 +0200 Subject: [PATCH] [FIX] purchase: Scheduled Date in PO When setting the quantity in a PO line, the field "date_planned" is changed by onchange_product_id and this field is equal to: -the date of today + seller.delay if there is at least one provider for the product -the date of today if there is no provider set for the product -the date manually set if there is no provider and already a scheduled_date set To keep the similar behaviour to 8.0 for product without provider. opw:652394 --- addons/purchase/purchase.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 8f01ecce86f..6a6a329ee15 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -571,8 +571,8 @@ class PurchaseOrderLine(models.Model): if price_unit and seller and self.order_id.currency_id and seller.currency_id != self.order_id.currency_id: price_unit = seller.currency_id.compute(price_unit, self.order_id.currency_id) self.price_unit = price_unit - - self.date_planned = self._get_date_planned(seller).strftime(DEFAULT_SERVER_DATETIME_FORMAT) + if seller or not self.date_planned: + self.date_planned = self._get_date_planned(seller).strftime(DEFAULT_SERVER_DATETIME_FORMAT) product_lang = self.product_id.with_context({ 'lang': self.partner_id.lang,