[FIX] google_drive: fix traceback while create templates
Before this commit: While creating new templates it will give a traceback After this commit: While creating new templates it will not give a traceback LINKS Task-2334852 closes odoo/odoo#59502 X-original-commit: d04a1b869ef73c302dcd9a1cb04f6d952b0a3db3 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
committed by
Hiral Bhavsar
parent
e6fccbae92
commit
c74517e503
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user