diff options
| author | Lucas Perais (lpe) <lpe@odoo.com> | 2018-04-16 16:22:31 +0200 |
|---|---|---|
| committer | Lucas Perais (lpe) <lpe@odoo.com> | 2018-04-18 11:03:22 +0200 |
| commit | 20f5f625f49040cc6bd9758a0dc7a2fb46bb6367 (patch) | |
| tree | 237062b536bf55bcc07449173e3b6b4a9548cd11 /addons/pad/models/pad.py | |
| parent | ffdfbed42c48a4b85c26f224f32003b8bda2ce78 (diff) | |
[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
Diffstat (limited to 'addons/pad/models/pad.py')
| -rw-r--r-- | addons/pad/models/pad.py | 4 |
1 files 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]) |
