summaryrefslogtreecommitdiff
path: root/addons/pad
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-07-26 18:47:54 +0200
committerChristophe Simonis <chs@odoo.com>2017-07-26 18:47:54 +0200
commit681f03e30978af39e09bcad12e7a3d9392f23ccb (patch)
tree656aec3e32e780c90cc859eeeaf1c463dfc823b1 /addons/pad
parent621e392b52062b28860363d82e2ad9a13e70431f (diff)
parentc4e9b854ff22af31bbbd88d1414e77d27eaed7ea (diff)
[MERGE] forward port branch saas-14 up to c4e9b854ff2
Diffstat (limited to 'addons/pad')
-rw-r--r--addons/pad/models/pad.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/addons/pad/models/pad.py b/addons/pad/models/pad.py
index dfa1dbf859b..eb6267ee389 100644
--- a/addons/pad/models/pad.py
+++ b/addons/pad/models/pad.py
@@ -115,6 +115,14 @@ class PadCommon(models.AbstractModel):
# Set the pad content in vals
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):
+ company = self.env.user.sudo().company_id
+ myPad = EtherpadLiteClient(company.pad_key, company.pad_server + '/api')
+ path = self[k].split('/p/')[1]
+ myPad.setText(path, (html2plaintext(vals[field.pad_content_field]).encode('utf-8')))
+ # Update the `pad_content_field` if the pad is modified
for k, v in vals.items():
field = self._fields[k]
if hasattr(field, 'pad_content_field'):