[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.
This commit is contained in:
Yannick Tivisse
2017-08-03 14:03:55 +02:00
parent 8510c0ce37
commit 9b8bc5e5a1
+1 -1
View File
@@ -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]