diff options
| -rw-r--r-- | addons/pad/models/pad.py | 8 | ||||
| -rw-r--r-- | addons/pad/static/src/js/pad.js | 3 |
2 files changed, 7 insertions, 4 deletions
diff --git a/addons/pad/models/pad.py b/addons/pad/models/pad.py index 25aa64c7563..03db10759ac 100644 --- a/addons/pad/models/pad.py +++ b/addons/pad/models/pad.py @@ -65,10 +65,12 @@ class PadCommon(models.AbstractModel): field = model._fields[self.env.context['field_name']] real_field = field.pad_content_field + res_id = self.env.context.get("object_id") + record = model.browse(res_id) # get content of the real field - for record in model.browse(self.env.context.get("object_id")): - if record[real_field]: - myPad.setHtmlFallbackText(path, record[real_field]) + real_field_value = record[real_field] or self.env.context.get('record', {}).get(real_field, '') + if real_field_value: + myPad.setHtmlFallbackText(path, real_field_value) return { "server": pad["server"], diff --git a/addons/pad/static/src/js/pad.js b/addons/pad/static/src/js/pad.js index 02b34f2b725..7107c2d6e6a 100644 --- a/addons/pad/static/src/js/pad.js +++ b/addons/pad/static/src/js/pad.js @@ -125,7 +125,8 @@ var FieldPad = AbstractField.extend({ context: { model: this.model, field_name: this.name, - object_id: this.res_id + object_id: this.res_id, + record: this.recordData, }, }, { shadow: true |
