From e4a0a300cb974bbcbe599770926efe0a385fee0f Mon Sep 17 00:00:00 2001 From: "Denis Roussel (ACSONE)" Date: Thu, 9 Mar 2017 09:10:23 +0100 Subject: [PATCH] [FIX] stock_calendar : correctly schedule calendar Bad call to api.multi method. Introduced at 4cb09653 Closes #15763 --- addons/stock_calendar/models/stock.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/stock_calendar/models/stock.py b/addons/stock_calendar/models/stock.py index 01768f43d0d..9ed605cda30 100644 --- a/addons/stock_calendar/models/stock.py +++ b/addons/stock_calendar/models/stock.py @@ -34,7 +34,6 @@ class StockWarehouseOrderpoint(models.Model): """ # TDE FIXME: unused context key 'no_round_hours' removed # Check if orderpoint has last execution date and calculate if we need to calculate again already - Calendar = self.env["resource.calendar"] Attendance = self.env["resource.calendar.attendance"] group = False date = False @@ -46,7 +45,7 @@ class StockWarehouseOrderpoint(models.Model): else: new_date = datetime.utcnow() # TDE note: I bet accessing interval[2] will crash, no ? this code seems very louche - intervals = Calendar._schedule_days(self.purchase_calendar_id.id, 1, new_date, compute_leaves=True) + intervals = self.purchase_calendar_id._schedule_days(1, new_date, compute_leaves=True) for interval in intervals: # If last execution date, interval should start after it in order not to execute the same orderpoint twice # TODO: Make the interval a little bigger