From 20f5f625f49040cc6bd9758a0dc7a2fb46bb6367 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Mon, 16 Apr 2018 16:22:31 +0200 Subject: [PATCH] [FIX] pad: prevent concat bool and string Before installing pads, create a second company On the first company, create a task and initialize its pad Switch companies and try to edit the task Before this commit: There is a traceback because since the pad credentials of the second company are not set, the url cannot be computed After this commit, we prevent the Null field to concat with a string hence there is no traceback OPW 1837059 closes #24263 --- addons/pad/models/pad.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/pad/models/pad.py b/addons/pad/models/pad.py index deb920ec69e..9cdcbec12af 100644 --- a/addons/pad/models/pad.py +++ b/addons/pad/models/pad.py @@ -75,7 +75,7 @@ class PadCommon(models.AbstractModel): @api.model def pad_get_content(self, url): company = self.env.user.sudo().company_id - myPad = EtherpadLiteClient(company.pad_key, company.pad_server + '/api') + myPad = EtherpadLiteClient(company.pad_key, (company.pad_server or '') + '/api') content = '' if url: split_url = url.split('/p/') @@ -132,7 +132,7 @@ class PadCommon(models.AbstractModel): for k, field in self._fields.items(): if hasattr(field, 'pad_content_field') and vals.get(field.pad_content_field) and self[k]: company = self.env.user.sudo().company_id - myPad = EtherpadLiteClient(company.pad_key, company.pad_server + '/api') + myPad = EtherpadLiteClient(company.pad_key, (company.pad_server or '') + '/api') path = self[k].split('/p/')[1] myPad.setHtmlFallbackText(path, vals[field.pad_content_field])