[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
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user