summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Voet (ryv) <ryv@odoo.com>2020-12-15 10:57:00 +0000
committerRémy Voet (ryv) <ryv@odoo.com>2020-12-15 12:57:37 +0000
commitb29ac84fd55923abf582cdee39cb32bacda3eec9 (patch)
treee43dc3f39fb518bc8f65d2a07f7950d43ff92cc4
parent5b3290b0869e3954ff1606ad0ca0a35cfd948698 (diff)
[FIX] purchase_stock: RFQ update `date_planned` from portal
In case of RFQ with the "Ask confirmation X day(s) before" set, the email send to the vendor give a link where he (portal user) can change the date_planned of PO lines. But the change wasn't done in the server side because the `_update_date_planned` (of stock_purchase) doesn't call super if there isn't a linked move (none in case of RFQ). Call super also in case there isn't any moves. close #59040 closes odoo/odoo#63378 Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
-rw-r--r--addons/purchase_stock/models/purchase.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/purchase_stock/models/purchase.py b/addons/purchase_stock/models/purchase.py
index ae3e32c169f..efaa134a1ef 100644
--- a/addons/purchase_stock/models/purchase.py
+++ b/addons/purchase_stock/models/purchase.py
@@ -541,8 +541,9 @@ class PurchaseOrderLine(models.Model):
def _update_date_planned(self, updated_date):
move_to_update = self.move_ids.filtered(lambda m: m.state not in ['done', 'cancel'])
- if move_to_update:
+ if not self.move_ids or move_to_update: # Only change the date if there is no move done or none
super()._update_date_planned(updated_date)
+ if move_to_update:
self._update_move_date_deadline(updated_date)
@api.model