summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--addons/google_drive/models/google_drive.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/addons/google_drive/models/google_drive.py b/addons/google_drive/models/google_drive.py
index 212062bbc70..fc641c04c7f 100644
--- a/addons/google_drive/models/google_drive.py
+++ b/addons/google_drive/models/google_drive.py
@@ -191,14 +191,15 @@ class GoogleDrive(models.Model):
return None
def _compute_ressource_id(self):
- result = {}
for record in self:
- word = self._get_key_from_url(record.google_drive_template_url)
- if word:
- record.google_drive_resource_id = word
+ if record.google_drive_template_url:
+ word = self._get_key_from_url(record.google_drive_template_url)
+ if word:
+ record.google_drive_resource_id = word
+ else:
+ raise UserError(_("Please enter a valid Google Document URL."))
else:
- raise UserError(_("Please enter a valid Google Document URL."))
- return result
+ record.google_drive_resource_id = False
def _compute_client_id(self):
google_drive_client_id = self.env['ir.config_parameter'].sudo().get_param('google_drive_client_id')