From 222479f90dc5b06b351789f980cf218cfdcbe611 Mon Sep 17 00:00:00 2001 From: Cristian Moncho Date: Thu, 23 Jun 2016 16:24:54 +0200 Subject: [PATCH] [FIX] mrp_project: Fix singleton exception in 'ProjectTask.write' Records are now iterated to avoid singleton errors. Same fix has been applied in 'MrpProductionWorkcenterLine.write' also. --- mrp_project/models/mrp_production.py | 6 ++++-- mrp_project/models/project_task.py | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/mrp_project/models/mrp_production.py b/mrp_project/models/mrp_production.py index bee26761d..52dabe315 100644 --- a/mrp_project/models/mrp_production.py +++ b/mrp_project/models/mrp_production.py @@ -101,5 +101,7 @@ class MrpProductionWorkcenterLine(models.Model): @api.multi def write(self, vals, update=True): - return super(MrpProductionWorkcenterLine, self.with_context( - production=self.production_id)).write(vals) + for rec in self: + super(MrpProductionWorkcenterLine, rec.with_context( + production=rec.production_id)).write(vals) + return True diff --git a/mrp_project/models/project_task.py b/mrp_project/models/project_task.py index 815b998ff..43f5a68ae 100644 --- a/mrp_project/models/project_task.py +++ b/mrp_project/models/project_task.py @@ -32,5 +32,7 @@ class ProjectTask(models.Model): @api.multi def write(self, vals): - return super(ProjectTask, self.with_context( - production=self.mrp_production_id)).write(vals) + for rec in self: + super(ProjectTask, rec.with_context( + production=rec.mrp_production_id)).write(vals) + return True