summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorFlorent de Labarre <florent.mirieu@gmail.com>2019-03-04 21:26:21 +0000
committerMartin Geubelle <mge@odoo.com>2019-03-08 09:38:23 +0000
commit5aa00c3362674ce41d19ea43c0c722c3c874390f (patch)
tree2a372472ccd62694fa1146e3cb5475a766933015 /addons/web/static/src
parent776cab07d017292d67ea8b5ccfcc16e1162720e7 (diff)
[IMP] web: allow to override the number of buttonbox buttons
See odoo/odoo#31546 closes odoo/odoo#31698 Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/views/form/form_renderer.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/form/form_renderer.js b/addons/web/static/src/js/views/form/form_renderer.js
index c5078690894..b6c3b0cb6a5 100644
--- a/addons/web/static/src/js/views/form/form_renderer.js
+++ b/addons/web/static/src/js/views/form/form_renderer.js
@@ -279,7 +279,7 @@ var FormRenderer = BasicRenderer.extend({
var visible_buttons = buttons_partition[1];
// Get the unfolded buttons according to window size
- var nb_buttons = [2, 4, 6, 7][config.device.size_class];
+ var nb_buttons = this._renderButtonBoxNbButtons();
var unfolded_buttons = visible_buttons.slice(0, nb_buttons).concat(invisible_buttons);
// Get the folded buttons
@@ -319,6 +319,13 @@ var FormRenderer = BasicRenderer.extend({
return $result;
},
/**
+ * @private
+ * @returns {integer}
+ */
+ _renderButtonBoxNbButtons: function () {
+ return [2, 4, 6, 7][config.device.size_class];
+ },
+ /**
* @private
* @param {Object} node
* @returns {jQueryElement}