From fb51d5c648254d02ebe25781c3135b476a4a516f Mon Sep 17 00:00:00 2001 From: Jigar Patel Date: Fri, 19 Apr 2019 07:16:43 +0000 Subject: [PATCH] [IMP] wesbite_form: change custom fields title for mail.mail task-32212 --- addons/website_form/controllers/main.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/website_form/controllers/main.py b/addons/website_form/controllers/main.py index f8a75af3130..fc9c326eb07 100644 --- a/addons/website_form/controllers/main.py +++ b/addons/website_form/controllers/main.py @@ -49,9 +49,8 @@ class WebsiteForm(http.Controller): return json.dumps({'id': id_record}) - # Constants string to make custom info and metadata readable on a text field + # Constants string to make metadata readable on a text field - _custom_label = "%s\n___________\n\n" % _("Custom infos") # Title for custom fields _meta_label = "%s\n________\n\n" % _("Metadata") # Title for meta data # Dict of dynamically called filters following type of field to be fault tolerent @@ -176,10 +175,13 @@ class WebsiteForm(http.Controller): record = request.env[model_name].sudo().with_context(mail_create_nosubscribe=True).create(values) if custom or meta: + _custom_label = "%s\n___________\n\n" % _("Other Information:") # Title for custom fields + if model_name == 'mail.mail': + _custom_label = "%s\n___________\n\n" % _("This message has been posted on your website!") default_field = model.website_form_default_field_id default_field_data = values.get(default_field.name, '') custom_content = (default_field_data + "\n\n" if default_field_data else '') \ - + (self._custom_label + custom + "\n\n" if custom else '') \ + + (_custom_label + custom + "\n\n" if custom else '') \ + (self._meta_label + meta if meta else '') # If there is a default field configured for this model, use it.