[FIX] purchase: update order_lines date_planned

When we are trying to use the button 'set date to all order lines, we
get a traceback saying, that update cannot be done, because it ensure
that there's only one record. (After 9.0, there is no more this
'ensure_one').

This bug has been introduced in rev: https://github.com/odoo/odoo/commit/401a3cfaf6fd09f594e45c181e908900acba3777

To fix it, we iterate over the order lines, and do the update of each
line.
This commit is contained in:
Pierre Masereel
2016-11-22 16:49:28 +01:00
committed by Christophe Simonis
parent 131a16525e
commit dcf50bf242
+3 -1
View File
@@ -479,7 +479,9 @@ class PurchaseOrder(models.Model):
@api.multi
def action_set_date_planned(self):
for order in self:
order.order_line.update({'date_planned': order.date_planned})
#DO NOT FORWARD PORT
for line in order.order_line:
line.update({'date_planned': order.date_planned})
class PurchaseOrderLine(models.Model):