From 87dadc5bc83714cb0e748824f57e4cd35d02bbbf Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 13 Jul 2018 11:44:54 +0200 Subject: [PATCH] Revert "[FIX] hr_timesheet: Removing task on a timesheet line" Method `_analytic_compute_delivered_quantity` does not exists anymore. The bug this patch resolved is not present in saas~11.2. Patch not needed. This reverts commit 371a92fb3086fb4f972ca96ec4a79c2a539f428a. --- addons/sale_timesheet/models/account.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/addons/sale_timesheet/models/account.py b/addons/sale_timesheet/models/account.py index ce6d789d690..23a5b3a5f67 100644 --- a/addons/sale_timesheet/models/account.py +++ b/addons/sale_timesheet/models/account.py @@ -32,16 +32,12 @@ class AccountAnalyticLine(models.Model): @api.multi def write(self, values): # prevent to update invoiced timesheets if one line is of type delivery - sale_order_lines = self.env['sale.order.line'] if self.sudo().filtered(lambda aal: aal.so_line.product_id.invoice_policy == "delivery") and self.filtered(lambda timesheet: timesheet.timesheet_invoice_id): if any([field_name in values for field_name in ['unit_amount', 'employee_id', 'task_id', 'timesheet_revenue', 'so_line', 'amount', 'date']]): raise UserError(_('You can not modify already invoiced timesheets (linked to a Sales order items invoiced on Time and material).')) - if 'task_id' in values and not values.get('so_line'): - sale_order_lines = self.sudo().mapped('so_line') result = super(AccountAnalyticLine, self).write(values) # applied only for timesheet self.filtered(lambda t: t.project_id)._timesheet_postprocess(values) - sale_order_lines.with_context(sale_analytic_force_recompute=True)._analytic_compute_delivered_quantity() return result @api.model