From c8441a69c2497c3d26afee25b3e1baab8a15fec1 Mon Sep 17 00:00:00 2001 From: len-odoo Date: Thu, 13 Sep 2018 13:07:18 +0200 Subject: [PATCH 1/3] [FIX] project: remove group_by from the context The group_by was passed from context from the action spawning a new view. This meant that it could give a group_by a field that was not defined on the destination view, causing a js traceback. opw 1884035 --- addons/project/models/project.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/project/models/project.py b/addons/project/models/project.py index 3b3030b26e4..0baf2fbff58 100644 --- a/addons/project/models/project.py +++ b/addons/project/models/project.py @@ -399,6 +399,7 @@ class Project(models.Model): action_context = safe_eval(action['context']) if action['context'] else {} action_context.update(self._context) action_context['search_default_parent_res_name'] = self.name + action_context.pop('group_by', None) return dict(action, context=action_context) # --------------------------------------------------- From eb11665bfcede0555f9b0d5f20422d2827596e56 Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Fri, 14 Sep 2018 11:04:49 +0200 Subject: [PATCH 2/3] [FIX] rating: Send rating if no override of rating_get_parent Purpose ======= Currently if the method rating_get_parent is not overriden, then sending a rating on a record of the model leads to a traceback. --- addons/rating/models/rating.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/rating/models/rating.py b/addons/rating/models/rating.py index 7ad76ddda87..671ef7e7bd3 100644 --- a/addons/rating/models/rating.py +++ b/addons/rating/models/rating.py @@ -106,9 +106,11 @@ class Rating(models.Model): 'parent_res_id': False, } if hasattr(current_record, 'rating_get_parent'): - parent_res_model = getattr(current_record, current_record.rating_get_parent()) - data['parent_res_model_id'] = self.env['ir.model']._get(parent_res_model._name).id - data['parent_res_id'] = parent_res_model.id + current_record_parent = current_record.rating_get_parent() + if current_record_parent: + parent_res_model = getattr(current_record, current_record_parent) + data['parent_res_model_id'] = self.env['ir.model']._get(parent_res_model._name).id + data['parent_res_id'] = parent_res_model.id return data @api.multi From ea0b3d600d3e7361758e83210b907c5dd5f2f7fe Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 14 Sep 2018 14:05:24 +0200 Subject: [PATCH 3/3] [FIX] mail: declare services used in forward-ported test Only broke test with enterprise overwrite. --- addons/mail/static/tests/chatter_tests.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/mail/static/tests/chatter_tests.js b/addons/mail/static/tests/chatter_tests.js index f98cd1382a8..a2b6566f4d0 100644 --- a/addons/mail/static/tests/chatter_tests.js +++ b/addons/mail/static/tests/chatter_tests.js @@ -168,6 +168,7 @@ QUnit.test('Activity Done keep feedback on blur', function (assert) { View: FormView, model: 'partner', data: this.data, + services: this.services, res_id: 2, arch:'
' + '
' +