summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views
diff options
context:
space:
mode:
authorstd-odoo <std@odoo.com>2020-04-15 06:21:38 +0000
committerThibault Delavallée <tde@odoo.com>2020-05-27 08:56:35 +0000
commit4e1399dc0d292da3a2e05efc3dc0a53d2f9a030f (patch)
tree1377f70ad24fa340cb5c35aa6610700fd288cf78 /addons/web/static/src/js/views
parent0d569c8117feb712570af2498923a10d859cff33 (diff)
[IMP] web: customize the save/close button of a `FormViewDialog`
Purpose ======= In Social, we want to be able to change the "Save" button into a "Add" button when we add a new stream. For that purpose, we need to be able to customize the text of the `FormViewDialog` buttons. Task-2234580 See odoo/enterprise/pull/9933 closes odoo/odoo#49622 Related: odoo/enterprise#9933 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons/web/static/src/js/views')
-rw-r--r--addons/web/static/src/js/views/view_dialogs.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/web/static/src/js/views/view_dialogs.js b/addons/web/static/src/js/views/view_dialogs.js
index 6f00b60d2a4..95a1ac9acd2 100644
--- a/addons/web/static/src/js/views/view_dialogs.js
+++ b/addons/web/static/src/js/views/view_dialogs.js
@@ -110,7 +110,7 @@ var FormViewDialog = ViewDialog.extend({
if (!options.buttons) {
options.buttons = [{
- text: (readonly ? _t("Close") : _t("Discard")),
+ text: options.close_text || (readonly ? _t("Close") : _t("Discard")),
classes: "btn-secondary o_form_button_cancel",
close: true,
click: function () {
@@ -124,7 +124,7 @@ var FormViewDialog = ViewDialog.extend({
if (!readonly) {
options.buttons.unshift({
- text: (multi_select ? _t("Save & Close") : _t("Save")),
+ text: options.save_text || (multi_select ? _t("Save & Close") : _t("Save")),
classes: "btn-primary",
click: function () {
self._save().then(self.close.bind(self));