diff options
| author | alt-odoo <alt@odoo.com> | 2020-09-04 05:18:01 +0000 |
|---|---|---|
| committer | alt-odoo <alt@odoo.com> | 2020-09-04 16:22:59 +0000 |
| commit | f3f4a5db3a1f21f8234cccf47db9097ebf92c0aa (patch) | |
| tree | 40b74a7f284bdebe0936f3287c77e74890fd749d | |
| parent | 8d3413ff647de8d98c6858062dd07dde4160af95 (diff) | |
[FIX] mrp: no error on workorders scheduled start date update
When a user is accessing a work order in state ready, we are updating it and
rewriting date_planned_start field. We also update accordingly the associated
slot of the workcenter calendar (leave_id), but if the ressource of this slot
is linked to another user, a record rule on resource.calendar.leaves is preventing
the update, which should occur without error, even if the user does not have
Time Off / All Approver rights.
closes odoo/odoo#57118
X-original-commit: 790fb1820fbd49d07206963077216cc304ed2b0a
Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
| -rw-r--r-- | addons/mrp/models/mrp_workorder.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/mrp/models/mrp_workorder.py b/addons/mrp/models/mrp_workorder.py index 713f12c10f0..09a43fafb6e 100644 --- a/addons/mrp/models/mrp_workorder.py +++ b/addons/mrp/models/mrp_workorder.py @@ -239,7 +239,7 @@ class MrpWorkorder(models.Model): def _set_dates_planned(self): date_from = self[0].date_planned_start date_to = self[0].date_planned_finished - self.mapped('leave_id').write({ + self.mapped('leave_id').sudo().write({ 'date_from': date_from, 'date_to': date_to, }) |
