From 401a3cfaf6fd09f594e45c181e908900acba3777 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Wed, 27 Jul 2016 11:01:34 +0200 Subject: [PATCH] [IMP] purchase: set scheduled date of lines Commit a572b8115cdaa3a28f5c977a6006ddfa95647987 removes the inverse function of the `date_planned`. This is necessary to avoid unexpected changes of the scheduled dates. However, this removes the ability to set the scheduled dates of all lines at once. This commit introduces back the functionality thanks to a new button. This way, the functionality remains without unexpected behavior. Backport of rev: https://github.com/odoo/odoo/commit/2cf80e00752c68e443b0cd442ee50f7d6daaa455 opw-692873 --- addons/purchase/purchase.py | 5 +++++ addons/purchase/purchase_view.xml | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 969b31664a5..ac8164ec80d 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -439,6 +439,11 @@ class PurchaseOrder(models.Model): result['res_id'] = self.invoice_ids.id return result + @api.multi + def action_set_date_planned(self): + for order in self: + order.order_line.update({'date_planned': order.date_planned}) + class PurchaseOrderLine(models.Model): _name = 'purchase.order.line' diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index 55667830046..020c753d479 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -249,7 +249,15 @@ - +