From 4bc9d0b15996a1d54fd4ba80c46fcd848cdb5b2d Mon Sep 17 00:00:00 2001 From: Maxime Chambreuil Date: Wed, 27 Mar 2019 12:53:30 -0600 Subject: [PATCH] [FIX] agreement: Issue #290 --- agreement/models/agreement.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agreement/models/agreement.py b/agreement/models/agreement.py index c2ce8bb2..58a930dd 100644 --- a/agreement/models/agreement.py +++ b/agreement/models/agreement.py @@ -336,7 +336,7 @@ class Agreement(models.Model): @api.onchange('field_id') def onchange_sub_object_id(self): - if self.field_id: + if self.field_id and self.field_id.relation: self.sub_object_id = self.env['ir.model'].search( [('model', '=', self.field_id.relation)])[0]