From 9b8bc5e5a11d625a72043e2b076d99be3c24d2c4 Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Thu, 3 Aug 2017 14:03:55 +0200 Subject: [PATCH] [FIX] pad: Avoid to update pad from description is not initialized yet The goal of the commit https://github.com/odoo/odoo/commit/c5bd509 is to update the etherpad content if the description field is updated. However, if the pad is not initialized yet, we shouldn't try to do this obviously. --- addons/pad/models/pad.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/pad/models/pad.py b/addons/pad/models/pad.py index eb6267ee389..65a8bf5bc5f 100644 --- a/addons/pad/models/pad.py +++ b/addons/pad/models/pad.py @@ -117,7 +117,7 @@ class PadCommon(models.AbstractModel): def _set_pad_value(self, vals): # Update the pad if the `pad_content_field` is modified for k, field in self._fields.iteritems(): - if hasattr(field, 'pad_content_field') and vals.get(field.pad_content_field): + 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') path = self[k].split('/p/')[1]